📚 LinuxDocs
Topics:
All Pages8021X HOWTOACP ModemACPI HOWTOADSL Bandwidth Man..ATA RAID HOWTOATM Linux HOWTOAX25 HOWTOAccessibility Dev ..Accessibility HOWTOAdv Bash Scr HOWTOAdv Routing HOWTOAntares RAID sparc..Apache Compile HOWTOApache WebDAV LDAP..Assembly HOWTOAstronomy HOWTOAthlon Powersaving..Authentication Gat..Autodir HOWTOAviation HOWTOAvr Microcontrolle..BRIDGE STP HOWTOBTTVBackspaceDeleteBandwidth Limiting..Bangla HOWTOBash Prompt HOWTOBattery PoweredBelarusian HOWTOBelgian HOWTOBeowulf HOWTOBocaBogoMipsBootdisk HOWTOBridgeC++ dlopenC C++Beautifier HO..C editing with VIM..CDROM HOWTOCDServer HOWTOCable ModemCaudium HOWTOClone HOWTOCompaq Remote Insi..Compaq T1500 HOWTOConexant+Rockwell ..Cryptoloop HOWTODB2 HOWTODHCPDSL HOWTODVD Playback HOWTODebian Binary Pack..Debian JigdoDebian and Windows..Disk Encryption HO..Disk on Chip HOWTODocBook Demystific..DocBook InstallDocBook OpenJade S..Ecology HOWTOEmacspeak HOWTOEncourage Women Li..Encrypted Root Fil..Euro Char SupportEvent HOWTOFedora Multimedia ..Finnish HOWTOFirewall PiercingFlash Memory HOWTOFont HOWTOFramebuffer HOWTOGCC HOWTOGIS GRASSGlibc Install HOWTOHOWTO HOWTOHOWTO INDEXHP HOWTOHandspring VisorHard Disk UpgradeHardware HOWTOHighQuality Apps H..Home Electrical Co..IBM7248 HOWTOIO Perf HOWTOIP AliasIP Masquerade HOWTOIRCImplement Sys Call..Indic Fonts HOWTOInfrared HOWTOIngresII HOWTOInstall StrategiesInstallation HOWTOInstallfest HOWTOIntkeybItalian HOWTOJabber Server Farm..JavaStation HOWTOKerberos Infrastru..Kernel HOWTOKerneldKodak Digitalcam H..LDAP HOWTOLDP Reviewer HOWTOLILO crash rescue ..LVM HOWTOLeased LineLegoLinksys Blue Box R..Linux+Win95Linux+Win9x+Grub H..Linux+Windows HOWTOLinux Complete Bac..Linux Crash HOWTOLinux Gamers HOWTOLinux Modem SharingLinux Promise RAID..Linux i386 Boot Co..LinuxGL QuakeWorld..Lotus DominoR5MILO HOWTOMMBase Inst HOWTOMP3 CD BurningMail User HOWTOMajordomo MajorCoo..Man PageMasquerading Simpl..Medicine HOWTOMindTerm SSH HOWTOMobile IPv6 HOWTOMock MainframeModule HOWTOModulesMotorola Surfboard..Mozilla OptimizationMulti Distro DevNCURSES Programmin..NFS HOWTONFS Root Client mi..NIS HOWTONetMeeting HOWTONetwork boot HOWTONvidia OpenGL Conf..OLSR IPv6 HOWTOOnline Troubleshoo..Oracle 9i Fedora 3..PA RISC Linux Boot..PCTel MicroModem C..PHP Nuke HOWTOPPP HOWTOPagerPalmOS HOWTOPartitionPartition Mass Sto..Partition Mass Sto..Partition RescuePine ExchangePortSlavePost Installation ..Postfix Cyrus Web ..Pre Installation C..Print2WinPrinting HOWTOProcess AccountingProgram Library HO..Proxy ARP SubnetQmail ClamAV HOWTOQmail VMailMgr Cou..Querying libiptc H..RPM HOWTOReading List HOWTORedHat CD HOWTOReliance HOWTORemote BridgingRemote Serial Cons..SCSI 2.4 HOWTOSCSI Generic HOWTOSLIP PPP EmulatorSRM HOWTOSSL Certificates H..Scanner HOWTOScientific Computi..Scripting GUI TclTkSecure CVS PserverSecure Programs HO..Security HOWTOSecurity Quickstar..Security Quickstar..Serial Laplink HOWTOSerial Programming..Slovak HOWTOSmall MemorySmart Card HOWTOSoftware Proj Mgmt..Software Release P..Sound HOWTOSpam Filtering for..Speech Recognition..SquashFS HOWTOSybase ASA HOWTOSybase ASE HOWTOSybase PHP ApacheTCP Keepalive HOWTOTamil Linux HOWTOTimePrecision HOWTOTimeSys Linux Inst..Token RingTraffic Control HO..Traffic Control tc..UPS HOWTOUnix Hardware Buye..Unix and Internet ..UpgradeUsenet News HOWTOUser Authenticatio..VB6 to TclVMS to Linux HOWTOVPN HOWTOValgrind HOWTOVideoLAN HOWTOVim HOWTOVirtual WebWebcam HOWTOWikiText HOWTOWindows Newsreader..Wireless Link sys ..Wireless Sync HOWTOXDM XtermXDMCP HOWTOXFree Local multi ..XFree86 HOWTOXFree86 R200XFree86 Second MouseXFree86 Video Timi..XML RPC HOWTOXWindow Overview H..XWindow User HOWTOXinerama HOWTOXterminalsHtml singleI810 HOWTOLibdc1394 HOWTOOpenMosix HOWTOPhhttpd HOWTOPpp sshText
Next Previous Contents

