[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cyrillic-HOWTO



On 10.VI.2000 at 23:54 Alex Kanavin wrote:
> On Mon, 10 Jul 2000, Aleksey Novodvorsky wrote:
> 
> > 3. Первую попытку описать то, что относится к различным славянским
> > кириллическим локализациям  сделал Антон Зиновьев из Болгарии.
> 
> Можно URL?

	Добрый день,

	Это просто документация к пакетам для кирилизации Дебиана, кои 
я сделал (ftp://lml.bas.bg/home/anton/debian/potato).

	Если решите сформировать рабочую группу для разработки 
Cyr-HOWTO или International-Cyrillic-HOWTO, то я буду помогать.

	Имею одно замечание по отношению ТеХ-а.  Это верно, что он от 
кирилизации уже не нуждается.  Однако не все знают это, поэтому по 
моему будет полезно хотя бы краткое указание, при том как для LaTeX, 
так и для PlainTeX.

	Далее следует часть от документации этих пакетах.


	  -------------------------------------------------
	  -------------------------------------------------
		     CYRILLIC LOCALES FOR DEBIAN
	  -------------------------------------------------
	  -------------------------------------------------


After installing the package locale-cyrillic you will be able to use
the following Cyrillic locales:

bg_BG.CP1251 bg_BG.ISO-IR-111 bg_BG.ISO8859-5 bg_BG.KOI8-R bg_BG.KOI8-U
be_BY.CP1251 be_BY.ISO-IR-111 be_BY.ISO8859-5      -            -
mk_MK.CP1251 mk_MK.ISO-IR-111 mk_MK.ISO8859-5      -            -
ru_RU.CP1251 ru_RU.ISO-IR-111 ru_RU.ISO8859-5 ru_RU.KOI8-R ru_RU.KOI8-U
ru_UA.CP1251 ru_UA.ISO-IR-111 ru_UA.ISO8859-5 ru_UA.KOI8-R ru_UA.KOI8-U
uk_UA.CP1251          -              -             -       uk_UA.KOI8-U

Choose one of them depending of your working language, country and
working encoding.  For example let we choose the locale ru_UA.CP1251,
it is for Russian language in Ukraine and working encoding CP1251.

Then the environment variable LANG should have the value
"ru_UA.CP1251" (without the quotes).  This can be made by the
following command (if you use Bourne-like shell):

LANG=ru_UA.CP1251; export LANG

Put this command in your ~/.profile or ~/.bash_profile.

If you are system administrator you can set default encoding for users
by putting this command in /etc/environment.  Then add the following
line in the file /etc/profile:

test -f /etc/environment && . /etc/environment

(Be careful for spaces around the dot.)


	-----------------------------------------------------
	-----------------------------------------------------
		 CYRILLIC ON LINUX CONSOLE FOR DEBIAN
	-----------------------------------------------------
	-----------------------------------------------------

[Этот пакет сделан на основе console-tools-cyrillic-0.6a.  Уже вышла 
новая версия 0.7.  Когда сделаю пакет для Дебиана, там будет также и 
македонская клавиатура.]

			 1. THE SCRIPT `CYR'

The package console-tools-cyrillic (upstream author: Victor Wagner
<vitus@ice.ru> <vitus@wagner.rinet.ru>) gives you easy and powerful
"cirillization" of the Linux console.  It is recommended that you
install also the package console-tools.

For fast Cyrillic use the script `cyr'.  Try `cyr --help' for usage
summary.  First time you invoke `cyr' in this way:

cyr -k sr -e iso-8859-5 -s arab -f14 --save

This sets Cyrillic on console with Serbian keyboard, working encoding
ISO-8859-5, and 14-point font `arab'.  The option `--save' says `cyr'
to save this combination as default for next invoking.

After this saving it is enough just to run `cyr' without parameters.
Or you can use a command like

cyr -ecp1251

to work with your default keyboard and font but with CP1251.  Or to
play with

cyr -s lenta

and see how look other supported Cyrillic fonts.


		    2. SUPPORTED KEYBOARD MAPPINGS

All keyboard mappings in the package are based on the system of
macroses developed by Cyril Slobin <slobin@iname.com>.  The package
contains the following keyboard mappings:

a) bg_bds

The Cyrillic letters in this mapping are arranged according to the
State Standard of Bulgaria.  Use AltGr (Right Alt) for switching
between Cyrillic and Latin letters.  On extended keyboards use both
window keys and the System key for temporary switching.

b) bg_phon

