What are the font requirements (OTF or TTF), so it works fine on Android?

I am having problems using custom font (Typeface) in Android.

What happens is that when rendering text in a TextView, the last line is often partially cut off vertically (lower parts of letters, for example, g, j, y, etc.), even if there is free space under the text. I assume that this is because something is wrong with the custom font file (OTF file) that I am using. This only happens when using this custom font. If I use standard Android fonts without installing my own font, everything works fine.

Question: What are the requirements for font files for Android so that they work correctly. (Please do not post workarounds for the problem, I know about that.)

+4
source share
1 answer

Both OTF and TTF fonts will work perfectly in Android, you need to take care of the text format and the spacers around it.

0
source

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


All Articles