mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-13 15:27:16 -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
|
// 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 ) );
|
return toUIResource( baseFont.deriveFont( newStyle, newSize ) );
|
||||||
else
|
} else
|
||||||
return toUIResource( baseFont );
|
return toUIResource( baseFont );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ mini.font = -3
|
|||||||
[mac]semibold.font = "HelveticaNeue-Medium"
|
[mac]semibold.font = "HelveticaNeue-Medium"
|
||||||
# Linux
|
# Linux
|
||||||
[linux]light.font = "Lato Light", "Ubuntu Light", "Cantarell Light"
|
[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
|
# fallback for unknown platform
|
||||||
light.font = +0
|
light.font = +0
|
||||||
semibold.font = +0
|
semibold.font = +0
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ public class FlatFontsTest
|
|||||||
for( Map.Entry<String, Font> e : info.fonts.entrySet() ) {
|
for( Map.Entry<String, Font> e : info.fonts.entrySet() ) {
|
||||||
JLabel label = new JLabel( e.getKey() );
|
JLabel label = new JLabel( e.getKey() );
|
||||||
label.setFont( e.getValue().deriveFont( (float) UIScale.scale( 36 ) ) );
|
label.setFont( e.getValue().deriveFont( (float) UIScale.scale( 36 ) ) );
|
||||||
|
label.setToolTipText( e.getValue().toString() );
|
||||||
previewPanel.add( label, "wrap" );
|
previewPanel.add( label, "wrap" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user