The Cyrillic letters in this mapping are arranged according to their
phonetic transliteration with Latin Letters.  Use AltGr (Right Alt)
for switching between Cyrillic and Latin letters.  On extended
keyboards use both window keys and the System key for temporary
switching.

c) by

This is a Byelarussian Cyrillic keyboard mapping.  Right_Control key
is used for Cyrillic toggle, Right_Alt for temporary shift to
Cyrillic.  On 104-key keyboard, System key is also used for toggle and
Window keys for temporary shift.

d) ru

This is a Russian keyboard mapping by Cyril Slobin <slobin@iname.com>.
All Cyrillic letters are on their proper places.  Right_Control key is
used for Cyrillic toggle, Right_Alt for temporary shift to Cyrillic.
On 104-key keyboard, System key is also used for toggle and Window
keys for temporary shift.

e) sr

This is a Serbian Cyrillic keyboard mapping.  The arrangement of the
Cyrillic letters is according to the keyboard mapping made by Milos
Rancic <millosh@isgf.grf.bg.ac.yu>.  Right_Control key is used for
Cyrillic toggle, Right_Alt for temporary shift to Cyrillic.  On
104-key keyboard, System key is also used for toggle and Window keys
for temporary shift.  The Cyrillic `ZH' is on the key </ ?>, the
Cyrillic `DJ' is on the key <z Z>.  In Cyrillic mode the symbols `-'
and `_' are on the key <\ |> and the symbols `[' and `]' are on the
key <] }>.


		   3. SUPPORTED CYRILLIC ENCODINGS

Note that if you use `console-tools-cyrillic' with the console package
`kbd' some characters may be displayed incorrectly with some of the
fonts.  Consider installing of `console-tools' package.

In the terminology of the script `cyr', only the font styles `uni',
`iso' and `arab' contain all Cyrillic letters.  If you use some other
style (i.e. some other font) some of the Cyrillic letters will be
approximated with other symbols.

a) CP1251 (MS-CYR)

This is the most popular Cyrillic encoding in the world.  It is
standard Linux encoding in Bulgaria and Byelarus and standard for
e-mail in Bulgaria as well.  This encoding is not very suitable for
usage in X Window System because some Serbian letters and some
typographical symbols are in the `prohibited' diapazone 0x80-0x9f.

b) IBM866 (DOS-CYR-RU, CP866)

This is Russian Cyrillic encoding for DOS.  It can not be used in X
Window System.

c) ISO-8859-5

The international 8-bit Cyrillic encoding and the most non-popular
Cyrillic encoding.  It doesn't contain many important typographical
symbols, but it is the only encoding that allow all Serbian letters to
be used in X Window System.

d) KOI8-R

Russian encoding based on KOI-8.  It is standard Linux encoding in
Russia and standard for e-mail in Russia as well.  It has good support
in X Window System.  But it contains only Russian letters and many
important typographical symbols are missing.

e) KOI8-U

Ukrainian encoding based on KOI8-R.  Basicly it is KOI8-R with added
Ukrainian letters.  It is standard Linux encoding in Ukraine.  But it
is not supported by web-browsers and also misses many typographical
symbols.

d) Apple-Cyrillic

The Cyrillic encoding of Apple Macintosh computers.  It can not be
used in X Window System.  There is also variant of this encoding for
Ukraine.

e) MIK (DOS-CYR-BG)

This is Bulgarian Cyrillic encoding for DOS.  It can not be used in X
Window System.


		       4. CYRILLIC AT RUN-TIME

Usually when you switch to X Window and back to Linux console the
Cyrillic on console brokes.  But it is easy to restore it by the
script `cyr'.

This why usually it have sense to setup Cyrillic on console at
run-time only if no local X server is started.  The file
/etc/console-tools/default.kmap.gz is the loaded at run-time keyboard
mapping.  For example after the command

