Class LinuxFontPolicy
java.lang.Object
com.formdev.flatlaf.LinuxFontPolicy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static FontcreateFontEx(String family, int style, int size) Create a font for the given family, style and size.private static StringgetConfigEntry(List<String> config, String group, String key) (package private) static FontgetFont()private static FontGets the default font for Gnome.private static doubleprivate static FontGets the default font for KDE from KDE configuration files.private static booleanReturns 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 Settingsprivate static Stringmap GTK/fontconfig names to equivalent JDK logical font namereadConfig(String filename)
-
Constructor Details
-
LinuxFontPolicy
LinuxFontPolicy()
-
-
Method Details
-
getFont
-
getGnomeFont
Gets the default font for Gnome. -
createFontEx
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. -
getGnomeFontScale
private static double getGnomeFontScale() -
mapFcName
-
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
-
getConfigEntry
-
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
-