NetLogo icon indicating copy to clipboard operation
NetLogo copied to clipboard

Font Rendering

Open kgmt0 opened this issue 10 months ago • 7 comments

For some reason, some of the texts around the command center lack anti-aliasing. This affects both the new GUI and the old GUI, with some minor differences. In the screenshots below, you can see that the "Command Center" label isn't anti-aliased in both versions, but the "observer" label only lacks anti-aliasing in the new GUI.

Image Image

kgmt0 avatar Mar 04 '25 19:03 kgmt0

@kgmt0 What OS are you using? I have tested the GUI on Windows, Mac, and Fedora, and I haven't experienced this issue on those platforms. I'm also curious to know if the issue worsens or improves when you zoom the interface in or out.

ERSUCC avatar Mar 06 '25 02:03 ERSUCC

I was testing on Arch Linux. I think zooming in/out makes the texts look a bit worse, but the difference is small.

Image Image

I just tested on Fedora as well, but I couldn't reproduce the problem there. The font looked completely different though, so I think this is probably a problem with missing font.

kgmt0 avatar Mar 06 '25 03:03 kgmt0

I tested on Arch Linux using GNOME, and it looks normal to me. The font should be set to Open Sans for Linux, and I included the font file in the repo, so I'm not sure why it isn't working for you. If you could apply the attached patch file to the more-gui branch and let me know what it prints when you run it on Arch, that would be helpful. Thanks!

font.patch

ERSUCC avatar Mar 06 '25 17:03 ERSUCC

Here's the output: java.awt.Font[family=Open Sans,name=Open Sans,style=bold,size=12]

I noticed that if I installed Open Sans on my system, the font in the GUI changes, but it still doesn't get anti-aliased. I think it looks a bit better than before though. Image

Other texts like the clear button label have anti-aliasing as expected. Image

kgmt0 avatar Mar 06 '25 22:03 kgmt0

@kgmt0 I added some settings that might fix the problem, but I'm not able to reproduce it on my end so I can't be entirely sure. Let me know if it is improved now.

ERSUCC avatar Mar 07 '25 20:03 ERSUCC

Yes, that fixed the problem! Everything has anti-aliasing now.

kgmt0 avatar Mar 07 '25 21:03 kgmt0

@kgmt0 Turns out this fix made it break on Windows, and all the text in the interface now appears bold. I'll reopen the issue and keep investigating.

ERSUCC avatar Mar 07 '25 22:03 ERSUCC

@kgmt0 After some more investigation into this issue, it seems that your system text antialiasing property may be set to something not expected by Java. The AWT documentation indicates that by setting the property that fixed the issue for you (see this page), it will no longer read in the corresponding property from the system settings. I'm not sure if this is even something that you could change, but given that nobody else is able to reproduce the issue, it seems most likely that the fix would be for you to set your system antialiasing property to match what was set by my attempted fix that broke the GUI on Windows. If that doesn't work or isn't something you can change, let me know.

ERSUCC avatar Jul 08 '25 17:07 ERSUCC

Thanks for investigating. I was able to fix the problem by installing an Xsettings daemon and configuring font settings from there. It's a bit strange that only a couple of text labels were affected, but I think this is fine for now.

kgmt0 avatar Jul 09 '25 01:07 kgmt0

Good to hear. Sorry for the trouble!

ERSUCC avatar Jul 09 '25 01:07 ERSUCC