Martin Gross bio photo

Martin Gross

Solution seeker, building things, often in software.

Twitter Google+ LinkedIn Github

Somehow I was not really satisfied how JRuby Swing IRB (jirb_swing.bat) was looking on my windows machine.

Antialiasing was not switched on and the font could also be nicer.

To change that I had to modify two files in the JRUBY_HOME\bin folder:

  • jirb_swing.bat and
  • jirb_swing

Antialiasing on:
Thats just a jvm argument you have to add.
Add -Dswing.aatext=true to jirb_swing.bat after -Djruby.lib="%JRUBY_HOME%\lib". Depending on which version of JRuby you are using it can be also in jruby.bat .

Font:
I want to use Anonymous.ttf font which is looking better than Monaco.ttf on Windows in my opinion. You can get it here .

jirb_swing is ruby script which is setting up the Swing wrapper for IRB. Just modify the line which sets the font to the desired value. You can provide several fonts which will be loaded whatever will be found first.

So I want Anonymous as my font. Monaco is not available on my system, but Andale is. I set Anonymous as the second choice:

text.font = find_font('Monospaced', Font::PLAIN, 12, 'Monaco','Anonymous','Andale Mono')

Swing uses then Anonymous (Monaco is not installed).

Save both modified files and be happy…