The font file format is from the AngelCodeFont BMFont tool.
Output is nearly identical to the FreeType settting in the Hiero tool com..
BitmapFontWriter gives more flexibility, eg borders and shadows can be used. Hiero is able to avoid outputting the same glyph
image more than once if multiple character codes have the exact same glyph.
| Modifier and Type | Class and Description |
|---|---|
| public static class | BitmapFontWriter.
The font "info" line; everything except padding and override metrics are ignored by libGDX's BitmapFont reader, it is otherwise just useful for clean and organized output. |
| public static enum | BitmapFontWriter.
The output format. |
| public static class | BitmapFontWriter.
The Padding parameter for FontInfo. |
| public static class | BitmapFontWriter.
The spacing parameter for FontInfo. |
| Modifier and Type | Field and Description |
|---|---|
| private static BitmapFontWriter. | format
The output format |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static BitmapFontWriter. | |
| private static String | |
| private static String | |
| public static void | setOutputFormat(BitmapFontWriter.
the output format to use fmtSets the AngelCodeFont output format for subsequent writes; can be text (for libGDX) or XML (for other engines, like Pixi.js). |
| public static void | writeFont(BitmapFont.
the bitmap font fontData,the references to each texture page image file, generally in the same folder as outFntFile pageRefs, FileHandle the font file to save to (typically ends with '.fnt') outFntFile, BitmapFontWriter.the optional info for the file header; can be null info,the width of your texture pages scaleW, int the height of your texture pages scaleH)Writes the given BitmapFontData to a file, using the specified pageRefs strings as the image paths for each texture page. |
| public static void | writeFont(BitmapFont.
the font data fontData,the pixmaps to write as PNGs pages, FileHandle the output file for the font definition outFntFile, BitmapFontWriter.the optional font info for the header file, can be null infoA utility method which writes the given font data to a file. |
| public static String[] | Returns: the array of string references to be used with writeFontthe pages of pixmap data to write pages, FileHandle the output directory outputDir, String the file names for the output images fileName)A utility method to write the given array of pixmaps to the given output directory, with the specified file name. |
| public static String[] | Returns: the file refsthe pages containing the Pixmaps pages,the output directory outputDir, String the file name fileName)A convenience method to write pixmaps by page; typically returned from a PixmapPacker when used alongside FreeTypeFontGenerator. |
| format | back to summary |
|---|---|
| private static BitmapFontWriter. The output format | |
| BitmapFontWriter | back to summary |
|---|---|
| public BitmapFontWriter() | |
| getOutputFormat | back to summary |
|---|---|
| public static BitmapFontWriter. Returns the currently used output format.
| |
| quote | back to summary |
|---|---|
| private static String quote(Object params) | |
| quote | back to summary |
|---|---|
| private static String quote(Object params, boolean spaceAfter) | |
| setOutputFormat | back to summary |
|---|---|
| public static void setOutputFormat(BitmapFontWriter. Sets the AngelCodeFont output format for subsequent writes; can be text (for libGDX) or XML (for other engines, like Pixi.js).
| |
| writeFont | back to summary |
|---|---|
| public static void writeFont(BitmapFont. Writes the given BitmapFontData to a file, using the specified pageRefs strings as the image paths for each texture page. The glyphs in BitmapFontData have a "page" id, which references the index of the pageRef you specify here. The FontInfo parameter is useful for cleaner output; such as including a size and font face name hint. However, it can be null to use default values. libGDX ignores most of the "info" line when reading back fonts, only padding is used. Padding also affects the size, location, and offset of the glyphs that are output. Likewise, the scaleW and scaleH are only for cleaner output. They are currently ignored by libGDX's reader. For maximum compatibility with other BMFont tools, you should use the width and height of your texture pages (each page should be the same size).
| |
| writeFont | back to summary |
|---|---|
| public static void writeFont(BitmapFont. A utility method which writes the given font data to a file. The specified pixmaps are written to the parent directory of outFntFile, using that file's name without an extension for the PNG file name(s). The specified FontInfo is optional, and can be null. Typical usage looks like this:
BitmapFontWriter.writeFont(myFontData, myFontPixmaps, Gdx.files.external("fonts/output.fnt"), new FontInfo("Arial", 16));
| |
| writePixmaps | back to summary |
|---|---|
| public static String[] writePixmaps(Pixmap[] pages, FileHandle outputDir, String fileName) A utility method to write the given array of pixmaps to the given output directory, with the specified file name. If the pages array is of length 1, then the resulting file ref will look like: "fileName.png". If the pages array is greater than length 1, the resulting file refs will be appended with "_N", such as "fileName_0.png", "fileName_1.png", "fileName_2.png" etc. The returned string array can then be passed to the writeFont method. Note None of the pixmaps will be disposed.
| |
| writePixmaps | back to summary |
|---|---|
| public static String[] writePixmaps(Array<PixmapPacker. A convenience method to write pixmaps by page; typically returned from a PixmapPacker when used alongside FreeTypeFontGenerator.
| |
| Modifier and Type | Field and Description |
|---|---|
| public int | aa
Amount of anti-aliasing that was applied to the font |
| public float | |
| public boolean | bold
Whether the font is bold |
| public float | |
| public String | charset
The charset; or null/empty for default |
| public float | |
| public float | |
| public String | face
Face name |
| public boolean | hasOverrideMetrics
Override metrics |
| public boolean | italic
Whether the font is italic |
| public float | |
| public int | |
| public BitmapFontWriter. | padding
Padding that was applied to the font |
| public int | size
Font size (pt) |
| public boolean | smooth
Whether smoothing is applied |
| public float | |
| public BitmapFontWriter. | spacing
Horizontal/vertical spacing that was applied to font |
| public int | stretchH
Stretch for height; default to 100% |
| public boolean | unicode
Whether the font uses unicode glyphs |
| public float |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| aa | back to summary |
|---|---|
| public int aa Amount of anti-aliasing that was applied to the font | |
| ascent | back to summary |
|---|---|
| public float ascent | |
| bold | back to summary |
|---|---|
| public boolean bold Whether the font is bold | |
| capHeight | back to summary |
|---|---|
| public float capHeight | |
| charset | back to summary |
|---|---|
| public String charset The charset; or null/empty for default | |
| descent | back to summary |
|---|---|
| public float descent | |
| down | back to summary |
|---|---|
| public float down | |
| face | back to summary |
|---|---|
| public String face Face name | |
| hasOverrideMetrics | back to summary |
|---|---|
| public boolean hasOverrideMetrics Override metrics | |
| italic | back to summary |
|---|---|
| public boolean italic Whether the font is italic | |
| lineHeight | back to summary |
|---|---|
| public float lineHeight | |
| outline | back to summary |
|---|---|
| public int outline | |
| padding | back to summary |
|---|---|
| public BitmapFontWriter. Padding that was applied to the font | |
| size | back to summary |
|---|---|
| public int size Font size (pt) | |
| smooth | back to summary |
|---|---|
| public boolean smooth Whether smoothing is applied | |
| spaceXAdvance | back to summary |
|---|---|
| public float spaceXAdvance | |
| spacing | back to summary |
|---|---|
| public BitmapFontWriter. Horizontal/vertical spacing that was applied to font | |
| stretchH | back to summary |
|---|---|
| public int stretchH Stretch for height; default to 100% | |
| unicode | back to summary |
|---|---|
| public boolean unicode Whether the font uses unicode glyphs | |
| xHeight | back to summary |
|---|---|
| public float xHeight | |
| FontInfo | back to summary |
|---|---|
| public FontInfo() | |
| FontInfo | back to summary |
|---|---|
| public FontInfo(String face, int size) | |
| overrideMetrics | back to summary |
|---|---|
| public void overrideMetrics(BitmapFont. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final BitmapFontWriter. | Text
AngelCodeFont text format |
| public static final BitmapFontWriter. | XML
AngelCodeFont XML format |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static BitmapFontWriter. | |
| public static BitmapFontWriter. |
| Text | back to summary |
|---|---|
| public static final BitmapFontWriter. AngelCodeFont text format | |
| XML | back to summary |
|---|---|
| public static final BitmapFontWriter. AngelCodeFont XML format | |
| OutputFormat | back to summary |
|---|---|
| private OutputFormat() | |
| valueOf | back to summary |
|---|---|
| public static BitmapFontWriter. | |
| values | back to summary |
|---|---|
| public static BitmapFontWriter. | |
| Modifier and Type | Field and Description |
|---|---|
| public int | |
| public int | |
| public int | |
| public int |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| down | back to summary |
|---|---|
| public int down | |
| left | back to summary |
|---|---|
| public int left | |
| right | back to summary |
|---|---|
| public int right | |
| up | back to summary |
|---|---|
| public int up | |
| Padding | back to summary |
|---|---|
| public Padding() | |
| Padding | back to summary |
|---|---|
| public Padding(int up, int down, int left, int right) | |
| Modifier and Type | Field and Description |
|---|---|
| public int | |
| public int |
| Access | Constructor and Description |
|---|---|
| public |
| horizontal | back to summary |
|---|---|
| public int horizontal | |
| vertical | back to summary |
|---|---|
| public int vertical | |
| Spacing | back to summary |
|---|---|
| public Spacing() | |