• 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
layout manager muffs glyph to character mapping ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

layout manager muffs glyph to character mapping ?


  • Subject: layout manager muffs glyph to character mapping ?
  • From: Robert Clair <email@hidden>
  • Date: Tue, 28 Dec 2004 09:09:46 -0500

I'm trying to use the layout manager to map glyphs back to characters:

characterRange =
[layoutManager characterRangeForGlyphRange: glyphRange
actualGlyphRange: &actualGlyphRange];


after loading the text storage with an attributed string.

It seems to screw up with ligatures: it finds the first one if it is
the first glyph in the string but otherwise it misses them.

I tried logging it in aloop over the glyphs with with

printf( "glyphRange: %d %d actualGlyphRange: %d %d characterRange: %d %d\n",
glyphRange.location, glyphRange.length,
actualGlyphRange.location, actualGlyphRange.length,
characterRange.location, characterRange.length );

For the string "fl fl aa" - using Times Roman in which "fl" is a ligature I get
the results:

glyphRange: 0 1 actualGlyphRange: 0 2 characterRange: 0 2
glyphRange: 1 1 actualGlyphRange: 1 1 characterRange: 1 1
glyphRange: 2 1 actualGlyphRange: 2 1 characterRange: 2 1
glyphRange: 3 1 actualGlyphRange: 3 1 characterRange: 3 1
glyphRange: 4 1 actualGlyphRange: 4 1 characterRange: 4 1
glyphRange: 5 1 actualGlyphRange: 5 1 characterRange: 5 1

It finds the first ligature, but not the second.

With the string "aa fl aa" I get:

glyphRange: 0 1 actualGlyphRange: 0 1 characterRange: 0 1
glyphRange: 1 1 actualGlyphRange: 1 1 characterRange: 1 1
glyphRange: 2 1 actualGlyphRange: 2 1 characterRange: 2 1
glyphRange: 3 1 actualGlyphRange: 3 1 characterRange: 3 1
glyphRange: 4 1 actualGlyphRange: 4 1 characterRange: 4 1
glyphRange: 5 1 actualGlyphRange: 5 1 characterRange: 5 1
glyphRange: 6 1 actualGlyphRange: 6 1 characterRange: 6 1

nothing.

I know the layout manager emits a null glyph for ligatures, but isn't
this supposed to keep track of things ? This is inconsistent
no matter how you look at it.


....Bob Clair
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: NSApplicationSupportFolder
  • Next by Date: Re: NSApplicationSupportFolder
  • Previous by thread: Re: Table View problem
  • Next by thread: symbol font (yet again)
  • Index(es):
    • Date
    • Thread