Skip to content

Commit

Permalink
Trying to make font defaults better
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhael-Danilov committed Jan 4, 2025
1 parent b92f2ad commit 10899d7
Showing 1 changed file with 3 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public SystemText(final String text, float size, boolean multiline) {
}

public static void updateFontScale() {
float scale = 0.5f + 0.01f * GamePreferences.fontScale();
float scale = 0.5f + 0.01f * (GamePreferences.fontScale() + 9);

scale *= 1.2f;

Expand All @@ -95,14 +95,13 @@ private FreeTypeFontParameter getFontParameters(float baseLine) {
final FreeTypeFontParameter fontParameters;
fontParameters = new FreeTypeFontParameter();
fontParameters.characters = FreeTypeFontGenerator.DEFAULT_CHARS + StringsManager.getAllCharsAsString();
//PUtil.slog("font", "characters " + fontParameters.characters);
fontParameters.size = (int) (baseLine * oversample * fontScale);
fontParameters.borderColor = Color.BLACK;
fontParameters.borderWidth = oversample * fontScale;
fontParameters.flip = true;
fontParameters.genMipMaps = true;
fontParameters.genMipMaps = false;
fontParameters.magFilter = Texture.TextureFilter.Linear;
fontParameters.minFilter = Texture.TextureFilter.MipMapLinearLinear;
fontParameters.minFilter = Texture.TextureFilter.Linear;
fontParameters.spaceX = -2;
fontParameters.spaceY = 0;
return fontParameters;
Expand Down Expand Up @@ -161,17 +160,6 @@ private void wrapText() {
}
}

@Override
public void destroy() {
super.destroy();
// No need to dispose font here as it's managed by the cache
}

@Override
public void kill() {
super.kill();
}

@Override
protected void updateMatrix() {
if (dirtyMatrix) {
Expand Down

0 comments on commit 10899d7

Please sign in to comment.