Loading...

quartz-dev@lists.apple.com

[Prev] Thread [Next]  |  [Prev] Date [Next]

Courier New glyph bounding box in 10.7 Matthew Flatt Sun Mar 25 08:00:05 2012

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      ([EMAIL PROTECTED])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/quartz-dev/alexiscircle%40gmail.com

This email sent to [EMAIL PROTECTED]