Custom Fonts for non-English Text - iphone

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.

Related

Why does Firefox squeeze Windows' heart, but not Ubuntu's?

I'm trying to display the heart ♥ Unicode character (U+2665 BLACK HEART SUIT) in this jsfiddle.
Even though I've specified the Droid Sans font, the different browsers are displaying the same character differently. So, I'm assuming that the Droid Sans font doesn't include the ♥ character and the browser must fallback to some other font to display this character. But how does the browser determine which font to use for Unicode characters; as it turns out (from screenshots) that it's not operating system specific as Firefox and Chromium both on Ubuntu display it differently; and also it is not browser specific as Firefox displays it differently on Ubuntu and Windows 7.
So my questions are - How does a browser determine which font to use to display Unicode characters; how can I find out which font is being used by the browser to display Unicode characters; and how can I ensure a consistent look cross-browser?
PS: (Firefox specific) Even though Droid Sans doesn't include the ♥ character, Firefox displays it as in screenshot only when the selected font is Droid Sans. For any other font, Firefox picks up the DejaVu Sans font to display the ♥ character (on Ubuntu, confirmed by hit and trial).
The Droid Sans font does not contain U+2665 BLACK HEART SUIT, so declaring the font is rather irrelevant here. I cannot reproduce the observation in your “PS”, so I’m not trying to explain it.
(A quick way to check character coverage in a font is to download and install the LastResort font. It contains a generic, easily recognizable rendering for all characters, so by using font-family: foo, LastResort on your test text you will quickly find out whether a particular character exists in font “foo”.)
The use of fallback fonts is browser-dependent. Browsers may have settings for this. But the point is that you, as an author, cannot know what happens on other people’s browsers, when your characters cannot be found in the list of fonts you specify (as installed, if installed, in the user’s computer).

Change default font in netbeans?

Is it possible to change the default font in netbeans? The documentation says:
The font Monospaced is maped to different fonts on different systems.
On Windows it is mapped to "Courier ", on Linux it is mapped to
"Lucida Typewriter".
http://ui.netbeans.org/docs/ui/editor_fonts_colors/Editor_fonts_and_colors.htm
I'm on windows and want to map Monospaced font to 'Consolas' instead of 'Courier'.
P.S. I know that fonts can easily be changed from options, but when I change it in this way, I can no longer use unicode characters. Guess I need to do what they call 'mapping' the monospaced font to other font.
Tools > Options > Fonts and Colors
Set the category "Default", and to the right of that, the font you want to use.
If this does not fix it, try adding:
--laf Nimbus -J-Dswing.aatext=true -J-Dawt.useSystemAAFontSettings=lcd
or
-J-Dswing.aatext=true -J-Dawt.useSystemAAFontSettings=lcd --laf Metal
to the file : netbeans.conf. You can find it in $NETBEANS_HOME/etc/ folder. Make your application font smaller from system preferences.
To change the font size outside of the editor you can configure by editing the Net Beans conf file, you can find it here:
C:\Program Files\NetBeans 8.0.2\etc\netbeans.conf
Then edit this line:
netbeans_default_options="..."
by adding this at the end:
--fontsize 18
I hope it helps :-)
Life becomes more easier now. Just from Tools menu choose Options and then follow steps on the following screen shot and take care with step 3 and 4 which they are making the default font for all languages:
I have a NetBeans plugin called 'UI-Editor' which allows you to customize virtually any Swing property, including font sizes, colors, and types. Go to Tools->Plugins and search for 'UI-Editor' or go here: http://plugins.netbeans.org/plugin/55618/?show=true
also don't not forget to change the font to the one that support Arabic like Arial for example i am not sure of some one mention that i just tried it
As far as I can tell there's no way to do this. jEdit (http://jedit.org) also uses Swing and DOES do font substitution for all fonts - there's a "automatic font substitution" checkbox in Global Options > Text Area, along with a list of preferred fonts. But jEdit is otherwise not as capable as Netbeans.

Why do Firefox and Chrome render "ಠ_ಠ" (U+0CA0) differently, even if I set both on UTF-8?

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.

Localize text into chinese using custom fonts

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.

Letterspacing in Eclipse code editor

Is there any way to change the letter-spacing of text in Eclipse's code editor?
Maybe you can try changing from a fixed width font to the variable width font like Verdana or Tahoma. Window->Preferences->Appearance->Colors and Fonts->Basic->Text Font
If you mean the java code editor in Eclipse this is not possible. The editor is not a word processor. You can only change the font setings (typeface, style, color, size).
If you are referring to this kind of letter spacing, then no, I do not think so.
Not in the sense that a typography system allows you to tweak the appearance of text on a printed page.
The default for me is Courier New Regular 10. You can change the size to 12 or some other size.
Are you trying to change the kerning rules? Kerning is positioning different letters in a variable-width font. For instance in the word "We", the "e" is tucked in a little bit under the "W". The page-layout software that magazine publishers use can control this.
Fonts are opaque to Eclipse; it doesn't give you a way to change the rules within the font. Unfortunately the best you can do is try the different fonts and sizes until you find one that has kerning rules that work, more or less.