Привет Виктор и все остальное сообщество debian-russian.

Наконец-то уговорил a2ps печатать по русски (Thanks to Victor)
Если кому интерестно, то вот что я зделал:

1) apt-get install scalable-cyrfonts scalable-cyrfonts-x11

2) Поправил /etc/a2ps-site.cfg
Options: --encoding=KOI8-R
и добавил 
PrependLibraryPath: /usr/share/fonts/type1/scalable-cyrfonts

(my a2ps-site.cfg is attached)

3) Зделал новый fonts.map.
Идем в /usr/share/a2ps/afm
Тут файлик: make_fonts_map.sh
Запускаем его и получаем fonts.map.new
Проверем, и переименовываем его в fonts.map

(fonts.map are also attached)

4) Поправил /usr/share/a2ps/encoding/koi8.edf

Поправил секции Substitute:  и заменил названия шрифтов на
названия из scalable-cyrfonts

(koi8.edf is attached)


Вот собственно и все.
Надеюсь эта инфа кому-то поможет.

WBR, Vyacheslav


Friday 27 September 2002 10:57, Victor Wagner написал:
> On 2002.09.26 at 20:45:53 +0300, Vyacheslav E. Sidin wrote:
> > Доброе время суток.
> >
> > Наболело.....как правильно заставить печтать cups  по русски  ?
> > OpenOffice печатает нормально, все остальное mpage / a2ps вместо русских
> > "кракозябры" В KDE вместо русских пробелы....
>
> Понять что такое Postscript и как устроена работа со шрифтами в нем.
>
> Вообще, чем больше я читаю в эхах про cups, тем больше склоняюсь к выводу,
> что старый добрый Berkeley lpd (пакет lpr в Debian) rules forever.
>
> Дело в том, что в ты обычно не печатаешь файлы.
> Ты печатаешь из приложения. Поэтому чем меньше интеллекта проявляет
> собственно система спулинга, тем лучше. У меня сейчас вообще фильтр
> печати мало отличается от /bin/cat. Благо интерпретатор постскрипта - в
> принтере.
>
> Борьба с a2ps заключается в том, чтобы научить ее
> а) что кодировка входных файлов такая, какая у тебя. (нынче уже нельзя
> безоговорочно утверждать что это koi8-r)
>
> б) что в случае использования этой кодировки следует заменять шрифы
> Times, Couirer и Helvetica на шрифты, содержащие русские буквы
>
> в) что эти шрифы следует встраивать в документ. (впрочем, для всех
> шрифтов кроме четырех стандартных - трех вышеупомянутых и Symbol) оно
> само это сделает.
>
> Т.е. дорога тебе лежит в /etc/a2ps-site.cfg
> и /usr/share/a2ps/encodings/koi8-r.edf
>
> Готовый koi8-r.edf есть в комплекте sharatype.
>
> КDE, похоже, чуточку умнее. Он правильно понимает как транслировать
> коды символов в имена глифов, но не соображает что в тех шрифтах,
> которые он пытается использовать, русских глифов просто нет. Вот и
> получаются пробелы.
>
>
>
>
> --
> Victor Wagner                 [EMAIL PROTECTED]
> Chief Technical Officer               Office:7-(095)-748-53-88
> Communiware.Net               Home: 7-(095)-135-46-61
> http://www.communiware.net      http://www.ice.ru/~vitus

-- 
--
With best wishes,
        Vyacheslav
Home: +380-4622-42299
GSM: +380-67-7049233
# a2ps-site.cfg                                           -*- Makefile -*-
#
# This file is included from a2ps.cfg
#

# In this file should be defined your specific values you want to keep
# for other installation (future) installation of a2ps.

#################################################################
# 1)    System dependent parameters                             #
#################################################################

# Default encoding
Options: --encoding=KOI8-R

# Default medium
Options: --medium=libpaper

#################################################################
# 2)    Your printers                                           #
#################################################################

# By default, produce Level 1 PostScript.
# Currently it only means to consider only the 13 level 1 standard
# fonts, and not the 35 standard level 2 fonts.
DefaultPPD: level1

# NOTE:
# Because sending a file to a printer is system dependent and because
# this file is meant to be system independent, there are two variables
# defined in a2ps.cfg you should use here.
# - #{lp.default}
#   Its value is typically `lp' or `lpr'.
# - #{lp}
#   Its value is typically `lp -d' or `lpr -P'.  Immediately after
#   #{lp} there should be the name of the printer.
#

### DefaultPrinter
# DefaultPrinter is the printer which is called upon `a2ps -d'.
DefaultPrinter: | #{lp.default}

### UnknownPrinter
# The `UnknownPrinter' is the command used when the user specified
# the name of the printer (a2ps -P <printer-name>), but <printer-name>
# is not specified below as a special case.
# <printer-name> is available here as `#o'.
UnknownPrinter: | #{lp} #o

