Ubuntu Linux: fixed poorly rendered font (issue #105)

This commit is contained in:
Karl Tauber
2020-05-21 17:11:58 +02:00
parent ce503cedc3
commit bc6cb492f1
3 changed files with 11 additions and 1 deletions

View File

@@ -1,6 +1,11 @@
FlatLaf Change Log
==================
## Unreleased
- Ubuntu Linux: Fixed poorly rendered font. (issue #105)
## 0.35
- Added drop shadows to popup menus, combobox popups, tooltips and internal

View File

@@ -74,6 +74,11 @@ class LinuxFontPolicy
family = family.isEmpty() ? word : (family + ' ' + word);
}
// 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";
// scale font size
double dsize = size * getGnomeFontScale();
size = (int) (dsize + 0.5);

View File

@@ -141,7 +141,7 @@ class DemoFrame
fontMenu.addSeparator();
ArrayList<String> families = new ArrayList<>( Arrays.asList(
"Arial", "Comic Sans MS", "Courier New", "DejaVu Sans", "Dialog", "Monospaced",
"Noto Sans", "Roboto", "SansSerif", "Segoe UI", "Serif", "Tahoma", "Verdana" ) );
"Noto Sans", "Roboto", "SansSerif", "Segoe UI", "Serif", "Tahoma", "Ubuntu", "Verdana" ) );
if( !families.contains( currentFamily ) )
families.add( currentFamily );
families.sort( String.CASE_INSENSITIVE_ORDER );