zcat -9 /usr/share/console-cyrillic/ru-koi8-r.kmap >/etc/console-tools/default.kmap.gz

the system will load Russian keyboard for KOI8-R at each bootup.

The file /etc/console-tools/config tells what fonts to load at boot
time.  For example add the following two lines in it:

SCREEN_FONT=/usr/share/console-cyrillic/UniCyr_8x16.psf
APP_CHARSET_MAP=/usr/share/console-cyrillic/koi8-r.acm.gz

and then the font UniCyr_8x16.psf will be loaded for working in
KOI8-R.

Ofcource in these examples you can use any other keyboard mapping,
font and application charmap instead of ru-koi8-r.kmap,
UniCyr_8x16.psf and koi8-r.acm.gz.  The data-files of the package
console-tools-cyrillic are installed in the directory
/usr/share/console-cyrillic.

The files *.kmap are keyboard maps.  The file cyrillic.fallback.gz is
a SFM fallback table that gives approximations of some symbols and
letters in the Cyrillic encodings with other symbols and letters.  The
file cyrillic-graph.fallback.gz gives approximations also for the
pseudographic symbols.  All other data files are explained in the
files README and README.ru


	 ---------------------------------------------------
	 ---------------------------------------------------
		   CYRILLIC IN X WINDOW FOR DEBIAN
	 ---------------------------------------------------
	 ---------------------------------------------------


			 1. THE SCRIPT `XCYR'

The package x-cyrillic gives you environment for language and encoding
independent working with Cyrillic in X Window.

Suppose you want to work with CP1251 and Byelarussian keyboard.  Then
put commands like these at the beginning of your ~/.xsession file:

LANG=by_BY.CP1251; export LANG
xcyr by basic grp:toggle

The parameters of the command `xcyr' are similar to those of the
command `setxkbmap'.  First argument is the keyboard layout and second
argument is variant of this layout.  Currently supported are:

	layout 'bg'   with variants `bds', `phonetic' and `traditional';
	layout `by'   with variants 'basic' and `winkeys';
	layout 'byru' with variants `basic' and `winkeys';
	layout `ru'   with variants `basic' and `winkeys'.

[Новая версия, где имеются также и сербская и македонская клавиатура 
находится на этапе "тестовых испытаний".]

The third argument is the `option' to the keyboard.  Currently
supported are:

	option `grp:switch'
The right Alt key temporary chooses Cyrillic.

	option `grp:toggle'
The right Alt key switches between Cyrillic and Latin.

	option `grp:shift_toggle'
Pressing both Shift keys together switches between Cyrillic and
Latin.

	option `grp:ctrl_shift_toggle)'
Pressing Control and Shift keys together switches between Cyrillic and
Latin.

	option `grp:caps_toggle)'
Caps Lock switches between Cyrillic and Latin, Shift + Caps Lock
toggles caps lock.

	option `grp:ctrl_alt_toggle'
Pressing Control and Alt keys together switches between Cyrillic and
Latin.

The script `xcyr' tries to guess your working encoding from the name
of the active locale.  You can override this by the option -e:

xcyr -e koi8-r ru basic grp:toggle

This command chooses working with KOI8-R regardless of the active
locale.


		    2. PROBLEMS WITH SOME PROGRAMS

Sometimes it is impossible to customise a program to use Cyrillic
fonts.  To easier the problem the script `xcyr' makes Cyrillic aliases
that claim to be ISO-8859-1 fonts.

The aliases with font family `hylvetica' correspond to the font family
`helvetica'.  So if some program will not use Cyrillic fonts, make it
to use the font `hylvetica' instead of `helvetica'.  Similarly `tymes'
corresponds to `times', `cyrier' to `courier', `lucyda' to `lucida',
etc.

If you don't like these aliases start `xcyr' with the option -x or
--no-hack.

It is possible to exclude completely Latin fonts from the font path and
use aliases of Cyrillic fonts that mimic to be the standard Latin
fonts.  This is made by the script `cyrhack'.  The command

cyrhack on

excludes Latin fonts from the font path.  The command

cyrhack off

returns them back to the font path.  If you use this command it is
recommended to invoke it as early as possible, but after the command
`xcyr'.  The command `cyrhack' accepts the option -e too:

