mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-11 14:37:13 -06:00
Typography:
- fixed semibold font on Ubuntu - use font "Montserrat SemiBold" on Fedora (PR #396)
This commit is contained in:
@@ -1324,9 +1324,19 @@ public abstract class FlatLaf
|
||||
}
|
||||
|
||||
// derive font
|
||||
if( newStyle != baseStyle || newSize != baseSize )
|
||||
if( newStyle != baseStyle || newSize != baseSize ) {
|
||||
// hack for font "Ubuntu Medium" on Linux, which curiously belongs
|
||||
// to family "Ubuntu Light" and using deriveFont() would create a light font
|
||||
if( "Ubuntu Medium".equalsIgnoreCase( baseFont.getName() ) &&
|
||||
"Ubuntu Light".equalsIgnoreCase( baseFont.getFamily() ) )
|
||||
{
|
||||
Font font = createCompositeFont( "Ubuntu Medium", newStyle, newSize );
|
||||
if( !isFallbackFont( font ) )
|
||||
return toUIResource( font );
|
||||
}
|
||||
|
||||
return toUIResource( baseFont.deriveFont( newStyle, newSize ) );
|
||||
else
|
||||
} else
|
||||
return toUIResource( baseFont );
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ mini.font = -3
|
||||
[mac]semibold.font = "HelveticaNeue-Medium"
|
||||
# Linux
|
||||
[linux]light.font = "Lato Light", "Ubuntu Light", "Cantarell Light"
|
||||
[linux]semibold.font = "Lato Semibold", "Ubuntu Medium"
|
||||
[linux]semibold.font = "Lato Semibold", "Ubuntu Medium", "Montserrat SemiBold"
|
||||
# fallback for unknown platform
|
||||
light.font = +0
|
||||
semibold.font = +0
|
||||
|
||||
@@ -86,6 +86,7 @@ public class FlatFontsTest
|
||||
for( Map.Entry<String, Font> e : info.fonts.entrySet() ) {
|
||||
JLabel label = new JLabel( e.getKey() );
|
||||
label.setFont( e.getValue().deriveFont( (float) UIScale.scale( 36 ) ) );
|
||||
label.setToolTipText( e.getValue().toString() );
|
||||
previewPanel.add( label, "wrap" );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user