Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!gem.mps.ohio-state.edu!sunybcs!acsu.buffalo.edu!volaski From: volaski@acsu.buffalo.edu Newsgroups: comp.sys.mac.programmer Subject: LDEF with multiple fonts Message-ID: <13687@eerie.acsu.Buffalo.EDU> Date: 22 Nov 89 15:02:50 GMT Sender: nobody@acsu.buffalo.edu Reply-To: volaski@acsu.buffalo.edu () Organization: Suny at Buffalo Lines: 31 I am trying to implement a list with text that has multiple fonts. The standard listDefProc allows for text, but it uses the current grafport's font. As a result only one font, face, and style is allowed. One solution to this is to write an LDEF that uses the new textedit routines in IM vol 5. Another is to write an LDEF that draws to an offscreen bitmap and uses copybits to copy to the list. I have tried both with only some success. First, I wrote an LDEF that puts a edit record (with TEStyleNew) into the list's userhandle. Then in the draw routine I am setting the text to what it is set to by LSetCell in the DA. (oh yes the LDEF is being called from a DA) Finally I call TEUpdate to draw the text. The problem is that it works for the first cell only. Sucessive cells do not draw. I have used drawstring and have determined that my LDEF is carrying out LSetCell. Why would this only work for the first cell drawn and then just stop? Second, I tried something simple like calling TextFont to change grafport characteristics each time a drawMessage is sent to my LDEF. This doesn't work and I figure it is because my LDEF cannot accesss the DA's grafport. I then tried making a new grafport and changing its font with TextFont and using CopyBits to draw into a cell. This works! But it is very slow. I wanted to make the grafport in response to an initialization message, but it appears that the list manager will only allow private storage in the list record's userhandle. Is there a way to allocate storage for a grafport in the list record's userhandle? Finally, is there some other method I haven't thought of using? Any help will be appreciated. Maurice Volaski