Re: Unicode to CGGlyph ?
Re: Unicode to CGGlyph ?
- Subject: Re: Unicode to CGGlyph ?
- From: Christopher Lloyd <email@hidden>
- Date: Sun, 06 May 2001 07:47:44 -0400
Hi, thanks, hadn't looked at it that way. Are there alternatives or more
direct ways to this though? I have unichar buffer[] and just want to
generate one glyph for each of the characters and draw it on the screen
using my own x,y's (I know this isn't "correct" for all characters/fonts,
but that is what I need to do). I need to do this very fast, so I'd have to
use NSLayoutManager to build my own unichar to glyph mapping tables/cache
for performance. This seems like reinventing the wheel when the underlying
systems most definitely have this kind of functionality (Where does
NSLayoutManager get this info?). The private function
CGFontGetGlyphsForUnicodes() seems like a good candidate for what I want,
but alas it is private. NSFont seems to have everything but this functionality.
I should point out this is pretty straightforward to do on NT/2000 using
GetCharacterPlacementW()
Oh well...
Chris
At 09:54 AM 5/5/2001 -0700, Ali Ozer wrote:
You can use NSLayoutManager / NSTextStorage combo to generate glyphs for
an attributed string (unichars + style info). The glyphs and info about
their locations will be available in the layoutmanager, which you can keep
around as long as you need.
[...]
From: Christopher Lloyd <email@hidden>
Date: Sat May 05, 2001 02:42:20 AM US/Pacific
Subject: Unicode to CGGlyph ?
Hi, does anyone know how to convert unichar's to CGGlyph's ? I would like
to use CGContextShowGlyphsAtPoint and need a way to generate the glyphs.
I don't want to use the string drawing stuff in the AppKit for
performance reasons.
[...]