Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Linux Answers > Applications / GUI / Multimedia
User Name


By J_W at 2007-07-29 19:23
ESP Ghostscript 8.15.4 which comes with Slackware-12.0 supports CJK printing.
However, in order to enable printing Japanese documents, you need several additional setups.

A HOW-TO below assume that you are using "Sazanami TTF-font" as your Japanese font.

** ESP Ghostscript setup **
Step-1. create /usr/share/fonts/default directory
 # cd /usr/share/fonts
 # mkdir default
Step-2. create symbolic link TrueType to the directory in which sazanami-mincho.ttf
and sazanami-gothic.ttf are.
 # cd default
for example, if sazanami-mincho.ttf and sazanami-gothic.ttf are
in /usr/share/fonts/TrueType directory,
# ln -s ../TrueType TrueType
Then espgs can find sazanami-mincho.ttf and sazanami-gothic.ttf.

(memo) You can find sazanami TT-fonts here.

Step-3. edit cidfmap
Then move to /usr/share/ghostscript/8.15/lib directory, and edit cidfmap like below.
% $Id: cidfmap,v 1.7 2003/02/07 00:31:11 igor Exp $
% This is a sample map file for CIDFont category.

% The map is a set of records, which must use one of the two formats :
% 1. A substutution of a CIF font with another CID font :
% /substituted /original ;
% Where 'substituted' is a name being used in a document,
% 'original' is a name of an available resource.
% 2. A substutution of a CIF font with a True Type font :
% /substituted << /FileType /TrueType /Path (path) /SunfontID 1 /CSI [(ordering) supplement] >> ;
% Where 'substituted' is a name being used in a document,
% 'path' is a path to a True Type font file,
% 'ordering' is a value of Ordering required for CIDSystemInfo dictionary,
% 'supplement' is a value of Supplement required for CIDSystemInfo dictionary.
% Examples :
% /ShinGo-Bold /HeiseiKakuGo-W5 ;
% /Ryumin-Medium << /FileType /TrueType /Path (H:/AuxFiles/Fonts/BATANG.TTC) /SubfontID 3 /CSI [(Japan1) 2] >> ;
% cidfmap.ja
/Sazanami-Gothic << /FileType /TrueType /Path (sazanami-gothic.ttf) /CSI [(Japan1) 6] >> ;
/Sazanami-Gothic-Regular /Sazanami-Gothic ;
/Sazanami-Gothic-JaH << /FileType /TrueType /Path (sazanami-gothic.ttf) /CSI [(Japan2) 0] >> ;
/Sazanami-Gothic-Regular-JaH /Sazanami-Gothic-JaH ;
/Sazanami-Mincho << /FileType /TrueType /Path (sazanami-mincho.ttf) /CSI [(Japan1) 6] >> ;
/Sazanami-Mincho-Regular /Sazanami-Mincho ;
/Sazanami-Mincho-JaH << /FileType /TrueType /Path (sazanami-mincho.ttf) /CSI [(Japan2) 0] >> ;
/Sazanami-Mincho-Regular-JaH /Sazanami-Mincho-JaH ;
/Kochi-Gothic /Sazanami-Gothic ;
/Kochi-Mincho /Sazanami-Mincho
/Ryumin-Light /Sazanami-Mincho ;
/GothicBBB-Medium /Sazanami-Gothic ;
/Adobe-Japan1 /Sazanami-Gothic ;
/Adobe-Japan2 /Sazanami-Gothic-JaH ;

** Xpdf **
In order to display and print japanese PDF documents with Xpdf, follow these steps.

Step-1. install Japanese language support file
Download xpdf-japanese.tar.gz from Xpdf home page.
 # tar xzvf xpdf-japanese.tar.gz
 # mv xpdf-japanese /usr/share/xpdf/japanese
