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");
|
||||
TextureAtlas atlas = new TextureAtlas(atlasFile);
|
||||
//font
|
||||
FreeTypeFontGenerator generateFonts=new FreeTypeFontGenerator(Config.instance().getFile(Paths.SKIN_FONT));
|
||||
FreeTypeFontGenerator.FreeTypeFontParameter parameter = new FreeTypeFontGenerator.FreeTypeFontParameter();
|
||||
parameter.borderWidth=0;
|
||||
parameter.incremental = true;
|
||||
parameter.mono=true;
|
||||
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);
|
||||
defaultfont = new BitmapFont(Config.instance().getFile(Paths.SKIN).sibling("LanaPixel.fnt"));
|
||||
bigfont = new BitmapFont(Config.instance().getFile(Paths.SKIN).sibling("LanaPixel.fnt"));
|
||||
bigfont.getData().setScale(2, 2);
|
||||
SelectedSkin.add("default", defaultfont);
|
||||
SelectedSkin.add("big", bigfont);
|
||||
SelectedSkin.addRegions(atlas);
|
||||
SelectedSkin.load(skinFile);
|
||||
|
||||
}
|
||||
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": {
|
||||
"RGBA_0_0_0_255": {
|
||||
"r": 0,
|
||||
|
||||
Reference in New Issue
Block a user