Package com.formdev.flatlaf
Class LinuxFontPolicy
java.lang.Object
com.formdev.flatlaf.LinuxFontPolicy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static Font
createFont
(String family, int style, int size, double dsize) private static Font
createFontEx
(String family, int style, int size, double dsize) Create a font for the given family, style and size.private static String
getConfigEntry
(List<String> config, String group, String key) (package private) static Font
getFont()
private static Font
Gets the default font for Gnome.private static double
private static Font
Gets the default font for KDE from KDE configuration files.private static boolean
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 Settingsprivate static String
map 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. -
createFont
-
getGnomeFontScale
private static double getGnomeFontScale() -
mapFcName
map GTK/fontconfig names to equivalent JDK logical font name -
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
-