Skip to content
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

[ui] Designer font display #10

Closed
Jmm233 opened this issue Feb 24, 2019 · 13 comments · Fixed by #53
Closed

[ui] Designer font display #10

Jmm233 opened this issue Feb 24, 2019 · 13 comments · Fixed by #53
Milestone

Comments

@Jmm233
Copy link

Jmm233 commented Feb 24, 2019

PMD designer v6.11.0

OS:Ubuntu16.04

2019-02-24 17-35-42

The font in the designer is too difficult to read,so i come for help.
thank you

@oowekyala
Copy link
Member

Hi, thanks for the report. This is weird: the designer uses the default fonts provided by the JavaFX distribution. Could you provide the following info to help us work out a solution:

  • How did you start the app? (eg with the launch script (run.sh designer), from inside an ide, with java -jar, with gradle...)
  • What JRE is it running on? Does the problem also arise when you run it with another JRE? The designer supports JRE versions 8, 9 and 10 perfectly (both Oracle and OpenJDK), and JRE 11 if OpenJFX is installed separately somewhere. With JRE 9+ you need the following VM option:https://github.com/pmd/pmd/blob/63c5cce4b7abdcd9b10fa52d851bbe7c0332fef7/pmd-dist/src/main/resources/scripts/run.sh#L118
    which is added automatically by the run script
  • What's your display's resolution?

@Jmm233
Copy link
Author

Jmm233 commented Feb 26, 2019

thanks.

  • run.sh designer

  • the jdk version is 1.8.0_191,so i think jre version is 8.According to your instructions, the designer should be no problem.

  • the display's resolution is 1920X1080,which is the computer's max

so if i want to change the designer font display,i could change java version?

@adangel
Copy link
Member

adangel commented Feb 26, 2019

Could this be an font anti aliasing issue?
There is this stack overflow question: https://stackoverflow.com/questions/24254000/how-to-force-anti-aliasing-in-javafx-fonts

Desktop environments also usually offer settings for displaying fonts (hinting, sub-pixel-rendering, anti aliasing). But these settings probably won't effect javafx applications.

@Jmm233
Copy link
Author

Jmm233 commented Feb 27, 2019

well,your suggestion is valuable, and i got a lot. i am a rookie,so i haven't solve this.i think it is also ok to read. thank you for your help.

@oowekyala
Copy link
Member

oowekyala commented Feb 27, 2019

@adangel Not sure it's an aliasing problem. You could be right, but in the screenshot, the font looks like it has serifs (e.g. the l), even though the designer normally uses a sans serif font family. So it could be that the font is for some reason not found and defaulted to that low-res one? I'm not sure how JavaFX selects fonts though, so whether it's a problem with the system or with the JFX distribution...

@Jmm233 If you've got another JRE installed, I'd try switching just for the sake of it. On ubuntu you may use sudo update-alternatives --config java if you've installed your JREs through a package manager. If you need some more help we can talk on Gitter

@adangel adangel transferred this issue from pmd/pmd Mar 16, 2019
@ChitsuthaCSKKU
Copy link

Screen Shot 2563-12-09 at 14 52 50

I ran the designer from run.sh designer on macOS. Anyone knows how to solve this? Thanks

@adangel
Copy link
Member

adangel commented Dec 11, 2020

@ChitsuthaCSKKU Which java version and openjfx version are you using? Try updating to the latest version, maybe that solves the problem.

@ChitsuthaCSKKU
Copy link

I am using
openjdk version "15.0.1" 2020-10-20
OpenJDK Runtime Environment (build 15.0.1+9)
OpenJDK 64-Bit Server VM (build 15.0.1+9, mixed mode, sharing)
javafx-sdk-11.0.2

which are the latest version, I think?

@adangel
Copy link
Member

adangel commented Dec 11, 2020

You could try to use openjfx 15.0.1, maybe there are some bugs fixed. It's available from here https://gluonhq.com/products/javafx/

@savithraj
Copy link

I used openjfx version 16 but I am getting below error. If I use version 11 then I am getting the same UI as @ChitsuthaCSKKU

Jun 03, 2021 8:54:29 AM com.sun.javafx.application.PlatformImpl startup WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @40f9161a' Graphics Device initialization failed for : es2, sw Error initializing QuantumRenderer: no suitable pipeline found java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found at com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:280) at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:244) at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:261) at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:286) at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:160) at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658) at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678) at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195) at java.base/java.lang.Thread.run(Thread.java:831) Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:94) at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124) ... 1 more java.lang.RuntimeException: No toolkit found at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:273) at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:286) at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:160) at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658) at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678) at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195) at java.base/java.lang.Thread.run(Thread.java:831)

@oowekyala
Copy link
Member

@savithraj Have you had a look at #49? It looks similar to your error

@jsotuyod
Copy link
Member

I did some research into this, and the original issue seems to be rooted on the overall way the javafx renderer works on Linux, which effectively produces blurry text (ie: look into https://github.com/woky/javafx-hates-linux).

Fortunately, it seems that simply setting:

System.setProperty("prism.text", "t2k");
System.setProperty("prism.lcdtext", "true");

is enough to get much better results. Moreover, this can be done during application startup (in the DesignerStarter) with no further changes needed in the application.

I'm unsure if these flags have any unwanted effect on other platforms (that is, f we should only set this when detecting we run under Linux).

@jsotuyod
Copy link
Member

As for the issue on Mac shown on #10 (comment) I was able to reproduce it using an older version of javafx.

When I run from the IDE (using Javafx 11) the text shows corrupted. Doing some trials I found out that JavaFX 14+ is needed to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants