Path: utzoo!attcan!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!ucsd!sdcc6!odin!neil From: neil@odin.ucsd.edu (Neil Rhodes) Newsgroups: comp.sys.mac.programmer Subject: Re: Text Spacing on Laser & Fractional Font Sizes? Message-ID: <13685@sdcc6.ucsd.edu> Date: 29 Oct 90 15:09:22 GMT References: <1990Oct28.235805.2481@fennel.cc.uwa.oz.au> Sender: news@sdcc6.ucsd.edu Organization: Calliope Enterprises Lines: 50 Nntp-Posting-Host: odin.ucsd.edu In article <1990Oct28.235805.2481@fennel.cc.uwa.oz.au> a_dent@fennel.cc.uwa.oz.au writes: >I'm working on a newspaper printing application where I have to fully justify >text >So far I've come to terms with SetFractEnable and SpaceExtra and am using the >PicComment to tell the laserprint to fully justify the text. > >The books/Technotes say that the Laserwriter takes the text endpoints set by >Quickdraw and justifies the text between those points. As far as I can see, >the only way to set these "Endpoints" is to draw the text in Quickdraw as >accurately as possible - ie: using fractional widths and SpaceExtra. Am I >missing something here? I worked on the HP PaintJet and PaintWriter drivers and am familiar with how other printer drivers handle text. The best way to set text for printing is indeed to make sure that the QuickDraw calls you make cause the endpoints of the text to be where you want it. Note that most printer drivers do NOT set each string (call to DrawString, DrawText, or StdText) individually, but rather look at a whole line, and cause the endpoints of the whole line to remain the same. Therefore, a word in bold in the middle of a line of normal text is justified along with the normal text. Using fractional widths is certainly your best bet. If your goal is to justify your text, fractional widths along with SpaceExtra will work just fine. Note that the printed page will most likely have different amounts of space for the space character than you requested; however, the endpoints will remain constant. There is no need to use the LaserWriter picture comment to do full justification. > >Secondly, how do you specify fractional font sizes? The text I am trying to >emulate looks like about a 5.9 point Helvetica. > There is a QuickDraw call StdText which takes as parameters a numerator and denominator (both points) which specify the horizontal and vertical scaling. To obtain 5.9 point text, you could specify 59 point text with TextSize, and then call StdText with numer.h=numer.v=10, and denom.h=denom.v=10. You can make sure this is doing what you want by drawing to the screen first (you should see six point on the screen). >Andy Dent A.D. Software phone 09 249 2719 >Mac & VAX programmer 94 Bermuda Dve, Ballajura >a_dent@fennel.cc.uwa.oz Western Australia 6066 >a_dent@fennel.cc.uwa.oz.AU (international) -- Neil Rhodes Calliope Enterprises, Inc. neil@odin.ucsd.edu