Java apps look like crap under Linux

From NBSWiki

Jump to: navigation, search

Contents

Here are a few links/infos that could point to some of the reasons (apart from bad programming practice)


The font.properties Files (SUN official docs)
Editing the font.properties Files (SUN official docs)
Fonts and Internationalization in Java
java applications don't look right
My Java fonts are big, but I don't want them to be big
Troubleshooting Font Displays on S-PLUS 6.2 for UNIX/Linux
nice fonts in Java programs

How I did it on my Gentoo machine

  • Find the file fonts.alias
kyron ~ # find /usr/X11R6/lib/X11/fonts/ -name fonts.alias
/usr/X11R6/lib/X11/fonts/ukr/fonts.alias
/usr/X11R6/lib/X11/fonts/misc/fonts.alias
/usr/X11R6/lib/X11/fonts/cyrillic/fonts.alias

Note the actual path may vary across Linux distributions.

  • Edit /usr/X11R6/lib/X11/fonts/misc/fonts.alias to add lines such as
-monotype-arial-regular-r-normal--*-140-*-*-p-*-iso8859-1 \ 
-b&h-lucida-medium-r-normal-sans-14-140-75-75-p-81-iso8859-1

This should be all on one line, omitting the "\" continuation indicator shown above. The second entry, -b&h...-1, may need to be modified to match the actual fonts installed on your box. This may vary across Linux distributions. Save the change to fonts.alias. More info here

  • Finally, you need to force the X-server to re-read the fonts. If you are not using a font server, then from an x-term run
> xset fp rehash

If you are using a font server (default on some Redhat distributions), then you will need to restart the font server. On a Redhat machine, become root and execute:

> /etc/rc.d/init.d/xfs restart
  • Alternatively, if you are running a font server, a reboot of the machine will cause the fonts to be re-read.

For X-Win32:

  • Open the X-Win32 configuration utility (X-Util32).
  • Select Fonts > Alias.
  • Double-click 75dpi, and then double click fonts.alias.
  • In the Font Alias dialog, in the Alias from field, enter:
-monotype-arial-regular-r-normal--*-140-*-*-p-*-iso8859-1
  • In the Alias to field, enter:
-b&h-lucida-medium-r-normal-sans-14-140-75-75-p-81-iso8859-1
  • Click Add.

X-Win32

Similar configuration procedures will probably work on other X-server products. On X-Win32 (version 5.3) the procedure was slightly different:

  • Run X-Config
  • Select the session
  • Select the Font tab.
  • Highlight the line that contains ...\lib\Fonts\75dpi
  • Select the Edit Alias File tab.
  • Edit the file (in Notepad).
  • Close all open x-terms and reset X-Win32 (from the context menu).

[_pw9_]

nvnv


Personal tools