3

I possess two complementary fonts that are installed on my computer (Linux), and that are used to render every characters that the two fonts have.

I would have liked to use in the same way these fonts in Android. Unfortunately, I don't know how to do this (I know how to load one font).

I have tried to merge them with FontForge, but unfortunately I couldn't because the total number of glyphs is over 65535 glyphs (which is the limit of the sfnt format).

  1. Is there a possibility to go over 65535 glyphs, so that the font can be used in Android?

  2. If not, is there a way to use these fonts conjointly in Android in general, so that the characters not recognized by a font are recognized by the other (like my computer does)?

  3. If not, is it possible to use two Typeface in a TextView, so that the characters not recognized by a font are recognized by the other?
    I know that we can use Spannable to use different Typeface for different parts of the TextView, but that's not exactly my need here.

  4. If not, is it possible to detect all the unrecognized characters of my TextView, so as to use the other font only for them?

  5. Is it possible to use the CSS style "font-family" in a TextView, so as to provide an alternative font in the case the first fails for some characters?

Pang
  • 9,564
  • 146
  • 81
  • 122
hoti
  • 43
  • 4

1 Answers1

0

Thanks to the direction given by JaiSoni, I have managed to find a way to solve my problem using HTML and CSS : I have used a WebView, and have declared the @font-face to define my fonts. Then, I have used them in the CSS attribute "font-family" like this :

<style type="text/css">
   @font-face {font-family: MyFont; src: url("file:///android_asset/fonts/font.ttf")}
   @font-face {font-family: MyFont2; src: url("file:///android_asset/fonts/font2.ttf")}
   body {font-family: MyFont2, MyFont; }
</style>

Thank you very much.

hoti
  • 43
  • 4