newest version of chpfb 

ftp://ftp.ihep.ac.cn/pub/chinese/packages/chpfb-x.x.tar.gz

Description 

This package includes a set of Chinese PostScript fonts and some small utilities helping you generate Chinese PostScript files. It also includes some hints on establishing a printer queue that uses Ghostscript as the PostScript filter. After easy installation, you may get an Chinese-enabled Ghostscript through which you can view and print Chinese files.

Features 

/usr/bin/a2b5ps
/usr/bin/a2gbps
/usr/bin/b5pfb
/usr/bin/gbpfb
/usr/bin/jy2gbps
/usr/bin/mktlcpfb
/usr/bin/ns2b5ps
/usr/bin/ns2gbps
/usr/bin/t1asm
/usr/bin/ttf2pfb
/usr/bin/txt2b5ps
/usr/bin/txt2gbps

Examples 

Examples are under /usr/doc/chpfb-1.3.1/examples. They are actually .ps files. The .gps denote that it is a GB ps file; whereas .bps means that it is a big5 ps file.

All files are straight text files, i.e., if viewing using Ghostscript that does not yet support Chinese, the Chinese are just code. Viewing properly configured Ghostscript, they will be chinese.

gbk.gps a complete list of all characters in GB 13000-1993(GBK) character set, converted from a text file using 'txt2gbps'

big5.bps a complete list of all characters in BIG5 character set, converted from a text file using 'txt2b5ps'

demo.gps a demonstration of Chinese(GB) PostScript fonts

demo.bps a demonstration of Chinese(BIG5) PostScript fonts

Help 

to write PostScript files 

If you know something about PostScript language, you will find that using Chinese PostScript fonts is just like using ASCII PostScript fonts. Here is a small example:

      $ gs
      Aladdin Ghostscript 5.10 (1997-11-23)
      Copyright (C) 1997 Aladdin Enterprises, Menlo Park, CA.  All rights reserved
.
      This software comes with NO WARRANTY: see the file PUBLIC for details.
GS>/GB-Song-Regular 24 selectfont
Loading GB-Courier-Oblique font from /usr/share/ghostscript/fonts/GB-Courier-Oblique.ps... Loading NimbusMonL-ReguObli font from /usr/share/fonts/default/Type1/n022023l.pfb... 3843008 2230411 2241968 618538 0 done.
Loading GB-FangSong font from /usr/share/ghostscript/fonts/GB-FangSong.ps... 3843008 2233875 2784560 920153 0 done.
3843008 2233875 2784560 919802 0 done.
GS>100 600 moveto
GS>put some Chinese in here ____ show
Loading GB-Songcf font from /usr/share/ghostscript/fonts/gbsongcf.pfb... 3263656 1735110 2241968 671186 0 done.
Loading GB-Songcd font from /usr/share/ghostscript/fonts/gbsongcd.pfb...
...
Loading GB-Songc9 font from /usr/share/ghostscript/fonts/gbsongc9.pfb...
GS>/GB-Courier-Oblique 16 selectfont
Loading GB-Courier-Oblique font from /usr/share/ghostscript/fonts/GB-Courier-Oblique.ps... Loading NimbusMonL-ReguObli font from /usr/share/fonts/default/Type1/n022023l.pfb... 3843008 2230411 2241968 618538 0 done.
Loading GB-FangSong font from /usr/share/ghostscript/fonts/GB-FangSong.ps... 3843008 2233875 2784560 920153 0 done.
3843008 2233875 2784560 919802 0 done.
GS>100 130 moveto
GS>put more Chinese in here ____ show
Loading GB-FangSongd2 font from /usr/share/ghostscript/fonts/gbfsd2.pfb... 3943488 2332334 2784560 927668 0 done.
Using GB-Songd2 font for GB-FangSongd2.
Loading GB-FangSongbc font from /usr/share/ghostscript/fonts/gbfsbc.pfb... 40439
...
Loading GB-FangSongd6 font from /usr/share/ghostscript/fonts/gbfsd6.pfb... 4566464 2941041 2804656 890421 0 done.
Using GB-Songd6 font for GB-FangSongd6.
GS>300 100 moveto
GS>(\320\273)show <b4f3bcd2>show

In the string before "show" operator, you may use character codes (octal) or hexadecimal encoding of a Chinese character, as well as the character itself.

