Java 类com.badlogic.gdx.tools.bmfont.BitmapFontWriter 实例源码

项目:skinpacker    文件:Ttf2FntGenerator.java   
private void saveFontToFile(FreeTypeBitmapFontData data, int fontSize,
        String fontName, PixmapPacker packer, FileHandle destiny) {
    FileHandle fontFile = Gdx.files.absolute(destiny.file()
            .getAbsolutePath() + File.separator + fontName + ".fnt"); // .fnt
    // path     

    BitmapFontWriter.setOutputFormat(BitmapFontWriter.OutputFormat.Text);

    String[] pageRefs = BitmapFontWriter.writePixmaps(packer.getPages(),
            destiny, fontName); // png dir path
    Gdx.app.debug(TAG, String.format(
            "Saving font [%s]: fontfile: %s, pixmapDir: %s\n", fontName,
            fontFile, destiny));
    BitmapFontWriter.writeFont(data, pageRefs, fontFile,
            new BitmapFontWriter.FontInfo(fontName, fontSize), 1, 1);
}
项目:ead    文件:GenerateSkinMojo.java   
private void saveFontToFile(
        FreeTypeFontGenerator.FreeTypeBitmapFontData data, int fontSize,
        String fontName, PixmapPacker packer, FileHandle destiny) {
    FileHandle fontFile = destiny.child(fontName + ".fnt"); // .fnt path

    BitmapFontWriter.setOutputFormat(BitmapFontWriter.OutputFormat.Text);

    String[] pageRefs = BitmapFontWriter.writePixmaps(packer.getPages(),
            destiny, fontName); // png dir path

    BitmapFontWriter.writeFont(data, pageRefs, fontFile,
            new BitmapFontWriter.FontInfo(fontName, fontSize), 1, 1);
}