Search in sources :

Example 6 with FreeTypeFontParameter

use of com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator.FreeTypeFontParameter in project libgdx by libgdx.

the class InternationalFontsTest method create.

@Override
public void create() {
    FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal("data/unbom.ttf"));
    FreeTypeFontParameter parameter = new FreeTypeFontParameter();
    parameter.size = 18;
    parameter.characters = "한국어/조선�?";
    koreanFont = generator.generateFont(parameter);
    generator.dispose();
    parameter.characters = FreeTypeFontGenerator.DEFAULT_CHARS;
    generator = new FreeTypeFontGenerator(Gdx.files.internal("data/russkij.ttf"));
    cyrillicFont = generator.generateFont(parameter);
    generator.dispose();
    parameter.characters = "วรณยุ�?ต์";
    generator = new FreeTypeFontGenerator(Gdx.files.internal("data/garuda.ttf"));
    thaiFont = generator.generateFont(parameter);
    generator.dispose();
    batch = new SpriteBatch();
    cam = new OrthographicCamera();
    cam.setToOrtho(false, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
    cam.update();
}
Also used : FreeTypeFontGenerator(com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator) FreeTypeFontParameter(com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator.FreeTypeFontParameter) OrthographicCamera(com.badlogic.gdx.graphics.OrthographicCamera) SpriteBatch(com.badlogic.gdx.graphics.g2d.SpriteBatch)

Aggregations

FreeTypeFontGenerator (com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator)6 FreeTypeFontParameter (com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator.FreeTypeFontParameter)6 SpriteBatch (com.badlogic.gdx.graphics.g2d.SpriteBatch)4 FileHandle (com.badlogic.gdx.files.FileHandle)2 OrthographicCamera (com.badlogic.gdx.graphics.OrthographicCamera)2 BitmapFont (com.badlogic.gdx.graphics.g2d.BitmapFont)2 FreeTypeBitmapFontData (com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator.FreeTypeBitmapFontData)2 ShapeRenderer (com.badlogic.gdx.graphics.glutils.ShapeRenderer)2 GlyphLayout (com.badlogic.gdx.graphics.g2d.GlyphLayout)1 TextureAtlas (com.badlogic.gdx.graphics.g2d.TextureAtlas)1 Array (com.badlogic.gdx.utils.Array)1