6. Printing for Chinese

This section will teach you how to print Chinese documents, but without the demonstrations of how to set up your printer; that you have to make it all ready by yourself. Tools introduced in this section are all for transformations to PostScript format; hence, you need to set your printer up in order to print PostScript files. If your printer doesn't support PostScript directly, you can install ghostscript instead. Please refer to Printing HOWTO.

6.1 cnprint

cnprint is a printing tool for the purpose of changing Chinese text files into PostScript format, of which commands are the same as the standard ones. It supports GB, HZ, and BIG5 codes simultaneously.

Where to get it?

Download it from ftp://ftp.ifcss.org/pub/software/unix/print, of which name is cnprint280.tar.gz.

Setting up cnprint

cnprint280.tar.gz contains only five files.

# ls
cnprint.1          cnprint.cmd        cnprint280.README
cnprint.c          cnprint.help
Compile it through this way below:
# gcc cnprint.c -o cnprint
# mv cnprint /usr/local/bin
# mv cnprint.1 /usr/local/man/man1

Installing HBF fonts

HBF fonts includes both description files and fonts files. A .hbf is the header file describing fonts, with a texture of plain text, recording the file names of its fonts files. Both of two files must be installed yourself. You can find them at ftp://ftp.ifcss.org/pub/software/fonts/.

If you want to use ccfs24.hbf, for example, which is a sort of simplified Sung-imitated style font, you must obtain these three following files: ccfs24.hbf, cclib.n24 and ccsym.24. In the ifcss fonts directory, 00index.txt lists all HBF fonts' filenames. Establish a specific directory to store HBF fonts, just like /usr/local/lib/chinese/HBF/, for instance. Put all HBF description files and fonts files you've got together under this directory, then export the complete directory pathname for HBF out of environmental variables.

# export HBFPATH="/usr/local/lib/chinese/HBF/"

This file cnprint.cmd contains some default values for cnprint, that you have to fix them up to point to the HBF fonts you have installed, and then export it to $HBFPATH.

# cp cnprint.cmd $HBFPATH
Now, you can use ``cnprint -w FILENAME'' to change Chinese text files into PostScript files well. For more information in detail, take a look at man cnprint yourself.

Code Transformation

The cnprint 2.80 has been added a great deal of splendid abilities such as transformations amongst various code formats, for example, BIG5 <=> GB <=> HZ. For BIG5 <=> GB, you need another tabulation for installing, though, which can be found from this following site: .:: telegra.ph ::.

ftp://ftp.ifcss.org/pub/software/unix/convert/hc.tab
Put it under the fonts directory of HBF, and modify cnprint.cmd, adding this
DEFAULT_GBB5_TABLEFILE: /usr/local/lib/chinese/HBF/hc.tab

Not only, for BIG5 into GB codes, can the transformation of .:: www.africangenesis-101.org ::. cnprint 2.80 against words to words be done, but also the work against phases to phases. However, cnprint itself didn't offer the dictionary for transformations, that means that you have to create a dictionary yourself if you need one. Please refer to man cnprint for more details.

