[ Home > xfig > Xfig and non-ASCII Characters ]

[ INDEX ] XFIG - facility for interactive generation of figures under X11

Xfig and non-ASCII Characters

Usally, we can use Latin-1 characters on xfig without any special settings, but some people in the world may want to use another characters.

Do you want to use characters other than Latin-1 on xfig? OK. You can probably use internationalization facility to enable it, as described below.

ISO-8859-n Characters on Xfig

To use characters such as ISO-8859-2 (Latin-2), ISO-8859-7 (Greek), etc. on xfig 3.2.3, you must compile xfig and fig2dev with I18N facility enabled. See Internationalization for details.

You should then put following lines to app-defaults file:

    Fig.international: true
    Fig.inputStyle: Root
    Fig.eucEncoding: false
    !Fig.latinKeyboard: true

You may or may not want to remove ``!'' at the lastest line.

And then, set LANG environment variable to the desired locale (czech, for example) and start xfig, then select Times-Roman or Times-Bold on TEXT FONT and enter text from keyboard. If everything was OK, you may enter locale specific characters here, using localized keyboard and/or ``dead keys''.

Export in PostScript

To export figure with non-Latin-1 characters in PostScript, fig2dev usually requires PostScript header file for the locale.

In the PostScript header file, Times-Roman-iso and Times-Bold-iso must be redefined to the font in the locale dependent encoding. If you have appropriate font for the locale, the PostScript header file can be simple as:

  /Times-Roman-iso /Times-Roman-Latin2 findfont definefont pop
  /Times-Bold-iso /Times-Roman-Latin2 findfont definefont pop

PostScript header files for some locales

Here are some PostScript header files for some locales.

Except Japanese and Korean, those PostScript header files generate those fonts from general Times-Roman and Times-Bold fonts, or they include font itself. This means no special fonts are required to process the PostScript file generated with those header files.

Unfortunately, some of them makes the resulting PostScript file very large (for example, iso8859-7.ps makes the PostScript files 200kB larger), and this can be a problem when many PostScript (EPS) files are inserted into a document.

Encoding Languages Header File
ISO-8859-1 (Latin-1) English, French, Spanish, German, etc. not required
ISO-8859-2 (Latin-2) Czech, Hungarian, Polish, etc. iso8859-2.ps
ISO-8859-4 (Latin-4) *1 Estonian, Latvian, etc. iso8859-4.ps
ISO-8859-7 Greek iso8859-7.ps
ISO-8859-8 *2 Hebrew, Yaddish iso8859-8.ps
ISO-8859-9 (Latin-5) Turkish iso8859-9.ps
ISO-8859-11 (Thai) *3 Thai iso8859-11.ps
ru_RU.KOI8 *4 Russian (Cyrillic) ru_RU.KOI8.ps
Czech Czech czech.ps
ja_JP.eucJP *5 Japanese japanese.ps
ja_JP.UTF-8 Japanese ja_JP.UTF-8
ko_KR.eucKR *5 Korean korean.ps

*1 Glyph of lattin letter eng (characters at BD and BF) in iso8859-4.ps are probably completly wrong.

*2 iso8859-8.ps (Hebrew) doesn't support Bold font now.

*3 Characters at DF, FA and FB are dropped from iso8859-11.ps.

*4 For Cyrillic, ISO-8859-5 is not prepared yet. I couldn't find suitable Cyrillic font for the encoding.

*5 japanese.ps and korean.ps are contained in the fig2dev 3.2.3 distribution. See also section Internationalization of the Xfig User Manual.

If you want to use those languages, you can get appropriate header file and put it as $LANG.ps ($LANG is locale name you use) in the directory specified with FIG2DEV_LIBDIR when installing fig2dev (you should find some files such as ja_JP.eucJP.ps in the directory).

If everything was OK, you may export figure with those characters and print it to PostScript printer, or process the PostScript file with GhostScript.

Notes

Thanks

czech.ps was contributed from Ales Horak.

Fonts in iso8859-7.ps (Greek), iso8859-8.ps (Hebrew), iso8859-9.ps (Thai) and ru_RU.KOI8.ps (Cyrillic) are derived from other people's work. See those files for details.

Reference

Feedback

Please send any feedback or contribution to VEF00200@nifty.com (T.Sato).


by T.Sato, 2000-08-22