• 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: steven Hooley <email@hidden>
  • Date: Fri, 30 Apr 2010 12:08:04 +0100

> The information I am getting back from advancementForGlyph doesn't
> seem to be correct.  Here are the glyph bounds and advancement for
> the capital letter 'A' in Georgia 36pt:
>
> == A ==
> bounds x: -0.720703
> bounds y: 0.000000
> bounds w: 25.699219
> bounds h: 25.294922
> advance w: 24.152344
> advance h: 0.000000
>
> The problem that I am seeing is that it looks like the advancement
> should only be 23 (maybe ~23.2).  TextEdit appears to be using an
> advancement of 23 and underlines and strikethroughs are being drawn
> 23 pixels wide.
>
> Any ideas on what I am doing/understanding wrong?

The information is 'correct', ie. it is was it is - the data encoded
in the font scaled to your working size.

How on earth are you determining that it "looks like the advancement
should only be ~23.2" ?

"TextEdit appears to be using an advancement of 23" How have you
determined this?

If you have infact determined that TextEdit uses and advance of
~23.2px, what makes you think that this is more likely to be correct
than the value encoded in the font, by the font designer?

>From your later response it seems like your question is really
regarding drawing strikethroughs and underlines. If so, the strike
through and underline are not part of the glyph or font - they are
just a line drawn from the start point of a range of glyphs to the end
point of a range of glyphs. You cannot draw them piecemeal, a glyph at
a time, and expect them to perfectly match up without overlap or
underlap (apologies for making up a word), as the amount that any 2
glyphs overlap is particular to those 2 glyhps. ie. The strikethrough
of an 'A' followed by a 'V' would need to be a different length than
that of an 'A' followed by a 'j'.
_______________________________________________

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

  • Follow-Ups:
    • Re: advancementForGlyph problem
      • From: Graham Cox <email@hidden>
  • Prev by Date: Re: coreData and interapp comm via TCP/IP
  • Next by Date: Re: test if folder contains file based on NSURLs
  • Previous by thread: Re: advancementForGlyph problem
  • Next by thread: Re: advancementForGlyph problem
  • Index(es):
    • Date
    • Thread