Font scaling in 2020.7

Questions about YourKit Java Profiler
Locked
eprst
Posts: 4
Joined: Mon Oct 01, 2018 7:43 am

Font scaling in 2020.7

Post by eprst »

I have a mixed DPI setup with 4K screen on my laptop and a "regular" DPI external monitor. My Linux/KDE is configured with ~170% font scaling so that things don't look too tiny on the laptop screen, and I scale fonts down in IDE/Browser etc if I move them to the external monitor.

YourKit used to respect `yk.font.scale` settings but not anymore, everything is huge with my setup. Any workaround?

Relevant log lines:

Code: Select all

20.7-369 0.000: Command line:
  /home/konstantin/YourKit-JavaProfiler-2020.7/bin/../jre64/bin/java
  -Xmx8G
  -Djava.awt.smartInvalidate=true
  -XX:+HeapDumpOnOutOfMemoryError
  -Xmx16G
  -Dyk.font.scale=0.5
  -jar
  /home/konstantin/YourKit-JavaProfiler-2020.7/bin/../lib/yourkit.jar
....
20.7-369 0.074: com.yourkit.ae.z.e: sun.java2d.opengl=true
20.7-369 0.074: com.yourkit.ae.z.e: awt.useSystemAAFontSettings=lcd
20.7-369 0.075: com.yourkit.ae.z.e: sun.java2d.renderer=sun.java2d.marlin.MarlinRenderingEngine
20.7-369 0.525: com.yourkit.ae.z.a.d: Cannot detect Xft/DPI; fallback to default 96
20.7-369 0.526: com.yourkit.ae.z.a.d: gnome.Xft/DPI=98304
20.7-369 0.526: com.yourkit.ae.af.a: JVM UI scale enabled=true
20.7-369 0.526: com.yourkit.ae.af.a: JVM UI scale=1
20.7-369 0.527: com.yourkit.ae.af.a: System UI scale=1.0
20.7-369 0.528: com.yourkit.ae.af.a: Font scale=1.3333333333333333
20.7-369 0.610: com.yourkit.ae.af.a: Primary font=java.awt.Font[family=Dialog,name=Dialog,style=plain,size=12]
20.7-369 0.610: com.yourkit.ae.af.a: Menu font=java.awt.Font[family=Dialog,name=Dialog,style=plain,size=12]
20.7-369 0.611: com.yourkit.ae.af.a: Found theme=DARK
20.7-369 0.611: com.yourkit.ae.af.a: Scaled primary font=java.awt.Font[family=Dialog,name=Dialog,style=plain,size=16]
20.7-369 0.611: com.yourkit.ae.af.a: Scaled menu font=java.awt.Font[family=Dialog,name=Dialog,style=plain,size=16]
Vladimir Kondratyev
Posts: 1624
Joined: Tue Aug 10, 2004 7:52 pm

Re: Font scaling in 2020.7

Post by Vladimir Kondratyev »

1. Please try disable HiDPI scaling by adding "-Dsun.java2d.uiScale.enabled=false" to startup parameters.

2. Custom font size can be set with "yk.font.size" integer property.
eprst
Posts: 4
Joined: Mon Oct 01, 2018 7:43 am

Re: Font scaling in 2020.7

Post by eprst »

"-Dsun.java2d.uiScale.enabled=false" makes it more usable, but "yk.font.size" has no effect
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Font scaling in 2020.7

Post by Anton Katilin »

In addition to "yk.font.size" please also specify "yk.font.name".

You can find the font name in the profiler UI log file <user home>/.yjp/log/profiler-ui-<pid>.log. Search for the line with text "Primary font" to look up the font name.
eprst
Posts: 4
Joined: Mon Oct 01, 2018 7:43 am

Re: Font scaling in 2020.7

Post by eprst »

ok works this way, thanks!
Locked