Warning: this section does not cover general Unix things, look at Unix section instead.
Fonts:
- Bitmap fonts:
- Cronyx KOI8-R font set v2.3.1 for X11R6 (
*.pcf.gz
) - Cronyx KOI8-R font set v2.3.1 for X11R5 (
*.pcf.Z
)
XFree86 v3.3 & v4 already includes an older version of these fonts, but here is the latest version. You can also download drop-in source replacement for obsoleted KOI8-R fonts sources distributed with XFree86 v4, put it into
xc/fonts/bdf/cyrillic
source directory before building.WARNING: These fonts do NOT strictly conforms to KOI8-R as per RFC 1489, you can rely on the letters area only. Feel free to fix these fonts and contribute them back to me, if you are interested you can download the sources of these fonts.
The usual place for these fonts is the
/usr/local/lib/X11/fonts/cyrillic/{100dpi,75dpi,misc}
set of directories, but if you can't modify system directories, just put them in any directory. You need to check that these directories are first in yourFontPath
, look inXF86Config
file (/etc/XF86Config
for XFree86 v3 or/etc/X11/XF86Config
for XFree86 >= v4) if you install the fonts in the system directory. Otherwise typexset +fp misc_dir,100dpi_dir,75dpi_dir
to add them locally. Use
xset q
to check if they are first in the
FontPath
.
- Cronyx KOI8-R font set v2.3.1 for X11R6 (
- OpenType / TrueType fonts:
- Free Microsoft core fonts for the web
(Andale Mono, Arial Black, Arial, Comic MS, Georgia, Impact, Times New Roman, Trebuchet MS, Verdana, Webdings, Courier)
Download msttcorefonts.tgz package and extract it into
/usr/local/lib/X11/fonts/
(the directory must be in/usr/local/etc/fonts/fonts.conf
). AddFontPath "/usr/local/lib/X11/fonts/msttcorefonts/"
to your/etc/X11/xorg.conf
.fonts.dir
is already in the package, I usettmkfdir -p
to create it withencodings.dir
and some encodings it understands. After all, runfc-cache -f -v
to get new directory cached.
- Free Microsoft core fonts for the web
- Type1 fonts:
- Type1 KOI8-R font set X11 (two Couriers, Times, Arial)
WARNING: These fonts (excluding ERKurier) do NOT conform to KOI8-R strictly as per RFC 1489, you can rely on the letters area only.
The usual place for these fonts is the
/usr/local/lib/X11/fonts/Type1
directory, but if you can't modify system directories, just put them in any directory and setFontPath
as described above. SeeREADME
file inside the archive and --> koi8 postscript fonts page (in Russian) for more info.
- Xorg somehow miss
koi8-r.enc
file in the/usr/local/lib/X11/fonts/encodings
. You can download it and place there. Don't forget to rebuild directory index.
- See also TrueType Fonts in Debian mini-HOWTO.
Locales:
- X11R5 NLS workaround.
Unpack it into/usr/local/lib/X11/
. If you can't modify system directories, put it in any directory and then set theXNLSPATH
environment variable to point to this directory. - X11R6 Locale.
Unpack it into/usr/local/lib/X11/locale
. You don't need it for XFree86 3.3*, because it is already included in the standard distribution.
To activate locale support you need to set your LANG environment variable to ru_RU.KOI8-R
Keyboard:
Only the latest X11R6 and XFree86 provide for proper KOI8-R keyboard input (in terms of X11 internationalization) using separate Cyrillic_*
keysyms (different from ISO 8859-1 keysyms); let's call this the right method. Different keysyms are needed for multilanguage processing, i.e. your xterm or properly internationalized editor can view/input Russian, Latin1, Greek and Japanese text at once and store it in a file using X11 pre-defined escape sequences to switch between languages. Since there is no standard ISO 2022 escape sequence for KOI8-R, X11 assigns the following non-standard C string to access the upper half of KOI8-R: "\033%/1\200\210koi8-r\002", to access the lower half (which is identical to the lower half of ISO 8859-1) you can use the following standard ISO 2022 escape sequence: "\033(B". Internally, when Cyrillic_*
keysym is pressed for the first time, the X11 escape sequence for KOI8-R is generated to allow proper fonts switching. The new method is not backward compatible with old applications, examine the detailed warning below.
About X Keyboard Extension (XKB) details see I. Pascal's pages.
ATTENTION: XFree86 3.3.3 introduced an Xlib bug which replaces the KOI8-R keyboard table with an ISO 8859-5 table. Use this patch to fix the bug.
For other X11 versions, you can resort to the so-called Xmodmap hack method, with ISO 8859-1 keysyms cheating used to disguise KOI8-R keycodes for ISO 8859-1 keycodes. X11 developers are strongly against this method since it breaks their internationalization concept, so you should avoid using it when possible.
- XFree86 >= v3 (the right method)
- This XFree86 version is capable of working correctly with KOI8-R keys when
Cyrillic_*
keysyms are used (e.g. in XKB mode).
WARNING: Most of the old and obsolete applications will not work with the KOI8-R keyboard as they are. X11 developers are aware of this situation, but say that nothing fancy can be done other than modifying the old programs: a few lines of code have to be added, i.e. in order to work, an application's sources must be at least minimally localized according to the X11R6 main strategy:
-
If your application does not use Xt or any other Xt-based toolkit like Xaw* or Motif/lesstif and is based directly on Xlib, use
#include <X11/Xlocale.h>
header and callsetlocale(LC_CTYPE, "");
early in themain()
function of your application.
- For Xt-based applications (most applications) it's best to call
XtSetLanguageProc(NULL, NULL, NULL);
early in themain()
function of your application.
- For GTK applications call
gtk_set_locale();
early in themain()
function of your application.
Suggest these methods to any application author you have problems with.
To enable the Russian keyboard, add this lines to the
"Keyboard"
section of yourXF86Config
configuration file. In the following examplescaps_toggle
means CapsLock switcher.For XFree86 v3,
/etc/XF86Config
:XkbLayout "ru" XkbOptions "grp:caps_toggle"
For XFree86 >= v4 (but not recent one),
/etc/X11/XF86Config
:Option "XkbLayout" "ru" Option "XkbOptions" "grp:caps_toggle"
For Xorg,
/etc/X11/xorg.conf
and new XFree86:Option "XkbLayout" "us,ru" Option "XkbOptions" "grp:toggle"
NOTE:- English layout now isn't enabled by default, like in older versions.
caps_toggle
not works because of xkeyboard-config bug (fixed in new builds), use another switcher like Right Alt =toggle
.
Also make sure that
XkbDisable
is turned off (commented out) there.If you want to edit the keyboard description additionally, you can find it in the text file which is usually called
/usr/local/lib/X11/xkb/symbols/ru
, the format is almost self-explanatory.To activate Russian locale and keyboard support you need to set your LANG environment variable to
ru_RU.KOI8-R
-
- Older XFree86 releases, prior to 3.2 (a hack method)
- Place the XFree86 3.1.2 keyboard mapping table in
/usr/local/lib/X11/xinit/.Xmodmap
, and you use CapsLock to switch to/from Russian (KOI8-R) keyboard (after X (re)started). I assume that the defaultxinitrc
you use or your~/.xinitrc
picks.Xmodmap
as well. If this doesn't work for you, type xmodmap /usr/local/lib/X11/xinit/.Xmodmap directly. If you can't modify system directories, just place the file into any directory and call xmodmap there.
- X86 OpenWindows (a hack method)
- Try this X86 OpenWindows keyboard mapping table.
- Combined (both hack and right methods)
- xxkb И. Паскаля - индикатор-переключатель раскладки клавиатуры, в т.ч. позволяет работать с двумя раскладками: для "правильных" и "неправильных" (устаревших) программ.
- Others (a hack method)
- Xruskb by A. Lukyanov is an Xmodmap-compatible keyboard switcher program.
WARNING: For pure Xmodmap hacking methods (without Xruskb) control keys don't work when the Russian mode is active, this is a known feature.
Applicable Software:
- Browsers:
Firefox 14 (this browser supports KOI8-R)
-
Opera (this browser supports KOI8-R)
Opera 11 and up will run on any modern Linux distribution and FreeBSD 7 or later with Xorg installed, on i386 and x86_64 CPU's. - Chrome 21 (this browser supports KOI8-R)
Mozilla Suite 1.7.13 (this browser supports KOI8-R)
-
Netscape 4.8 (X11) (attempts to support KOI8-R, obsoleted now)
See also How to set up Netscape 4 for KOI8-R and the current bug list.
- E-Mail:
- Thunderbird (this MUA/Newsreader supports KOI8-R)
- XF-Mail (an XForms library ased MUA, MIME/POP/SMTP/IMAP4/XFaces, supports KOI8-R)
Software Tuning:
- XTerm:
XTerm should be configured and builded with--enable-luit
option and requires locale converterclass=nowrap>/usr/local/bin/luit
installed to work with any non UTF-8, f.e.ru_RU.KOI8-R
locale, automatically (obtained fromLANG
orLC_*
environment variables). If your XTerm meets requirements above, just addXTerm*locale: true XTerm*VT100*allowC1Printable: true
lines into your~/.Xdefaults
file. If not, try to use/usr/local/bin/koi8rxterm
instead. - How to set up NCSA Mosaic to use KOI8-R fonts:
add this X-resources description to your~/.Xdefaults
file. See also MS-Windows Mosaic tuning. - XEmacs:
См. статью по настройке XEmacs с MULE и без - Exmh:
It has broken KOI8-R support, use this patch to fix it. - Страничка koi8 postscript fonts описывает настройку Ghostscript в KOI8-R для эмуляции postscript-принтера, установку KOI8-R Type1 шрифтов для XFree86, печать по-русски из Netscape, русификацию StarOffice и ApplixWare.
- Почему Mozilla печатает вместо русских букв пустые квадраты, хотя в PrintPreview все нормально?
- Lib.Ru: Страничка кириллизации