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);
  }
}

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());
    float f = Gdx.graphics.getPpiX() / 96;
    if (f > 1) f -= (f - 1) * 0.4f;
    base = (int) f;

    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);
  }
}

Change Font scaling