Skip to main content
Tweeted twitter.com/StackGameDev/status/974237100735369216
added 33 characters in body
Source Link

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. enter image description here

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?

Please, help me with my problem. The character is rendering incorrectly. R symbol looks like N. But this problem was found only on Xiaomi Mi A1. On other devices, such a problem is not detected. enter image description here

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?

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. enter image description here

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?

Source Link

libGDX font generating bug

Please, help me with my problem. The character is rendering incorrectly. R symbol looks like N. But this problem was found only on Xiaomi Mi A1. On other devices, such a problem is not detected. enter image description here

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?