Running into a problem with bitmap fonts. If I create bitmap fonts at two different sizes, Sparrow cannot distinguish them.
The problem is SPTextField caches fonts based on the font name.
+ (NSString *)registerBitmapFontFromFile:(NSString*)path texture:(SPTexture *)texture
if (!bitmapFonts) bitmapFonts = [[NSMutableDictionary alloc] init];
SPBitmapFont *bitmapFont = [[SPBitmapFont alloc] initWithContentsOfFile:path texture:texture];
NSString *fontName = bitmapFont.name;
[bitmapFonts setObject:bitmapFont forKey:fontName]; // ***
And the font name is just the font face from the .fnt file.
mName = [[attributeDict valueForKey:@"face"] copy];
So, if you have "Helvetica" in two sizes, only the 2nd one that is registered will be used.
The workaround is to manually edit the .fnt file to give it a unique name - bit it's annoying and error-prone to do this each time the fonts are re-generated.
It seems a proper fix would be to include the 'size' property of the bitmap font in the key. So, "Helvetica_12" instead of just "Helvetica".
Any other ideas for a fix?