I know how to use custom fonts to display CCLabels. I also figured out how to localize the Labels. But I am wondering if there is anyway to display the localized text using custom fonts.
For example when I use Arial I have no problems, the chinese fonts appear correctly. But when I use a font not included in XCode such as ARLRDBD.TTF then the chinese characters do not get displayed.
How can I display the chinese characters in ARLRDBD.TTF too? Or am I stuck with just using the default fonts included in XCode if I plan to use LocalizedString?
Thanks
Abhinav
You should be able to use any font that has Chinese characters in it.
Not all fonts include characters for all languages. Many Western fonts only have the Roman alphabet (A-Z).
You could either use a font that has all the characters you will need (like Arial, or another Unicode font - see: http://en.wikipedia.org/wiki/Unicode_typeface), or have separate fonts for each language.
I'd suggest a different font for each language.
You could keep it organized with a simple struct.
typedef struct {
NSString *regionname;
NSString *fontname;
} RegionFont;
//later in the code....
RegionFont some_region;
some_region.regionname = #"China";
some_region.fontname = #"Arial";
You can test if a font supports a given language by opening Font Book (standard Mac app) and searching under "All Fonts" for the language you want.
I don't have many custom fonts installed and several with Chinese support come up.
Hope this helps.
You can use custom fonts in your app but you need to make the system aware that they exist using the UIAppFonts key in your Info.plist file. See here for more information.
Related
When VSCode deals with two languages inside of the editor (the main font has the support of Cyrillic alphabet though), the Russian language shown with a different font, how to get the same font for Russian and English as well?
Example:
<title>"Писатели Якутии"</title>
Is it because your main font does not contain the required UTF subset, so a fall back font is used, or what? If it is true, how to add the required UTF subset to VSCode?
System: macOS Mojave, the latest version of Visual Studio Code.
The answer is, thanks to Reddit:
1) Just use a font with the Cyrillic alphabet as my main font;
2) Add preferred Cyrillic font second in the list of fonts in fontFamily, as in:
"editor.fontFamily": "fontOne, fontTwo",
iam using a custom arabic font for my app
but sometimes the data that coming from the server come in english
the problem is that the custom arabic font not changing the english
letter font to the main font like what is happening in android
i used the localization to determine the language of the app but it didnt success
because i think that the app language didnt change
its just the letters
so i think if i could determine the language of the text then choose the font for it
or using a font that supporting arabic or english
but is there any better solution?
thank u
The character in question is ಠ (U+0CA0; ಠ). Here are three screenshots:
Chrome 17 for Mac
Firefox 7 for Mac
Firefox > 4 for Windows
All browsers I tried had UTF-8 as encoding. Here it is copy-pasted : ಠ_ಠ, but I have no idea how you are seeing it.
This is probably due to the different platforms and browsers having different default fonts and font implementations.
The font-family on SO is:
Arial,Liberation Sans,DejaVu Sans,sans-serif
So different fonts will apply on different platforms.
In your Mac examples, the different browsers display a "missing" glyph differently - Chrome with a simple square, FF with the hex Unicode of the missing glyph rendered within the box (in this case 0CA0).
The glyph is not covered by the font used by the webbrowser to display the page which is either the browser default font or the font specified by CSS on the page. You need to make sure that you specify a font by CSS which has most likely guaranteed this glyph in all environments. Arial, for example.
This problem is not related to the character encoding used. A problem in the character encoding used would rather have resulted in Mojibake, not in empty boxes or boxes with hexcode representing the Unicode codepoint which basically identify an unavailable glyph in the font used.
What you posted does not contain U+3232 PARENTHESIZED IDEOGRAPH HAVE “㈲” but a three-character sequence U+0CA0 U+005F U+0CA0, i.e. LOW LINE between two KANNADA LETTER TTHA characters. I don’t know what happened and where. Posting a URL might help.
There are differences in rendering across computers due to different font repertoires. The first two renderings in your screenshot indicate lack of glyphs, i.e. no font in the system contains the character U+0CA0.
Firefox and Chrome (unlike IE) tend to scan thru all available fonts to find the character. But rare special characters often have unsatisfactory implementations in fonts, so for best results, check out the list of fonts supporting the character and specify them in your font-family declaration in order of preference. This also helps poor IE to find a suitable font when available.
If the character you want is really U+3232, then check out
http://www.fileformat.info/info/unicode/char/3232/fontsupport.htm
It most probably does not cover all fonts, since new fonts emerge. But for this character, Arial Unicode MS is probably the font that will be used in the great majority of browsing situations – and if it is not available, an indicator of missing glyph is seen.
I installed a custom font however, my app runs on two languages. I noticed that the custom fonts work with English but not with non-English. How can I overcome this?
You need to choose a custom font that includes "glyphs" for all of the special characters and punctuation that are needed for the language you are using. If the custom font you have is missing these extra glyphs, then you can either edit the font in a font editor such as Fontographer to add the missing glyphs (this requires drawing them in or copying parts from other letters), or finding a new version of the same font that includes the glyphs you need.
You can see the missing glyphs by opening a font that has these glyphs in the "Font Book" program included with mac os x. Then you can open your custom font and compare the two to see what's missing.
Also keep in mind that you usually need a custom license from the font owner to include fonts in your application.
I was wondering if there is a built-in font for Japanese kana in the iPhone OS?
I was wanting to display kana characters and figured it would be easier to generate them in a UILabel as text versus creating a .PNG and display them in a UIImageView. I would want this to be available to non-Japanese iPhones/iPods. I'm not 100% aware if there are differences in the localizations of them as I could not find any of this info in the Dev. Center. Thank you for our time!
Yes, there's a font which contains Hiragana, Katakana and Kanji. I'm not sure if there's a way to specify the style of the font though.
You can type Japanese straight into an 'NSString' and set the label text, it will show up no problem.
**Edit: ** I found this list of fonts on the iPhone, which lists "Hiragino Kaku Gothic ProN W3", a Japanese font. You can find it on the Mac too, it's the standard Japanese font. There's also a bold version. There doesn't seem to be a rounded version, just gothic.
http://www.alexcurylo.com/blog/2008/10/05/snippet-available-uifonts/