• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: advancementForGlyph problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: advancementForGlyph problem


  • Subject: Re: advancementForGlyph problem
  • From: "David F." <email@hidden>
  • Date: Sun, 2 May 2010 19:01:41 -0600

On Apr 30, 2010, at 10:37 AM, Dale Miller wrote:

> For character measurements, if you are using the Cocoa text system, use the font returned by the NSLayoutManager method "subtituteFontForFont:" in order to get the screen font used by Cocoa text. However, experimentally, I found that for font sizes greater than 17, non-integral values are still returned. I've not found any documentation as to how Cocoa text (or Quartz text or CoreText) arrive at the values they actually use.

Dale -- Thanks for responding.  "substituteFontForFont:" didn't fix my problem, but I'm glad you brought font substitution to my attention.  One more thing I need to keep my eye on.

> If you're not using Cocoa text, you will have to do some rounding to integral values: e.g. floor(value+0.5) or truncating: floor(value). Experimentally, Cocoa text seems to use rounding for advancement, and truncation for line height, at least with the fonts/sizes I've tried.

I would be perfectly happy truncating the advancement (despite the tighter kerning it would give me).

> The Application Services Framework provides a couple of functions for drawing glyphs that give you explicit control over advancement: CGContextShowGlyphsWithAdvancements
> and CGContextShowGlyphsAtLocations.

Hmmm.  I'll have to give those functions a look.  Do they handle strikethrough/underline?

David_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: advancementForGlyph problem
  • Next by Date: Compress / Uncompress
  • Previous by thread: Re: advancementForGlyph problem
  • Next by thread: Compress / Uncompress
  • Index(es):
    • Date
    • Thread