Re: [Bug?] Text rendering under Cocoa
Re: [Bug?] Text rendering under Cocoa
- Subject: Re: [Bug?] Text rendering under Cocoa
- From: Brock Brandenberg <email@hidden>
- Date: Tue, 12 Nov 2002 14:16:37 -0600
Unfortunately, this is the nature of font metrics and glyphs. Some type
designs tend to hang the geometry of glyphs outside of the box defined by 1)
the origin point, 2) the advancement past the glyph, 3) the descent value
and 4) the ascent value. You never see this kind of problem with fonts like
Helvetica or Times, but more stylish fonts like Zapfino draw way outside of
these metric values.
What happens with most of the Cocoa methods and CG text drawing functions is
that there is not enough of an offset to account for the part of the glyph
to the left of the glyph origin point. Is it a bug? Not really. There is an
optical center to glyphs and if you were to adapt to the glyphs and move
them over so that they do not clip, you would destroy the optical alignment
between the first character of each line in a multi-line text box.
Unfortunately, it's up the developer to accommodate these situations by
padding around their text drawing. You will need to use the NSLayoutManager
to get the true bounding boxes for the glyphs and accommodate the geometry
that hangs outside the normal region.
Brock Brandenberg
>
Is this a known bug that when you try to draw a huge 'j' letter with
>
the AppKit, you get an improper result.
>
>
Example:
>
>
1) Launch TextEdit.app
>
2) Type: JJoy of Tech
>
3) Select the text and set the font to be Lucida Grande 288.
>
>
And then compare the J on the left to its neighbour. Looks like the
>
first J is on horizontal diet.
>
>
I don't think it's a Ligature or Kern thing.
>
>
We're seeing this bug with [NSString drawAtPoint: withAttributes:]; too.
>
>
Do I need to file a bug report or is this a known issue (which is also
>
in 10.1 AFAIK)?
----- industrial design @ www.bergdesign.com ------
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.