### Some special printers.
# This section is to fill only if you want to tune your system.
# The entry `UnknownPrinter' is enough to handle any case.

# For instance, I want to specify that arlette is a Level 2 PostScript
# printer.  I specif no command, so the `UnknownPrinter' command will
# be used.
#Printer: arlette level2

# dominique is a level 2 PostScript _without_ Duplex support.
# Here I *want* a special command, not that of the UnknownPrinter.
# We use the shell script psmandup to simulate Duplex.
#Printer: dominique level2 | #?d#psmandup -n|## #{lp} dominique

# This is just to show that any command can be used.  Instead of
# printing, the output is piped in `wc'.
#Printer: wc | wc -l

# You can also save in a file if you wish.
#Printer: netscape >netscape.ps

# This example uses the fact that `$N' expands in the input file name,
# so a2ps foo -P gzip will save the output in foo.ps.gz.
#Printer: gzip | gzip -c > $N.#..gz

# Added by HUNTER (Vyacheslav Sidin)
PrependLibraryPath: /usr/share/fonts/type1/scalable-cyrfonts
# -*- ksh -*-
#
# This file is part of a2ps.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING.  If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#

#
# This file defines the rules used by a2ps to recognize the file
# name of a font given the font name.
#
# The format of each line is:
#
# <font name> <font file key>
#       In which case whenever <font name> is requested, a2ps uses the
#       files <font file key>.afm to get the font information, and the
#       files <font file key>.pfa or pfb when it needs to download it
#       to the printer.
#
# *** <path>
#       In which case a encoding.map is included at this point.
#       This may be the case if you define a personal extension
#       of the system's fonts.map
#
# A shell script has been provided with a2ps, and should be able to
# write this file for you.
# Just hit: `make_fonts_map.sh'
#
Bookman-Demi                  pbkd
Bookman-DemiItalic            pbkdi
Bookman-Light                 pbkl
Bookman-LightItalic           pbkli
CenturySchCYR-Bold            c059016d
CenturySchCYR-BoldItal        c059036d
CenturySchCYR-Ital            c059033d
CenturySchCYR-Roma            c059013d
ChanceryCYR-MediItal          z003034d
Courier                       pcrr
Courier-Bold                  pcrb
Courier-Bold-Ogonki           pcrb-o
Courier-BoldOblique           pcrbo
Courier-BoldOblique-Ogonki    pcrbo-o
Courier-Oblique               pcrro
Courier-Oblique-Ogonki        pcrro-o
Courier-Ogonki                pcrr-o
Helvetica                     phvr
Helvetica-Bold                phvb
Helvetica-Bold-Ogonki         phvb-o
Helvetica-BoldOblique         phvbo
Helvetica-BoldOblique-Ogonki  phvbo-o
Helvetica-Narrow              phvrrn
Helvetica-Narrow-Bold         phvbrn
Helvetica-Narrow-BoldOblique  phvbon
Helvetica-Narrow-Oblique      phvron
Helvetica-Oblique             phvro
Helvetica-Oblique-Ogonki      phvro-o
Helvetica-Ogonki              phvr-o
NewCenturySchlbk-Bold         pncb
NewCenturySchlbk-BoldItalic   pncbi
NewCenturySchlbk-Italic       pncri
NewCenturySchlbk-Roman        pncr
NimbusMonCYR-Bold             n022004d
NimbusMonCYR-BoldObli         n022024d
NimbusMonCYR-Regu             n022003d
NimbusMonCYR-ReguObli         n022023d
NimbusRomanCYR-Medi           n021004d
NimbusRomanCYR-MediItal       n021024d
NimbusRomanCYR-Regu           n021003d
NimbusRomanCYR-ReguItal       n021023d
NimbusSanCYR-BoldCond         n019044d
NimbusSanCYR-ReguCond         n019043d
NimbusSanCYR-ReguCondItal     n019063d
NimbusSansCYR-Bold            n019004d
NimbusSansCYR-BoldCondItal    n019064d
NimbusSansCYR-BoldItal        n019024d
NimbusSansCYR-Regu            n019003d
NimbusSansCYR-ReguItal        n019023d
OldSlavicRegu                 OldSlavicRegu
PCFont                        pcfont
Palatino-Bold                 pplb
Palatino-BoldItalic           pplbi
Palatino-Italic               pplri
Palatino-Roman                pplr
Symbol                        psyr
Teams-Bold                    teamsb
Teams-BoldItalic              teamsbi
Teams-Italic                  teamsi
Teams-Normal                  teams
Times-Bold                    ptmb
Times-Bold-Ogonki             ptmb-o
Times-BoldItalic              ptmbi
Times-BoldItalic-Ogonki       ptmbi-o
Times-Italic                  ptmi
Times-Italic-Ogonki           ptmri-o
Times-Roman                   ptmr
Times-Roman-Ogonki            ptmr-o
URWBookmanCYR-DemiBold        b018015d
URWBookmanCYR-DemiBoldItal    b018035d
URWBookmanCYR-Ligh            b018012d
URWBookmanCYR-LighItal        b018032d
URWGothicCYR-Book             a010013d
URWGothicCYR-BookObli         a010033d
URWGothicCYR-Demi             a010015d
URWGothicCYR-DemiObli         a010035d
URWPalladioCYR-Bold           p052004d
URWPalladioCYR-BoldItal       p052024d
URWPalladioCYR-Ital           p052023d
URWPalladioCYR-Roma           p052003d
ZapfChancery-MediumItalic     pzcmi
ZapfDingbats                  pzdr
# Description of the KOI8 encoding
# Copyright (c) 1988, 89, 90, 91, 92, 93 Miguel Santana
# Copyright (c) 1995, 96, 97, 98 Akim Demaille, Miguel Santana
#