Chinese PostScript fonts support unconditionally mixed use of ASCII and Chinese characters. If you used Times-Roman before, you may now simply use GB-Times-Roman or BIG5-Times-Roman, just so so.

Fixed fonts are designed as such that the width of Chinese characters are exactly two times of the width of ASCII characters. So you may use them to keep regularity of ASCII and Chinese characters.

to view and print PostScript files containing Chinese saved by netscape 

The small shell scripts scripts/{ns2gbps, ns2b5ps} can be used to modify PostScript files containing Chinese characters saved by netscape and generate new Chinese PostScript files that can be viewed by Chinese-enabled Ghostscript. If you save a WWW page that contains Chinese GB characters to a file page.ps, you may use scripts/ns2gbps as this:

lark% ns2gbps page.ps > page.gps

The Chinese PostScript file page.gps can be viewed by Chinese-enabled Ghostscript.

If you use Ghostscript as input PostScript file filter of your printer, you can directly send the modified Chinese PostScript file to your printer:

lark% lpr page.gps
[Tip]

!!

mpage file.sample.cc.gb2312 | bg5ps -nps y > $tf.ps
gv -swap $tf.ps -scale 2

ok!

mpage file.sample.cc.gb2312 > $tf-1.ps
ns2gbps $tf-1.ps > $tf-2.ps
gv -swap $tf-2.ps -scale 2

to print plain Chinese text files 

The small shell scripts scripts/{txt2gbps,txt2b5ps} can be used to convert a plain Chinese text file to a Chinese PostScript file. By default, txt2gbps uses a fixed font GB-Song-Fixed, txt2b5ps uses a fixed font BIG5-Ming-Fixed, you may specify other font using "-fn" option, e.g.

lark% txt2gbps -fn GB-Kai-Fixed report.txt > report.gps

Note*: txt2gbps and txt2b5ps don't wrap long lines of texts. So if you have a text file whose paragraphs don't break into lines, you may have to wrap them yourself before you apply txt2gbps and txt2b5ps.

The small shell scripts scripts/{a2gbps, a2b5ps} uses the program 'a2ps' to convert plain text files to Chinese PostScript files. They accept all parameters of a2ps but redirects output to stdout, e.g.

lark% a2gbps -4 report.txt > report.gps

If you use Ghostscript as input PostScript file filter of your printer, you can directly send the Chinese PostScript file report.gps to your printer.

with CJK enhancement to LaTeX2e 

All 126 x 4 = 504 TFM files generated by 'gbpfb' are to be used as 'pmC' font encoding in your Chinese LaTeX files, e.g.,

\documentclass[12pt,a4paper]{article}
\usepackage{CJK}
\begin{document}
\begin{CJK*}[pmC]{GB}{song}
your Chinese document here......
\end{CJK*}
\end{document}

and use 'gbklatex' to process them, e.g.,

% gbklatex doc.tex                 # do not omit the extension .tex
% dvips doc

dvips will use 'gsftopk' to generate PK font files from Ghostscript's Chinese PFB files and produce a self-contained PostScript file. If you don't want to build Chinese fonts into the resulting PostScript files, you may use

% dvips -P CJK doc

which will produce a quite small Chinese PostScript file, but it requires every one who wants to read it to have Chinese-enabled Ghostscript.

Version 1.3 

Dependencies 

0a. Make sure Ghostscript has been installed on your system. You should also know the location of Ghostscript-related files. You may get this by using the command 'gs -help', the output should contain some lines like this:

Search path:
   . : /usr/local/share/ghostscript/5.10 :
   /usr/local/share/ghostscript/fonts
in this case, Ghostscript files are in /usr/local/share/ghostscript/ and
its sub-directories.

0b. The program ttf2pfb.c, which uses the freetype-1.1 library. Note*: Please do NOT use freetype-1.0 with this packages! ttf2pfb.c in this package is not compatible with freetype-1.0.

Installation 

rpmih chpfb-1.3.1-4.i386.rpm chpfb-fonts-1.0-1BP.noarch.rpm

Configuration & Twisting 

As shown below:

ln -s /usr/lib/chpfb/Fontmap.zh /usr/share/ghostscript/7.05/lib
echo '(Fontmap.zh) .runlibfile' >> /usr/share/ghostscript/7.05/lib/Fontmap

documented on: 2004.03.23