-
-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Text appears oversized on Elementary OS Linux distribution #427
Comments
For some reason, the computed font size is too large 😕 Nimbus and Metal use fixed size fonts (which may result in too small text if screen is scaled). Do you have the also too large font when using To better understand the problem, can you please run the following program and post the output? import java.awt.*;
import javax.swing.*;
import com.formdev.flatlaf.FlatLightLaf;
public class FlatLinuxFontInfo
{
public static void main( String[] args ) {
SwingUtilities.invokeLater( () -> {
System.out.println( "Java version: " + System.getProperty( "java.version" ) );
System.out.println( "Java vendor: " + System.getProperty( "java.vendor" ) );
System.out.println( "Gtk FontName: " + Toolkit.getDefaultToolkit().getDesktopProperty( "gnome.Gtk/FontName" ) );
System.out.println( "Xft DPI: " + Toolkit.getDefaultToolkit().getDesktopProperty( "gnome.Xft/DPI" ) );
System.out.println( "Transform: " + GraphicsEnvironment.getLocalGraphicsEnvironment()
.getDefaultScreenDevice().getDefaultConfiguration()
.getNormalizingTransform() );
FlatLightLaf.setup();
System.out.println( "Default Font: " + UIManager.getFont( "defaultFont" ) );
} );
}
} |
Could you please also run FlatScreenInfo and post the output? Thanks. |
Hi! Thanks to answering so quickly. I think this errors its caused by my JDK version. When I opened this issue, I had Oracle's JDK 17 installed on my system and my app looks like this when I forced GTK LAF: Due to some errors trying execute This is how my app looks like now with GTK LAF running with OpenJDK, and this is how looks like with FlatLAF (dark theme): I send you the info shown by FlatScreenInfo
FlatLinuxFontInfo
|
…s not affected): - oversized text if system font is "Inter" (issue #427) - missing text if system font is "Cantarell" (on Fedora)
Was able to reproduce the issue with Oracle JDK 8 and font "Inter" on Linux. Seems that Oracle's JDK has problems with this font. To avoid this problem in the future, I've added a check that uses a fallback font for this cases. |
I dont know if this bug appears on others Linux distributions, but specifically on Elementary OS 6, button texts and labels appears oversized:
This issue not occur when Metal or Nimbus LAFs (for example) are configured:
I thought the error might be because canberra-gtk module was missing on my system (it was the only console error I had while debugging), but I installed it and the result is still the same.
Some idea about what's happening?
The text was updated successfully, but these errors were encountered: