The following example illustrates the steps that you need to follow when you add a new PCF, TrueType, or Type1 printer-resident font to the configuration file.
Replace the font for displaying characters in the range 0x00000021 - 0x0000007f with a TrueType font instead of the currently configured PCF font.
Before adding a new font, look at various components in the configuration file that correspond to the currently configured font, as shown next.
FontNameAlias iso88591R PCF /usr/openwin/lib/X11/fonts/75dpi/courR18PCF.Z FontNameAlias iso88591B PCF /usr/openwin/lib/X11/fonts/75dpi/courB18PCF.Z . . . FontGroup iso88591 PCF iso88591R iso88591B . . . MapCode2Font 0x00000020 0x0000007f iso88591 . . . CnvCode2Font iso88591R _xuiso88591 /usr/lib/lp/locale/$LANG/mp/xuiso88591.so CnvCode2Font iso88591B _xuiso88591 /usr/lib/lp/locale/$LANG/mp/xuiso88591.so
Suppose you selected /usr/openwin/lib/locale/ja/X11/fonts/TT/HG-MinchoL.ttf as your candidate for doing the mapping in the en_US.UTF-8 locale. Because this is a Unicode character-mapped TrueType font file, in the mapping function within the .so module you only need to have a function that directly returns the incoming ucs-2 code points.
unsigned short _ttfjis0201(unsigned short ucs2) { return(ucs2); }
Save this in a ttfjis0201.c file. Create a shared object as follows.
cc -G -Kpic -o ttfjis0201.so ttfjis0201.c
But if you are mapping a PCF file, such as /usr/openwin/lib/locale/ja/X11/fonts/75dpi/gotmrk20.pcf.Z, then look in the fonts.dir file in the /usr/openwin/lib/locale/ja/X11/fonts/75dpi/ directory. Become familiar with the encoding, corresponding to XLFD, which is:
-sun-gothic-medium-r-normal--22-200-75-75-c-100-jisx0201.1976-0
If jisx0201 is the encoding, prepare a shared object that maps from ucs-2 to jisx0201. You need to obtain the mapping table for creating the .so module (if one is not already provided). For a Unicode locale, find the mappings from the many charsets to Unicode under ftp.unicode.org/pub/MAPPINGS/. Follow these mappings(1)(1) in order to write a xu2jis0201.c file:
unsigned short _xu2jis0201(unsigned short ucs2) { if(ucs2 >= 0x20 && ucs2 <= 0x7d ) return (ucs2); if(ucs2==0x203e) return (0x7e); if(ucs2 >= 0xff61 && ucs2 <= 0xff9f) return (ucs2 - 0xff60 + 0xa0); return(0); }
When you create a mapping file, include all the UCS-2 to jisx0201 cases.
cc -G -o xu2jis0201.so xu2jis0201.c