How to draw text with fixed spaced font using arbitrary cpi
How to draw text with fixed spaced font using arbitrary cpi
- Subject: How to draw text with fixed spaced font using arbitrary cpi
- From: Buddy Kurz <email@hidden>
- Date: Fri, 16 Jun 2006 11:23:12 -0700
I am using [string drawAtPoint:where withAttributes:textAttributes ]
in a PCL5 printer emulation I require for legacy application support.
I am using "Courier New" and calculating a font size that satisfies
([curFont advancementForGlyph:[curFont glyphWithName:@"M"]].width ==
(horizMotion=72.00 / cpi)) and including NSFixedPitchFontMask in the
traits passed to the font manager.
The printed output doesn't line up vertically.
So the multi-part question is:
Why does Courier New not have a fixed advance width? A row of
dashes is shorter than a row of numbers on paper.
If there a best way to use the font manager to specify a fixed
font with a specific typeface and number of characters per inch.
Should I be using some other method to draw in my NSView subclass?
I'm hoping I don't have to draw each character at the next horizontal
position.
thanks,
Buddy Kurz
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden