mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-12 23:07:15 -06:00
Ubuntu Linux: fixed poorly rendered font (2nd attempt) (issue #105)
This commit is contained in:
@@ -419,7 +419,7 @@ public abstract class FlatLaf
|
||||
// using StyleContext.getFont() here because it uses
|
||||
// sun.font.FontUtilities.getCompositeFontUIResource()
|
||||
// and creates a composite font that is able to display all Unicode characters
|
||||
Font font = new StyleContext().getFont( family, style, size );
|
||||
Font font = StyleContext.getDefaultStyleContext().getFont( family, style, size );
|
||||
return (font instanceof FontUIResource) ? (FontUIResource) font : new FontUIResource( font );
|
||||
}
|
||||
|
||||
|
||||
@@ -75,9 +75,11 @@ class LinuxFontPolicy
|
||||
}
|
||||
|
||||
// Ubuntu font is rendered poorly (except if running in JetBrains VM)
|
||||
// --> use default Java font
|
||||
if( family.startsWith( "Ubuntu" ) && !SystemInfo.IS_JETBRAINS_JVM )
|
||||
family = "sans";
|
||||
// --> use Liberation Sans font
|
||||
if( family.startsWith( "Ubuntu" ) &&
|
||||
!SystemInfo.IS_JETBRAINS_JVM &&
|
||||
!Boolean.parseBoolean( System.getProperty( "flatlaf.useUbuntuFont" ) ) )
|
||||
family = "Liberation Sans";
|
||||
|
||||
// scale font size
|
||||
double dsize = size * getGnomeFontScale();
|
||||
|
||||
Reference in New Issue
Block a user