public BitmapFont read (Json json, Object jsonData, Class type) {
if (jsonData instanceof String) return getResource((String)jsonData, BitmapFont.class);
String path = json.readValue("file", String.class, jsonData);
FileHandle fontFile = skinFile.parent().child(path);
if (!fontFile.exists()) fontFile = Gdx.files.internal(path);
if (!fontFile.exists()) throw new SerializationException("Font file not found: " + fontFile);
// Use a region with the same name as the font, else use a PNG file in the same directory as the FNT file.
String regionName = fontFile.nameWithoutExtension();
try {
if (skin.hasResource(regionName, TextureRegion.class))
return new BitmapFont(fontFile, skin.getResource(regionName, TextureRegion.class), false);
else {
FileHandle imageFile = fontFile.parent().child(regionName + ".png");
if (imageFile.exists())
return new BitmapFont(fontFile, imageFile, false);
else
return new BitmapFont(fontFile, false);
}
} catch (RuntimeException ex) {