package ethanjones.cubes.graphics.menu;

import ethanjones.cubes.core.logging.Log;
import ethanjones.cubes.graphics.assets.Assets;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator;
import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator.FreeTypeFontParameter;

public class Fonts {

  public static final BitmapFont FontTitle;
  public static final BitmapFont FontMenu;
  public static final BitmapFont FontHUD;
  public static final BitmapFont FontDebug;

  private static final FreeTypeFontGenerator generator;
  private static final int base;

  static {
    Log.debug("Generating font");
    FreeTypeFontGenerator.setMaxTextureSize(2048);
    generator = new FreeTypeFontGenerator(Assets.getAsset("core:font/font.ttf").getFileHandle());
    base = (int) Gdx.graphics.getPpiX() / 96;

    FontTitle = getFont(64);
    FontMenu = getFont(42);
    FontHUD = getFont(32);
    FontDebug = getFont(32);

    Log.debug("Font generated");
  }

  public static BitmapFont getFont(int size) {
    FreeTypeFontParameter parameter = new FreeTypeFontParameter();
    parameter.size = base * size;
    parameter.incremental = true;
    return generator.generateFont(parameter);
  }
}

@@ -852,20 +852,17 @@
     
-base = (int)
+float f =
  Gdx
@@ -886,16 +886,72 @@
 () / 96;
+%0A    if (f %3E 1) f -= (f - 1) * 0.4f;%0A    base = (int) f;
 %0A%0A    Fo

Change Font scaling