user342731
user342731

Reputation: 61

Android: Characters not supported in custom font showing up as blanks

I'm attempting to use the Neucha font from Google Font Directory (link) in my Android app.

With other custom fonts, unsupported characters are still displayed, such as Japanese characters, as well as accented characters. However with the Neucha font, most unsupported characters (such as Asian ones) are displayed, but some accented characters (â, ã, ä, å, ą, ô, õ, ö, ő for example) are not displayed. Instead blank spaces are shown in their places.

Is this an issue with the font, or with Android? What can I do to get characters not supported by this font to be displayed using the default font in an EditText view? Thanks!

Upvotes: 3

Views: 1529

Answers (2)

Taras
Taras

Reputation: 21

  1. Letters were omitted because of font.
  2. Usage of multiple typefaces inside single TextView/ EditView is possible. You may use this class.

    SpannableString string = new SpannableString("test");

    string.setSpan(new TypefaceSpan(myTypeface),0,2,0);

  3. In order to use custom fonts in same way you may implement your own Span class. [here]http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.1_r2/android/text/style/TypefaceSpan.java) is code sample.

Upvotes: 2

user432209
user432209

Reputation: 20167

What can I do to get characters not supported by this font to be displayed using
the default font in an EditText view?

To my knowledge, it is impossible to have two separate fonts used in the same EditText at the same time.

Upvotes: 0

Related Questions