cyrhack -e koi8-r on

This excludes standard Latin fonts from the font path and makes all
programs to use KOI8-R fonts regardless of the current active locale.


		     3. FONT COLLECTIONS PROVIDED

The following packages contain Cyrillic fonts that `xcyr' and
`cyrhack' can use:

xfonts-bolkhov-cp1251, xfonts-cronyx-cp1251, xfonts-edict-cp1251;
xfonts-bolkhov-iso,    xfonts-cronyx-iso,    xfonts-edict-iso;
xfonts-bolkhov-koi8r,  xfonts-cronyx-koi8r,  xfonts-edict-koi8r;
xfonts-bolkhov-koi8u,  xfonts-cronyx-koi8u,  xfonts-edict-koi8u.

[Замечание: Имеются некоторые возражения к лизензионной чистоте шрифтов
edict.]

It is recommended to install at least one package with KOI8-R fonts
because Netscape uses them.  Similarly install at least one package
with ISO-8859-5 fonts because Emacs-mule uses them.  If your encoding
is A install also the packages xfonts-bolkhov-A and xfonts-cronyx-A.
The first contains fonts of the highest quality and the second is the
only collection with 100dpi fonts.  And finally install any other font
packages you want.

[В новой версии уже не пишет, что шрифты для КОИ8-Р нужны.  Netscape 
работает лучше, если ему такие шрифты недоступны.]


		  4. DEFAULT CYRILLIC FOR ALL USERS

If you are system administrator you can setup default Cyrillic for all
users.  Basicly there are two things to do: to setup default font path
and to setup default keyboard.  This is configured in the file
/etc/X11/XF86Config.

The section `Files' in this file contains lines with the keyword
`FontPath'.  Before any other lines with this keyword put lines with
the directories containing fonts you want.  Let the fonts with the
default encoding be first and after them put lines for other fonts you
want.  The directories of the fonts are documented in the files
/usr/share/doc/xfonts-...-.../README.Debian.

As for example suppose you want to setup KOI8-U as default encoding.
You install the packages xfonts-bolkhov-koi8u, xfonts-cronyx-koi8u,
xfonts-bolkhov-koi8r and xfonts-bolkhov-iso and put the following
lines at the beginning of the section `Files':

FontPath "/usr/X11R6/lib/X11/fonts/bolkhov/koi8-u/75dpi"
FontPath "/usr/X11R6/lib/X11/fonts/cronyx/koi8-u/100dpi"
FontPath "/usr/X11R6/lib/X11/fonts/bolkhov/koi8-u/misc"
FontPath "/usr/X11R6/lib/X11/fonts/bolkhov/koi8-r/75dpi"
FontPath "/usr/X11R6/lib/X11/fonts/bolkhov/koi8-r/misc"
FontPath "/usr/X11R6/lib/X11/fonts/bolkhov/iso-8859-5/75dpi"
FontPath "/usr/X11R6/lib/X11/fonts/bolkhov/iso-8859-5/misc"

[Сдесь нужно убрать строки о КОИ8-Р.  Netscape глупо отдает 
предпочтение им вместо шрифтов для ISO-8859-5, поэтому когда КОИ8-Р 
помещен в FontPath, Netscape неспособен изображать не-русские буквы.]

If you want the aliases `hylvetica', `tymes', `cyrier', etc. put also
this line:

FontPath "/usr/X11R6/lib/X11/fonts/cyrhack/default.koi8-u"

The default X keyboard is configured in the section `Keyboard' of the
file /etc/X11/XF86Config.  If you use Russian keyboard this section
may look like this:

Section "Keyboard"
	Protocol "Standard"
	XkbLayout "ru"
	XkbVariant "winkeys"
	XkbOptions "grp:toggle"
EndSection

REMARK.  Currently X Window doesn't support working with CP1251.
Because of that if you work with that encoding you should use

	XkbLayout "ru1251"

in /etc/X11/XF86Config instead of

	XkbLayout "ru"


--
Anton Zinoviev <anton@lml.bas.bg>, <zinoviev@fmi.uni-sofia.bg>