Previous Next Contents

7. Print setup

Printing is always tricky. Printers have different control languages and often they have very different views on foreign language support. The good news is that on control language seems to be recognized as a de-facto standard for print job description - it is a PostScript language developed by Adobe Corporation.

Another problem is a variety of requirements to the print services. For example, sometimes you want just to print a piece if C program, containing comments in Russian, so you don't need any pretty-printing - just a raw ASCII output in a single font. Another time, you need to typeset some document with different fonts etc. This will definitely require more effort to setup Cyrillic support.

To accomplish the former task you just have to make your printer understand one Cyrillic font and (maybe) install some filter program to generate data in appropriate format. To accomplish the latter one, you have to teach your printer different fonts and have a special software.

There is also something in the middle, when you get a program which knows how to generate both the fonts and the appropriate printer input, so you can say do some aource code pretty-printing without sophisticated word processing systems.

All these options will be more or less covered below.

7.1 Printing only raw text

If all you need is to print a raw KOI-8 text, try the following:

  1. Find a proper KOI-8 font for your printer.
  2. Learn from the manual, how to load such font into your printer and, probably, write a simple program doing that.
  3. Run this program from the appropriate rc file at a boot time.

Thus, having Cyrillic characters in the upper part of the printer's character set will allow you to print you texts in Russian without any hussle.

Alternatively to the KOI-8 fonts you may try to use the Alt font. There are two reasons for that:

However in this case, you'll have to convert your texts from KOI-8 to Alt before sending them to a printer. This is quite easy, since there are a lot of programs doing that (see translit for example), so you just have to call such program properly in the if field in /etc/printcap file. For example, with the translit program you may specify:

if=/usr/bin/translit -t koi8-alt.rus

See printcap(5) for details.

7.2 Printing with different fonts

One great way to cope with different printers and fonts is to use TeX. TeX drivers handle all details, so once you make TeX understand Cyrillic fonts, you are done.

Another possibility is to use PostScript. I decided to devote an entire chapter to the subject, since it is not simple.

Finally, there are other word processors, which have printer drivers. I never tried anything apart from TeX, so I cannot suggest anything.

7.3 Converting text to TeX

If all you need is just to print an ASCII text without any additional word processing, you may try to use some programs, which would convert your Cyrillic text to a ready-to-process TeX file. One of the best programs for such purposes is translit. In this case, you don't even have to bother about installing the Cyrillic fonts for TeX, since translit uses a Washington Cyrillic package, which is included in most TeX distributions (or am I wrong?)

7.4 Text to PostScript converters

Sometimes you have just a plain ASCII KOI-8 text and you want to print it just to get it on the paper. One of the easiest ways to achieve that is to use special programs converting text to PostScript.

There are a number of programs doing such conversion. I personally prefer a2ps. Originally developed as a simple text-to-PostScript converter it became a big and highly configurable program with many options and allows you to manage various page layouts, syntax highlighting etc. Another tool (now available as a part of the GNU project) is nenscript.

The main problem with such programs is that they know nothing about Cyrillic fonts. Right now I am investigating a possibility of including Cyrillic fonts in them in order to understand Cyrillic. Stay in touch.

Nevertheless all the blah-blah above would be pointless without any real advice. So, there we go.

If you don't care about the output quality and all you need is just Cyrillic on the paper, try the rtxt2ps package. It is a very simple no-frills text-to-PostScript conversion program. The output quality is not very good (or, to be honest, just bad) but it does it's job.

Another resort is a hacked version of a2ps. This one is quite old, so don't expect all new version's bells and whistles in it. But it prints Cyrillic text and the quality is sufficiently better than that of rtxt2ps. However, I experienced various kinds of problems with it - like I couldn't print more than two pages (???).


Previous Next Contents