Hooray for me! It looks like embedding the font and applying a TextFormat to the temporary TextField does the trick. Of course, now I have to ensure that there's a suitable font embedded in any SWF that uses this class, but I guess you can't have it all. Anyone else discover an alternate solution that would avoid this?
-mark hawley > > From: John Mark Hawley <[EMAIL PROTECTED]> > Date: 2006/06/29 Thu PM 01:22:27 CDT > To: <Flashcoders@chattyfig.figleaf.com> > Subject: [Flashcoders] TextField PrintJob oddities > > I'm having an odd problem with a wrapper I've written for the PrintJob class. > One of the methods of the wrapper, printString(), takes a string of arbitrary > length and is *supposed* to print all of it, breaking it over pages as > needed. It *almost* works, and I need some assistance figuring out where the > real problem is. Here's how it works now: > > 1. start the printJob so we have access to pageWidth and pageHeight > > 2. create a temporary TextField with the dimensions of pageWidth and > pageHeight, with multiline and wordWrap on, all other settings as default > > 3. put the string into the TextField > > 4. get the number of pages and number of lines per page by setting scroll=1 > and checking bottomScroll and maxscroll > > 5. add enough newline padding to the end of the string so that the last page > can scroll up high enough > > 5. for each page: > a. set scroll = loopIndex * linesPerPage + 1 > b. addPage( tempTextField ) > > 6. send the printJob to the printer > > Sound good? Good. Now, when I look at my temporary text field on screen, I > see that, with my printer settings and default formatting, 50 lines are > visible on screen at a time. *However* when I look at my printouts, I get 55 > lines per page! (This is a problem because the code *thinks* only 50 lines > fit on a page, so the pagination goes screwy.) Oh, and this happens even if I > printAsBitmap. > > Is there an alternate approach I'm missing? Is the size difference between > screen and print text linear? Should I be fooling around with different > TextFormats to try applying to my temporary TextField? I welcome any > suggestions. > > -Mark Hawley > > -- > John Mark Hawley > The Nilbog Group > 773.968.4980 (cell) > > _______________________________________________ > Flashcoders@chattyfig.figleaf.com > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com > http://training.figleaf.com > -- John Mark Hawley The Nilbog Group 773.968.4980 (cell) _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com