Step-2. create xpdfrc
In case of Sazanami TT-fonts, add entries below to your /etc/xpdfrc.
#----- begin Japanese support package
cidToUnicode Adobe-Japan1 /usr/share/xpdf/japanese/Adobe-Japan1.cidToUnicode
unicodeMap ISO-2022-JP /usr/share/xpdf/japanese/ISO-2022-JP.unicodeMap
unicodeMap EUC-JP /usr/share/xpdf/japanese/EUC-JP.unicodeMap
unicodeMap Shift-JIS /usr/share/xpdf/japanese/Shift-JIS.unicodeMap
cMapDir Adobe-Japan1 /usr/share/xpdf/japanese/CMap
toUnicodeDir /usr/share/xpdf/japanese/CMap
#displayCIDFontTT Adobe-Japan1 /usr/share/fonts/TrueType/kochi-mincho.ttf
#displayCIDFontTT Adobe-Japan1 /usr/share/fonts/TrueType/sazanami-mincho.ttf
### use Sazanami (Mincho) by default
displayCIDFontTT Adobe-Japan /usr/share/fonts/TrueType/sazanami-mincho.ttf
# use Kochi (Gothic) if gothic font is required
displayNamedCIDFontTT ShinGo-Bold /usr/share/fonts/TrueType/sazanami-gothic.ttf
displayNamedCIDFontTT ShinGo-regular /usr/share/fonts/TrueType/sazanami-gothic.ttf
displayNamedCIDFontTT MidashiGo-MB31 /usr/share/fonts/TrueType/sazanami-gothic.ttf
displayNamedCIDFontTT FutoGoB101-Bold /usr/share/fonts/TrueType/sazanami-gothic.ttf
displayNamedCIDFontTT HeiseiKakuGo-W5 /usr/share/fonts/TrueType/sazanami-gothic.ttf
displayNamedCIDFontTT HeiseiKakuGo-W9 /usr/share/fonts/TrueType/sazanami-gothic.ttf
displayNamedCIDFontTT HeiseiMaruGo-W4 /usr/share/fonts/TrueType/sazanami-gothic.ttf
displayNamedCIDFontTT MS-Gothic /usr/share/fonts/TrueType/sazanami-gothic.ttf
displayNamedCIDFontTT HG-GothicB /usr/share/fonts/TrueType/sazanami-gothic.ttf
displayNamedCIDFontTT Kochi-Gothic /usr/share/fonts/TrueType/sazanami-gothic.ttf
displayNamedCIDFontTT GothicBBB-Medium-H /usr/share/fonts/TrueType/sazanami-gothic.ttf
displayNamedCIDFontTT GothicBBB-Medium /usr/share/fonts/TrueType/sazanami-gothic.ttf
displayNamedCIDFontTT Ryumin-Light-H /usr/share/fonts/TrueType/sazanami-mincho.ttf
displayNamedCIDFontTT Ryumin-Light /usr/share/fonts/TrueType/sazanami-mincho.ttf

### make default font name to "Ryumin-Light" when converted to PostScript
psFont16 Adobe-Japan1 H Ryumin-Light-H ISO-2022-JP
psFont16 Adobe-Japan1 V Ryumin-Light-V ISO-2022-JP
# use "Gothic-BBB-Medium" if gothic font is required
psNamedFont16 MidashiGo-MB31 H GothicBBB-Medium-H ISO-2022-JP
psNamedFont16 MidashiGo-MB31 V GothicBBB-Medium-V ISO-2022-JP
psNamedFont16 FutoGoB101-Bold H GothicBBB-Medium-H ISO-2022-JP
psNamedFont16 FutoGoB101-Bold V GothicBBB-Medium-V ISO-2022-JP
psNamedFont16 HeiseiKakuGo-W5 H GothicBBB-Medium-H ISO-2022-JP
psNamedFont16 HeiseiKakuGo-W5 V GothicBBB-Medium-V ISO-2022-JP
psNamedFont16 HeiseiKakuGo-W9 H GothicBBB-Medium-H ISO-2022-JP
psNamedFont16 HeiseiKakuGo-W9 V GothicBBB-Medium-V ISO-2022-JP
psNamedFont16 HeiseiMaruGo-W4 H GothicBBB-Medium-H ISO-2022-JP
psNamedFont16 HeiseiMaruGo-W4 V GothicBBB-Medium-V ISO-2022-JP
psNamedFont16 MS-Gothic H GothicBBB-Medium-H ISO-2022-JP
psNamedFont16 MS-Gothic V GothicBBB-Medium-V ISO-2022-JP
psNamedFont16 HG-GothicB H GothicBBB-Medium-H ISO-2022-JP
psNamedFont16 HG-GothicB V GothicBBB-Medium-V ISO-2022-JP
psNamedFont16 Kochi-Gothic H GothicBBB-Medium-H ISO-2022-JP
psNamedFont16 Kochi-Gothic V GothicBBB-Medium-V ISO-2022-JP
#----- end Japanese support package
Step-3. Xpdf print dialogue
In xpdf print dialogue, check on "Print With command" and
type "lpr -P <YOUR_PRINER_NAME>".


All times are GMT -5. The time now is 01:44 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration