Hi,
My client has given me a custom TTF font only for English. So my intention is to load that TTF only for English and for other languages it should fallback to the available System font.
I am doing the following steps:
- Registering fonts with my app. Copying into Resources folder and add to my project.
Loading the font with name.
NSMutableDictionary * aTitleAttributes = [[[NSMutableDictionary alloc] initWithObjectsAndKeys: [NSFont fontWithName:CP_FONT_NAME size:[NSFont systemFontSize]], NSFontAttributeName, aParagraphStyle, NSParagraphStyleAttributeName, nil] autorelease];
But this results into another problem, since I am loading the fonts in this way for all the languges, my localization text looks english. Hence I think I should have some condition like
NSFont *font = nil;
If (currentLocaleIsEnglish()) {
/// font to load my custom TTF
}
Then use [NSFont fontwithName:font ...]
So can anybody help me to realize whatever I am doing is right with registering the font with App. If so how can I register my font only for English version. Because for other locales this font is not available then NSFont::fontWithName
will return nil and automatically fallsback to the SystemFont and hence my locale shall be shown properly.
Otherwise I have to have a condition like what I mentioned above, which is a crude way of doing. If so how can I write such an API for finding currentLocale Is English?
Regards Mustafa