Re: Why do all these methods of measuring string metrics with font attribute fail?
Re: Why do all these methods of measuring string metrics with font attribute fail?
- Subject: Re: Why do all these methods of measuring string metrics with font attribute fail?
- From: an0 <email@hidden>
- Date: Thu, 4 Sep 2008 22:58:22 +0800
I know the difference between string and font, and that between
grapheme and glyph.
However, I might miss the point that the size of the rendered string
is not simply the sum the sizes of individual glyphs. There should be
some extra space taken by spacing among and around glyphs. And some
other more subtle typesetting details, also.
Thanks for your hint, anyhow.
On Thu, Sep 4, 2008 at 10:05 PM, Graham Cox <email@hidden> wrote:
>
> On 4 Sep 2008, at 11:27 pm, an0 wrote:
>
>> If they give no useful information for
>> application programmers,
>
>
> Yes they do, but perhaps just not for your application. If you want to use
> glyphs as a graphic element for example, it's sometimes useful to query
> these sizes without having to try laying them out as text. Remember, there
> is a big difference, conceptually, between a string (a collection of
> characters) and a font (a collection of glyphs). Glyphs are graphical
> entities, and most of the stuff in NSFont and NSFontManager is there to
> support these concepts at that level.
>
> Your problem (and confusion) appears to stem from the fact that you seem to
> think that a font is something like a string, and so can be treated as a
> collection of characters. The layout of glyphs to form an image of a string
> of text on the screen is a complex process, and applications that do this
> need to know all sorts of metrics beyond "how much space does this string
> occupy". In fact to calculate that they need to add up the space occupied by
> each glyph, and some of the methods you mentioned are there to support that
> sort of processing.
>
> cheers, Graham
>
_______________________________________________
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