Gradle app text is scuffed (Pathweaver, Shuffleboard)

When I open gradle apps, the text renders with weird characters:



The commands I ran:
sh gradlew pathweaver and sh gradlew shuffleboard
Does anyone know how to solve this?

If launching in other ways (ie, the launcher scripts or the jars themselves in ~/wpilib/YEAR/tools/), does it render properly?

Also, is the OS set to a non-English language? That could cause a character encoding issue like this.

TLDR: SOLVED! by using AdoptOpenJDK instead of OpenJDK

My language is US. Thanks for telling me about the wpilib/tools folder, though! I ran the jar and it still had the exact same weird text, but it printed this in the console:

2022-11-23 14:42:57.321 java[3095:35005] CoreText note: Client requested name ".SFNS-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].

2022-11-23 14:42:57.321 java[3095:35005] CoreText note: Set a breakpoint on CTFontLogSystemFontNameRequest to debug.

2022-11-23 14:42:57.330 java[3095:35005] CoreText note: Client requested name ".SFNS-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].

Nov 23, 2022 2:42:57 PM edu.wpi.first.pathweaver.Loggers setupLoggers

CONFIG: Configuration done.

2022-11-23 14:42:57.538 java[3095:35095] CoreText note: Client requested name ".SFNS-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].

2022-11-23 14:42:57.601 java[3095:35095] CoreText note: Client requested name ".SFNS-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].

I stuck the errors into a google search and found this stackoverflow post java - When running the program in netBeans the font looks extremely weird - Stack Overflow
The top answer was:

“I also had the same issue, but in my case, the problem was with JDK 11. First, I tried to switch to JDK 8 and everything worked fine, but then I found that another version of JDK 11 (AdoptOpenJDK(HotSpot) 11) also fixes it.”

I installed AdoptOpenJDK 16 built for x86 and the fonts fonts look how they should now! (No more console font errors either)

Thank you for the help!
Micah

1 Like

When you were running the app before, were you starting it using the VSCode packaged with wpilib?

I was running it from the command line with the gradlew shell script that project wizards generate in the robot code project folder
ie ./gradlew pathweaver

also, cheeky self promo-
i built a command line utility for switching between java versions and I used that to set my java version to the right one after installing it with homebrew.
You can download/install the shell script on the github!

1 Like

When you ran that were you running with the version of OpenJdk (that caused the issue) referred to in your solution post? When you run the tools through the vscode command pallette (ctrl shift p), vscode will run them with wpilib’s known good version of the jdk (if it’s installed with the wpilib installer).

Running with WPILib VSCode’s Start Tool > Pathweaver button still has the messed up text. How does it determine the known java version? Perhaps this is an edge case issue for otherwise good java versions only on m1 macs?
(ps. i had previously set the gradle java home version to java 11, but i removed that setting and it still had the font issue)

It looks like vscode is just using whatever java binary my path defines. I’m switching my java version path export with my version switcher tool and with
- OpenJDK 11.0 [x86_64] it has the scuffed text
- OpenJDK 11.0 [arm64] it fails to open the window
- AdoptOpenJDK 16.0 [x86_64] it opens properly with correct text
How does WPILib select the right java version?

It uses the one installed by the installer, and if that doesn’t exist it uses JAVA_HOME, and if that doesn’t exist it uses the one on the path. The fact that your script affected it implies that you didn’t use the WPILib installer.

1 Like

Yeah i didnt :[]