Courier New glyph bounding box in 10.7

4 views
Skip to first unread message

Matthew Flatt

unread,
Mar 25, 2012, 10:11:44 AM3/25/12
to quart...@lists.apple.com
Is there a known issue with the bounding box of glyphs in the Courier
New font with 10.7?

The result from CGFontGetGlyphBBoxes(), at least, looks wrong to me on
the glyph for "e". Running the program below on 10.6.8, I get

128.000000 -33.000000 943.000000 929.000000

which looks right. On 10.7.3, I get

0.000000 -33.000000 943.000000 929.000000

which looks wrong compared to the way the glyph drawns. It's as if the
glyph's X-offset has gotten lost in the font description.


The actual symptom I'm dealing with is that Cairo renders Courier New
badly to a pixman-based surface; for example, the right-hand edge of
"e" is clipped if the font is large enough. That problem happens for me
only on 10.7, and it seems to be rooted in the bounding box reported by
CGFontGetGlyphBBoxes().

Thanks,
Matthew

----------------------------------------

#include <ApplicationServices/ApplicationServices.h>
#include <stdio.h>

int main()
{
CGFontRef font = CGFontCreateWithFontName(CFSTR("Courier New"));
CGGlyph glyphs[1] = { CGFontGetGlyphWithGlyphName(font, CFSTR("e")) };
CGRect r;

CGFontGetGlyphBBoxes(font, glyphs, 1, &r);
printf("%f %f %f %f\n", r.origin.x, r.origin.y, r.size.width, r.size.height);

return 0;
}

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartz-dev mailing list (Quart...@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/quartz-dev/quartz-dev-garchive-50095%40googlegroups.com

This email sent to quartz-dev-g...@googlegroups.com

Reply all
Reply to author
Forward
0 new messages