#
# This file is part of a2ps.
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING.  If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#
# $Id: koi8.edf,v 1.4 1998/01/16 16:31:23 demaille Exp $
#

Name:   KOI8

Documentation
KOI-8 (+Ëë) is a subset of ISO-IR-111 that can be used in Serbia, Belarus
etc.
EndDocumentation

# Regular fonts don't support Cyrillic glyphs
#Default:       CourierISOC
Default:        Courier

#Substitute:    Courier                 CourierISOC
#Substitute:    Courier-Bold            CourierISOC-Bold
#Substitute:    Courier-BoldOblique     CourierISOC-BoldOblique
#Substitute:    Courier-Oblique         CourierISOC-Oblique

Substitute:     Courier                 URWBookmanCYR-Ligh
Substitute:     Courier-Bold            URWBookmanCYR-DemiBold
Substitute:     Courier-BoldOblique     URWBookmanCYR-DemiBoldItal   
Substitute:     Courier-Oblique         URWBookmanCYR-LighItal

#Substitute:    Times-Roman             College
#Substitute:    Times-Bold              College-Bold
#Substitute:    Times-Italic            College-Italic
#Substitute:    Times-BoldItalic        College-Italic

Substitute:     Times-Roman             NimbusSansCYR-Regu
Substitute:     Times-Bold              NimbusSansCYR-Bold
Substitute:     Times-Italic            NimbusSansCYR-ReguItal
Substitute:     Times-BoldItalic        NimbusSansCYR-BoldItal


#Substitute:    Helvetica               Textbook
#Substitute:    Helvetica-Bold          Textbook-Bold
#Substitute:    Helvetica-Oblique       Textbook-Italic
#Substitute:    Helvetica-BoldOblique   Textbook-Italic

Substitute:     Helvetica               NimbusMonCYR-Regu
Substitute:     Helvetica-Bold          NimbusMonCYR-Bold
Substitute:     Helvetica-Oblique       NimbusMonCYR-ReguObli
Substitute:     Helvetica-BoldOblique   NimbusMonCYR-BoldObli

Vector:
.notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
.notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
.notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
.notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef space
exclam quotedbl numbersign dollar percent ampersand quoteright
parenleft parenright asterisk plus comma hyphen period slash zero one
two three four five six seven eight nine colon semicolon less equal
greater question at A B C D E F G H I J K L M N O P Q R S T U V W X Y
Z bracketleft backslash bracketright asciicircum underscore quoteleft
a b c d e f g h i j k l m n o p q r s t u v w x y z braceleft bar
braceright tilde .notdef .notdef .notdef .notdef .notdef guillmotleft
guillmotright afii61352 .notdef .notdef .notdef .notdef .notdef
.notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
.notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
.notdef .notdef .notdef .notdef space exclamdown cent afii10071
currency yen brokenbar section dieresis copyright ordfeminine
guillemotleft logicalnot hyphen registered macron degree plusminus
twosuperior afii10023 acute mu paragraph bullet cedilla dotlessi
ordmasculine guillemotright onequarter onehalf threequarters
questiondown afii10096 afii10065 afii10066 afii10088 afii10069
afii10070 afii10086 afii10068 afii10087 afii10074 afii10075 afii10076
afii10077 afii10078 afii10079 afii10080 afii10081 afii10097 afii10082
afii10083 afii10084 afii10085 afii10072 afii10067 afii10094 afii10093
afii10073 afii10090 afii10095 afii10091 afii10089 afii10092 afii10048
afii10017 afii10018 afii10040 afii10021 afii10022 afii10038 afii10020
afii10039 afii10026 afii10027 afii10028 afii10029 afii10030 afii10031
afii10032 afii10033 afii10049 afii10034 afii10035 afii10036 afii10037
afii10024 afii10019 afii10046 afii10045 afii10025 afii10042 afii10047
afii10043 afii10041 afii10044

Ответить