Android: characters that are not supported in custom font are displayed as spaces

I am trying to use the Neucha font from the Google Font directory ( link ) in my Android application.

Other custom fonts retain unsupported characters, such as Japanese characters, as well as accented characters. However, with the Neucha font, most unsupported characters (e.g., Asian) are displayed, but some accented characters (e.g., â, ã, ä, ​​å, ą, ô, õ, ö, ő) are not displayed. Instead, spaces are displayed in their places.

Is this a font problem or Android issue? What can I do to make characters not supported by this font displayed using the default font in the EditText view? Thank!

+3
source share
2 answers
  • The letters were omitted due to the font.
  • It is possible to use several fonts inside one TextView / EditView. You can use this class.

    SpannableString string = new SpannableString("test");

    string.setSpan (new TypefaceSpan (myTypeface), 0.2.0);

  • To use custom fonts in the same way, you can 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 a sample code.
+2
source
What can I do to get characters not supported by this font to be displayed using
the default font in an EditText view?

As far as I know, it is impossible to use two separate fonts at the same time in the same EditText.

0
source

Source: https://habr.com/ru/post/1776136/


All Articles