Please, help me with my problem. The character is rendering incorrectly. R symbol looks like N. Also, the symbol ! is not drawn. But this problem was found only on Xiaomi Mi A1. On other devices, such a problem is not detected.
Font generates like so:
public enum Font {
FONT_REGULAR (Res.FONT_REGULAR_PATH),
FONT_LIGHT (Res.FONT_LIGHT_PATH),
RUSSO_ONE_REGULAR (Res.RUSSO_ONE_REGULAR),
;
BitmapFont font;
String path;
Font (String path) {
this.path = path;
}
public BitmapFont get (float size) {
final String FONT_CHARACTERS = "абвгдеёжзийклмнопрстуфхцчшщъыьэюяєїіАБВГДЕЁЖЗИЙКЛМ" +
"НОПРСТУФХЦЧШЩЪЫЬЭЮЯЄЇІáabcdeéfghiíjklmnoópqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123" +
"456789][_!$%#@|\\/?-+=()*&.:;,{}\"´`'<>°©™";
FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal(path));
FreeTypeFontGenerator.FreeTypeFontParameter parameter = new FreeTypeFontGenerator.FreeTypeFontParameter();
parameter.size = (int) size;
if (size < 1) parameter.size = 1;
parameter.characters = FONT_CHARACTERS;
BitmapFont font = generator.generateFont(parameter);
font.setColor(Color.WHITE);
generator.dispose();
return font;
}
}
I use this font.
How can I fix it?
parameter.flip = true
(see if it is still weird upside down);parameter.genMipMaps = true; parameter.minFilter = TextureFilter.MipMapLinearLinear
(see if MipMap change anything);parameter.mono = true
(disable font smoothing). These will probably not change anything but if they do maybe they can lead you to a solution. \$\endgroup\$