You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2023/01/10 21:40:56 UTC

[GitHub] [netbeans] rkeen-siemens opened a new issue, #5265: Wrong font used for file chooser

rkeen-siemens opened a new issue, #5265:
URL: https://github.com/apache/netbeans/issues/5265

   ### Apache NetBeans version
   
   Apache NetBeans 16
   
   ### What happened
   
   The new feature to allow customizing FlatLaf is nice, but when changing the font _and_ changing the font size the new font is not used for file chooser file list and details views.
   
   ### How to reproduce
   
   1. Choose Tools > Options > Appearance > FlatLaf
   2. In the Advanced section, click the Edit custom properties button
   3. Close the options dialog and add a line to FlatLaf.properties (which should now be open in the editor) to change the default font (e.g. `defaultFont = "Nanum Brush Script"`)
   4. Save the file and close NetBeans
   5. Launch NetBeans again with a custom font size (e.g. `./bin/netbeans --fontsize 24`). You'll see the UI has changed to use the new font as expected
   6. Choose File > Open File...
   
   The file chooser dialog that appears uses the selected font for most of the UI, but the file list and detail views use the standard sans serif font rather than the new font.
   
   ![WrongFont](https://user-images.githubusercontent.com/46196614/211664553-87da8e31-0516-4e5b-af53-a55cfbd52fe0.png)
   
   If you launch NetBeans without overriding the font size, the file chooser uses the correct font.
   
   ### Did this work correctly in an earlier version?
   
   No / Don't know
   
   ### Operating System
   
   Windows 10 Pro, CentOS 7.6 with Gnome 3
   
   ### JDK
   
   Java 17.0.4.1
   
   ### Apache NetBeans packaging
   
   Apache NetBeans provided installer
   
   ### Anything else
   
   I suspect this is due to the logic in `AllLFCustoms.initCustomFontSize` where it [resizes the existing font for "FileChooser.listFont"](https://github.com/apache/netbeans/blob/cd14cf5e66279e1b0d7627d8476d5f2301fa692a/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/AllLFCustoms.java#L127) (and others). The problem is that at this point there is no value set for some of the settings including "FileChooser.listFont", "OptionPane.messageFont", and "windowTitleFont" and they are then assigned the default Dialog font.
   
   Some possible solutions:
   1. If the setting doesn't yet exist, don't set it (since it will be picked up from an existing setting, at least [in the case of "FileChooser.listFont"](https://github.com/openjdk/jdk17u/blob/41c9d7dc572340e80f46bc40bd673cc2c14ec3e1/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicListUI.java#L890)).
   2. Set the default values from FlatLaf settings, either "defaultFont" or "monospaced.font" and only fallback to the hard coded values if those don't exist
   
   ### Are you willing to submit a pull request?
   
   Yes
   
   ### Code of Conduct
   
   Yes


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] rkeen-siemens commented on issue #5265: Wrong font used for file chooser

Posted by GitBox <gi...@apache.org>.
rkeen-siemens commented on issue #5265:
URL: https://github.com/apache/netbeans/issues/5265#issuecomment-1396210457

   > did you remove the --fontsize argument in the process?
   
   Good point. Removing the `--fontsize` argument does work around the issue.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] rkeen-siemens commented on issue #5265: Wrong font used for file chooser

Posted by GitBox <gi...@apache.org>.
rkeen-siemens commented on issue #5265:
URL: https://github.com/apache/netbeans/issues/5265#issuecomment-1379178778

   Yes, setting the font size in the `defaultFont` property doesn't make a difference. The font is still set to dialog.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] neilcsmith-net commented on issue #5265: Wrong font used for file chooser

Posted by GitBox <gi...@apache.org>.
neilcsmith-net commented on issue #5265:
URL: https://github.com/apache/netbeans/issues/5265#issuecomment-1387231774

   @rkeen-siemens did you remove the `--fontsize` argument in the process?  Setting the `defaultFont` to eg. `20 FONT_NAME` works for me.  At least in the file chooser.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] neilcsmith-net commented on issue #5265: Wrong font used for file chooser

Posted by GitBox <gi...@apache.org>.
neilcsmith-net commented on issue #5265:
URL: https://github.com/apache/netbeans/issues/5265#issuecomment-1377970260

   More a workaround, but have you tried setting the font size in the FlatLaf defaultFont property too?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists