Class LinuxFontPolicy

java.lang.Object
com.formdev.flatlaf.LinuxFontPolicy

class LinuxFontPolicy extends Object
  • Constructor Details

    • LinuxFontPolicy

      LinuxFontPolicy()
  • Method Details

    • getFont

      static Font getFont()
    • getGnomeFont

      private static Font getGnomeFont()
      Gets the default font for Gnome.
    • createFontEx

      private static Font createFontEx(String family, int style, int size, double dsize)
      Create a font for the given family, style and size. If the font family does not match any font on the system, then the last word (usually a font weight) from the family name is removed and tried again. E.g. family 'URW Bookman Light' is not found, but 'URW Bookman' is found. If still not found, then font of family 'Dialog' is returned.
    • createFont

      private static Font createFont(String family, int style, int size, double dsize)
    • getGnomeFontScale

      private static double getGnomeFontScale()
    • mapFcName

      private static String mapFcName(String name)
      map GTK/fontconfig names to equivalent JDK logical font name
    • getKDEFont

      private static Font getKDEFont()
      Gets the default font for KDE from KDE configuration files. The Swing fonts are not updated when the user changes system font size (System Settings > Fonts > Force Font DPI). An application restart is necessary. This is the same behavior as in native KDE applications. The "display scale factor" (kdeglobals: [KScreen] > ScaleFactor) is not used KDE also does not use it to calculate font size. Only forceFontDPI is used by KDE. If user changes "display scale factor" (System Settings > Display and Monitors > Displays > Scale Display), the forceFontDPI is also changed to reflect the scale factor.
    • readConfig

      private static List<String> readConfig(String filename)
    • getConfigEntry

      private static String getConfigEntry(List<String> config, String group, String key)
    • isSystemScaling

      private static boolean isSystemScaling()
      Returns true if the JRE scales, which is the case if: - environment variable GDK_SCALE is set and running on Java 9 or later - running on JetBrains Runtime 11 or later and scaling is enabled in system Settings