mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
use prerendered font to fix font scaling
- using freetypefont generator scale CJK Fonts too big
This commit is contained in:
@@ -126,26 +126,14 @@ public class Controls {
|
|||||||
FileHandle atlasFile = skinFile.sibling(skinFile.nameWithoutExtension() + ".atlas");
|
FileHandle atlasFile = skinFile.sibling(skinFile.nameWithoutExtension() + ".atlas");
|
||||||
TextureAtlas atlas = new TextureAtlas(atlasFile);
|
TextureAtlas atlas = new TextureAtlas(atlasFile);
|
||||||
//font
|
//font
|
||||||
FreeTypeFontGenerator generateFonts=new FreeTypeFontGenerator(Config.instance().getFile(Paths.SKIN_FONT));
|
defaultfont = new BitmapFont(Config.instance().getFile(Paths.SKIN).sibling("LanaPixel.fnt"));
|
||||||
FreeTypeFontGenerator.FreeTypeFontParameter parameter = new FreeTypeFontGenerator.FreeTypeFontParameter();
|
bigfont = new BitmapFont(Config.instance().getFile(Paths.SKIN).sibling("LanaPixel.fnt"));
|
||||||
parameter.borderWidth=0;
|
bigfont.getData().setScale(2, 2);
|
||||||
parameter.incremental = true;
|
SelectedSkin.add("default", defaultfont);
|
||||||
parameter.mono=true;
|
SelectedSkin.add("big", bigfont);
|
||||||
parameter.size=11;
|
|
||||||
parameter.minFilter = Texture.TextureFilter.Nearest;
|
|
||||||
parameter.magFilter = Texture.TextureFilter.Nearest;
|
|
||||||
parameter.color= Color.WHITE;
|
|
||||||
|
|
||||||
defaultfont = generateFonts.generateFont(parameter);
|
|
||||||
|
|
||||||
|
|
||||||
parameter.size=22;
|
|
||||||
parameter.color= Color.WHITE;
|
|
||||||
bigfont = generateFonts.generateFont(parameter);
|
|
||||||
SelectedSkin.add("default",defaultfont);
|
|
||||||
SelectedSkin.add("big",bigfont);
|
|
||||||
SelectedSkin.addRegions(atlas);
|
SelectedSkin.addRegions(atlas);
|
||||||
SelectedSkin.load(skinFile);
|
SelectedSkin.load(skinFile);
|
||||||
|
|
||||||
}
|
}
|
||||||
return SelectedSkin;
|
return SelectedSkin;
|
||||||
}
|
}
|
||||||
|
|||||||
21846
forge-gui/res/adventure/Shandalar/skin/LanaPixel.fnt
Normal file
21846
forge-gui/res/adventure/Shandalar/skin/LanaPixel.fnt
Normal file
File diff suppressed because it is too large
Load Diff
BIN
forge-gui/res/adventure/Shandalar/skin/LanaPixel.png
Normal file
BIN
forge-gui/res/adventure/Shandalar/skin/LanaPixel.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 172 KiB |
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 151 KiB |
@@ -1,4 +1,18 @@
|
|||||||
{
|
{
|
||||||
|
"com.badlogic.gdx.graphics.g2d.BitmapFont": {
|
||||||
|
"big": {
|
||||||
|
"file": "LanaPixel.fnt"
|
||||||
|
},
|
||||||
|
"black": {
|
||||||
|
"file": "LanaPixel.fnt"
|
||||||
|
},
|
||||||
|
"blackbig": {
|
||||||
|
"file": "LanaPixel.fnt"
|
||||||
|
},
|
||||||
|
"default": {
|
||||||
|
"file": "LanaPixel.fnt"
|
||||||
|
}
|
||||||
|
},
|
||||||
"com.badlogic.gdx.graphics.Color": {
|
"com.badlogic.gdx.graphics.Color": {
|
||||||
"RGBA_0_0_0_255": {
|
"RGBA_0_0_0_255": {
|
||||||
"r": 0,
|
"r": 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user