Merge pull request #10 from gunyarakun/fix-invalid-return
[cocotron.git] / Onyx2D / O2Font_ttf.m
blob5bfa3cca51189234c0ddd2404c3a15424ba7a07e
1 #import <Onyx2D/O2Font_ttf.h>
2 #import <Onyx2D/O2TTFDecoder.h>
5 @implementation O2Font_ttf
7 -initWithDataProvider:(O2DataProviderRef)provider {
8    O2TTFDecoderRef decoder=O2TTFDecoderCreate(provider);
9    
10    _nameToGlyph=O2TTFDecoderGetPostScriptNameMapTable(decoder,&_numberOfGlyphs);
11    _glyphLocations=O2TTFDecoderGetGlyphLocations(decoder,_numberOfGlyphs);
12    return self;
15 -(O2Glyph)glyphWithGlyphName:(NSString *)name {
16    return (O2Glyph)(int)NSMapGet(_nameToGlyph,name);
19 O2FontRef O2FontCreateWithFontName_platform(NSString *name) {
20    return nil;
23 O2FontRef O2FontCreateWithDataProvider_platform(O2DataProviderRef provider) {
24    return nil;
27 @end