1 #import <Onyx2D/O2Font_ttf.h>
2 #import <Onyx2D/O2TTFDecoder.h>
5 @implementation O2Font_ttf
7 -initWithDataProvider:(O2DataProviderRef)provider {
8 O2TTFDecoderRef decoder=O2TTFDecoderCreate(provider);
10 _nameToGlyph=O2TTFDecoderGetPostScriptNameMapTable(decoder,&_numberOfGlyphs);
11 _glyphLocations=O2TTFDecoderGetGlyphLocations(decoder,_numberOfGlyphs);
15 -(O2Glyph)glyphWithGlyphName:(NSString *)name {
16 return (O2Glyph)(int)NSMapGet(_nameToGlyph,name);
19 O2FontRef O2FontCreateWithFontName_platform(NSString *name) {
23 O2FontRef O2FontCreateWithDataProvider_platform(O2DataProviderRef provider) {