Some characters are not rendered properly in the Tiger visualizer, how do I fix it?

Created by Thomas Krause
Keywords:
tiger visualizer font
Last updated by:
Thomas Krause

Since the graph is rendered on the server and send as an image to the browser the Java installation on the server must be able to display the fonts you need.

The default JDK/JRE from Sun uses the Lucida font for general characters and some special fonts for Japanese and Korean. If you are using a recent Linux distribution (e.g. Ubuntu 9.10) the free OpenJDK might be a solution, since it uses the DejaVu fonts per default. These fonts can handle much more character ranges.

If you are stuck to the Sun JDK because you are using Windows or Ubuntu 8.04 (OpenJDK seems to be fully compliant to the JDK only from Ubuntu 9.04) here is a guidance to configure Java to use DejaVu as default font. These instruction were tested on Ubuntu 8.04.

1. Install DejaVu (all fonts)
2. edit the fontconfig.properties file which is located e.g. in $JAVA_HOME/lib/, $JAVA_HOME/jre/lib/ or /etc/java-6-sun/
3. add the following lines to the "Font File Names" section, adjust paths if necessary

filename.DejaVu_Sans=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf
filename.DejaVu_Sans_Bold=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf
filename.DejaVu_Sans_Oblique=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Oblique.ttf
filename.DejaVu_Sans_Bold_Oblique=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-BoldOblique.ttf

filename.DejaVu_Sans_Mono=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf
filename.DejaVu_Sans_Mono_Bold=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-Bold.ttf
filename.DejaVu_Sans_Mono_Oblique=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-Oblique.ttf
filename.DejaVu_Sans_Mono_Bold_Oblique=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-BoldOblique.ttf

filename.DejaVu_Serif=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf
filename.DejaVu_Serif_Bold=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif-Bold.ttf
filename.DejaVu_Serif_Oblique=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif-Oblique.ttf
filename.DejaVu_Serif_Bold_Oblique=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif-BoldOblique.ttf

4. Replace the following configuration entries (search for the configuration key, e.g. "serif.bold.latin-1" and replace the corresponding line)

serif.plain.latin-1=DejaVu Serif
serif.bold.latin-1=DejaVu Serif Bold
serif.italic.latin-1=DejaVu Serif Oblique
serif.bolditalic.latin-1=DejaVu Serif Bold Oblique

sansserif.plain.latin-1=DejaVu Sans
sansserif.bold.latin-1=DejaVu Sans Bold
sansserif.italic.latin-1=DejaVu Sans Oblique
sansserif.bolditalic.latin-1=DejaVu Sans Bold Oblique

monospaced.plain.latin-1=DejaVu Sans Mono
monospaced.bold.latin-1=DejaVu Sans Mono Bold
monospaced.italic.latin-1=DejaVu Sans Mono Oblique
monospaced.bolditalic.latin-1=DejaVu Sans Mono Bold Oblique

5. Restart any Java application that should use the new configuration.

Please note that this will change the behavior all Java applications on the system. There might be a possibility to add character range definitions like "monospaced.plain.japanese-kochi" that shall use your desired font instead of replacing the default one.