0

I've done web search and found only links on how to change size of the font:
How to change font size for JMeter?

I'm on MacOS JMeter 5.1 and font inside controls shows upper i same as lower L. As I've started to read answer to size issue, I came to know what HiDPI and swing for java cross-platform is.

Uncommenting jsyntaxtextarea.font.size=24 in jmeter.properties have not resulted in any visible effect, using Zoom does change size of font, but i-L issue persists at larger scales.

What are my options?

  1. download source of JMeter, rebuild. - complex for me, at first glance least desirable. Where font name is set in source?
  2. try to use swing functionality. Not sure it is doable w/out rebuild of JMeter. As for swing I've only read What font in Swing looks the same in all OS? now and answer to font size:

Now for fonts, you can use Swing mechanism. To do that, add to jmeter.sh or jmeter.bat the JVM System property:

-Dswing.plaf.metal.controlFont=Dialog-20

And ensure you use the Cross Platform LAF .

But "interestingly" with Cross Platform LAF copy-paste does not work on my Mac. Command-C works on some LAF, but does not on others (including Cross Platform). "upper i same as lower L" issue is visible on all LAFs.

  1. Try MacOS font substitution. Not sure again if it is doable. quick web search for macos font substitution did not find that specifically, some default font changes etc. What font JMeter uses?

ADDED: Below is what happened after script run from the asnwer, some parts became not fit to space, some too small.

Screen after script run

Alex Martian
  • 3,423
  • 7
  • 36
  • 71

1 Answers1

1
  1. If copy paste shortcuts don't work on Mac you should raise this issue via JMeter Bugzilla
  2. You can change JMeter font to whatever you like by adding the next lines to system.properties file (lives in "bin" folder of your JMeter installation)

    swing.aatext=true
    swing.plaf.metal.controlFont=Comic Sans MS
    swing.plaf.metal.userFont=Comic Sans MS
    

    JMeter restart will be required to pick the properties up

  3. As the last resort you can always go for Groovy scripting and change the font directly in the runtime like:

    import javax.swing.*
    import java.awt.Font
    
    def keys = UIManager.getDefaults().keys()
    keys.each { key ->
        def value = UIManager.get(key)
        if (value instanceof javax.swing.plaf.FontUIResource) {
            UIManager.put(key, new javax.swing.plaf.FontUIResource("Comic Sans MS", Font.ITALIC, 24))
        }
    }
    

    as the result you will get the best JMeter UX ever:

    enter image description here

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • Dmitri, thank you for you trying to help. However, swing works only for metal (`swing.plaf.metal`), right? I've tried to add same properties for `darcula` and saw no difference in interface. Is it that some looks are made on swing and other on ...? The script changes something, but I added screen to my question and it does not look good, besides, I want to change font where I type, e.g. `Name`, `Comment` of element and font still had non-distinguishable `I` in them. – Alex Martian Jan 09 '20 at 11:48
  • For some reason in Metal look copy-paste of text does not work on Macbook. Is it some `swing` issue or maybe Jmeter specific? I can report to bugzilla of cause. – Alex Martian Jan 09 '20 at 11:49
  • I don't have a Mac hence I cannot tell for sure what LAF is being used there, you can switch JMeter's LAF to `Metal` or `CrossPlatform` via "Options -> Look and Feel" menu and the above hint should work. You can report to bugzilla of course, but my expectation is that they will suggest to ask your boyfriend for help as this is not related to JMeter/Swing. 2nd approach should work for all LAFs. – Dmitri T Jan 09 '20 at 11:57
  • Not related? On MacOS, Darcula LAFs copy-paste works, on Metal and cross does not. Why not related? – Alex Martian Jan 09 '20 at 12:03
  • Looking into JMeter source code either `Control+C` or `Command+C` should work depending on the context – Dmitri T Jan 09 '20 at 12:21
  • Where do you look? Can code be changed to provide for answer in https://stackoverflow.com/questions/7252749/how-to-use-command-c-command-v-shortcut-in-mac-to-copy-paste-text (just found it)? – Alex Martian Jan 09 '20 at 12:30