I use libgdx and I draw some text with BitmapFont, it works, but on some devices with Android 5.1 game draw only numbers and punctuation symbols, without any text.
I tried two ways:
1) Font Generator:
mFontGenerator = new FreeTypeFontGenerator(Gdx.files.internal(fontName));
mFontParameter = new FreeTypeFontGenerator.FreeTypeFontParameter();
mFontParameter.characters = Font.FONT_CHARS;
mFontParameter.size = mSizePixels;
mFontParameter.color = mTextColor;
mFontParameter.borderWidth = mBorderWidth;
mFontParameter.borderColor = mBorderColor;
mBitmapFont = mFontGenerator.generateFont(mFontParameter);
mBitmapFont.setUseIntegerPositions(false);
mBitmapFont.getData().setScale(mTextScale);
mFontGenerator.dispose();
2) Font, created in Hiero:
mBitmapFont = new BitmapFont(Gdx.files.internal(fontName));
mBitmapFont.setUseIntegerPositions(false);
mBitmapFont.getData().setScale(mTextScale);
mBitmapFont.setColor(mTextColor);
Draw code is the same for both ways:
@Override
public void draw(SpriteBatch spriteBatch) {
mBitmapFont.draw(spriteBatch, mText, mPositionX, mPositionY);
}
Both ways works on tablet with Android 7.1.1 and even on phone with Android 2.3.5, but on two devices with Android 5.1 I can see just numbers, no letters.
Thanks for any help!
useInteger
,setScale
,setColor
) is it still the same? Also, what characters do FONT_CHARS contain? \$\endgroup\$