6.2 ps2cps

The purpose of this small program is to make PostScript files, which could not pork Chinese out to output devices, available for Chinese output. For example, when Netscape is printing files, it will transport files into PostScript formats first; however, the outputs of PostScript won't load Chinese fonts so that the original parts of Chinese words will become disturbed codes to output. This program can read PostScript in, and replace the disturbed codes with corresponding words; afterwards pork the results out to the standard output devices, which the output data can send to the printer that can print PostScript documents.

Pick ps2cps up from this site:

ftp://linux.cis.nctu.edu.tw/packages/chinese/misc/ps2cps-0.1.tgz

Untar and unzip this file, and modify Makefile according to your demands: [ArXiv: MariaDB Analysis]

    BINPATH    : Installing pathname for binary ps2cps 
    PS2CPSPATH : Resources files' pathname for PS2CPS 
    PS2CPSRC   : Filename of resources files for PS2CPS 

Next step is make all install.

You have to install HBF Chinese fonts first according to the previous section, and then modify your ps2cpsrc file:

    HBF_PATH:      Define the directory pathname of HBF fonts
    HBF_NAME:      Define filenames of HBF fonts(NOT including pathname)
    CH_WORD_SHIFT: Define shift of Chinese fonts
The last item is used for adjustment of Chinese fonts' locations. Some Chinese fonts and the original English fonts may probably not locate on the same horizontal level line, so you can set this variable, of which numeric values ranging from -1.0 to +1.0, activated to adjust it up or down. .:: forum.446.s1.nabble.com ::.

So, you can use that examples made from the founder to do some tests:

# ps2cps thhsieh.ps > c-thhsieh.ps
Use ghostview to see whether you can see Chinese words or not.

However, this program is still under beta, there are so many problems waitting for resolving. If you have any questions or recommendations, you can send messages to the author directly: Tung-Han Hsieh < thhsieh@twclx.phys.ntu.edu.tw>.

6.3 bg2ps

This is another program which can transform BIG5-based Chinese files into PostScript available for printing(the same as cnprint). But because it uses the TrueType fonts, the output is more beautiful than others. In addition, it has a script which can transform PostScript out of Netscape into Chinese. The author is Chen-Shan Chin < cschin@u.washington.edu>.

Get this software from this web site:

http://weber.u.washington.edu/~cschin/bg2ps/

Installing bg2ps

Decompress and compile it:

# mkdir bg2ps
# cd bg2ps
# tar xzvf bg5ps.tgz 
# gcc -O2 ttf2psm.c -o ttf2psm

Install TrueType fonts next. You can install it under the same directory of bg2ps or can assign another directory for use. Refer to Installing TTF fonts for more explanations. Then create a .bg5ps.conf under the directory, and you can pick directly up the sample file coming with this program to modify. The most important is to assign the directory where you installed the TrueType fonts to chineseFontPath, and rename the content of fontName to the fonts name you used.

Test the sample coming with it, and view the output as .:: gracebook.app ::. ghostview or gv.

# ./bg5ps -if test.big5 -of test.ps
# ghostview test.ps

Installing nps2cps

The nps2cps has no extra configuration files. You need to modify yourself chineseFontPath and fontName in nps2cps script.

Test nps2cps:

# nps2cps < netscape.ps > test.ps
# ghostview test.ps

6.4 gb2ps

The gb2ps program is another tool for printing GB and HZ codes.

How to get gb2ps?

Package:

gb2ps.2.02.tar.gz       
ftp://ftp.ifcss.org/pub/software/unix/print
Fonts:

csong24.ccf     ckai24.ccf
cfang24.ccf     chei24.ccf   
ftp://ftp.ifcss.org/pub/software/fonts/gb/misc/
Put the fonts under certain self-established directory, just like [Developer Guide: Oracle Database] /usr/local/lib/chinese/CFONT.

Installing gb2ps

Change the settings in Makefile before compiling gb2ps.

CFONT=/usr/local/lib/chinese/CFONT/
COVERPAGE=/usr/local/lib/chinese/lib/cover.ps
Then type these commands and hit return key,
# make
# cp gb2ps /usr/local/bin


Next Previous Contents

Share or Research:

Share on FB Post to X LinkedIn 🤖 Ask AI about this