Russian fonts

This page illustrates how the PCFFont class can be used to display Russian text without worrying about what browser or fonts are being used by the person viewing the page -- the Java applet looks after the fonts.

This page uses the DrawText applet, which simply reads in a text file and displays it using the specified font. In this case, the text file is part of The Last Days of Leo Tolstoy, from www.linguadex.com. The font uses the KOI-8 encoding. This encoding is documented in RFC 1489.

To use this applet, you first need to unzip pcffont.zip into a directory "pcffont". Next, you need to copy the appropriate font into a directory "pcf". (For Cyrillic, the font is crox2h.pcf.) Next, get DrawText.class. Next, create your text file (in this case russian.txt). Finally, add an applet tag to your html file; the following tag generates the above text.

<applet code="DrawText.class" align=middle width=500 height=400>
<param name="file" value="russian.txt">
<param name="font" value="pcf/crox2h.pcf">
</applet>

Back to my Java PCFFont class page.


WebCounter:
Ken Shirriff: shirriff@eng.sun.com
This page: http://www.righto.com/java/fonts/russian.html
Copyright 1998 Ken Shirriff. Last updated 8/18/99. Java and other Java-based names are trademarks of Sun Microsystems, Inc. and refer to Sun's family of Java-branded technologies. Use of this software is subject to the terms of the license agreement.