CTAN Comprehensive TeX Archive Network

Direc­tory fonts/utilities/cjk-gs-integrate

README.md

Con­fig­ur­ing Ghostscript for CJK CID/TTF fonts

This script searches a list of di­rec­to­ries for CJK fonts, and makes them avail­able to an in­stalled Ghostscript. In the sim­plest case with suf­fi­cient priv­i­leges, a run with­out ar­gu­ments should ef­fect in a com­plete setup of Ghostscript.

Usage

[perl] cjk-gs-integrate[.pl] [OPTIONS]

Op­tions

  -o, --output DIR      specifies the base output dir, if not provided,
                        the Resource directory of an installed Ghostscript
                        is searched and used.
  -f, --fontdef FILE    specify alternate set of font definitions, if not
                        given, the built-in set is used
  --fontdef-add FILE    specify additional set of font definitions, to
                        overwrite subset of built-in definitions;
                        can be given multiple times
  -a, --alias LL=RR     defines an alias, or overrides a given alias;
                        illegal if LL is provided by a real font, or
                        RR is neither available as real font or alias;
                        can be given multiple times
  --filelist FILE       read list of available font files from FILE
                        instead of searching with kpathsea
  --link-texmf [DIR]    link fonts into
                           DIR/fonts/opentype/cjk-gs-integrate
                        and
                           DIR/fonts/truetype/cjk-gs-integrate
                        where DIR defaults to TEXMFLOCAL
  --otfps [DIR]         generate configuration file (psnames-for-otf) into
                           DIR/dvips/ps2otfps
                        which is used by ps2otfps (developed by Akira Kakuto),
                        instead of generating snippets
  --force               do not bail out if linked fonts already exist
  --remove              try to remove instead of create
  --cleanup             try to clean up all possible links/snippets and
                        cidfmap.local/cidfmap.aliases, which could have been
                        generated in the previous runs
  -n, --dry-run         do not actually output anything
  -q, --quiet           be less verbose
  -d, --debug           output debug information, can be given multiple times
  -v, --version         outputs only the version information
  -h, --help            this help

Win­dows only op­tions

  --hardlink            create hardlinks instead of symlinks
  --winbatch [FILE]     prepare a batch file for link generation, instead of
                        generating links right away
                        the batch file name defaults to makefontlinks.bat

Com­mand like op­tions

  --dump-data [FILE]    dump the set of font definitions which is currently
                        effective, where FILE (the dump output) defaults to
                        cjk-gs-integrate-data.dat; you can easily modify it,
                        and tell me with -f (or --fontdef) option
  --only-aliases        regenerate only cidfmap.aliases file, instead of all
  --list-aliases        lists the available aliases and their options, with the
                        selected option on top
  --list-all-aliases    list all possible aliases without searching for
                        actually present files
  --list-fonts          lists the fonts found on the system
  --info                combines the information of --list-aliases and
                        --list-fonts
  --machine-readable    output of --list-aliases is machine readable

Oper­a­tion

For each found TrueType (TTF) font it cre­ates a cidfmap en­try in

<Resource>/Init/cidfmap.local
  -- if you are using tlgs win32, tlpkg/tlgs/lib/cidfmap.local instead

and links the font to

<Resource>/CIDFSubst/

For each CID font it cre­ates a snip­pet in

<Resource>/Font/

and links the font to

<Resource>/CIDFont/

The <Resource> dir is ei­ther given by -o/--output, or oth­er­wise searched from an in­stalled Ghostscript (bi­nary name is as­sumed to be 'gs' on unix, 'gswin32c' on win32).

Aliases are added to

<Resource>/Init/cidfmap.aliases
  -- if you are using tlgs win32, tlpkg/tlgs/lib/cidfmap.aliases instead

Fi­nally, it tries to add run­lib calls to

<Resource>/Init/cidfmap
  -- if you are using tlgs win32, tlpkg/tlgs/lib/cidfmap

to load the cidfmap.lo­cal and cidfmap.aliases.

How and which di­rec­to­ries are searched

Search is done us­ing the kpath­sea li­brary, in par­tic­u­lar us­ing kpse­which pro­gram. By de­fault the fol­low­ing di­rec­to­ries are searched:

  • all TEXMF trees
    • /Library/Fonts, /Library/Fonts/Microsoft, /System/Library/Fonts, /System/Library/Assets, /Network/Library/Fonts, ~/Library/Fonts and /usr/share/fonts (all if avail­able)
    • /Applications/Microsoft Word.app/Contents/Resources/{Fonts,DFonts}, /Applications/Microsoft Excel.app/Contents/Resources/{Fonts,DFonts}, /Applications/Microsoft PowerPoint.app/Contents/Resources/{Fonts,DFonts} (all if avail­able, meant for Of­fice for Mac 2016)
    • c:/windows/fonts (on Win­dows)
    • the di­rec­to­ries in OSFONTDIR en­vi­ron­ment vari­able

In case you want to add some di­rec­to­ries to the search path, adapt the OSFONTDIR en­vi­ron­ment vari­able ac­cord­ingly: Ex­am­ple:

    OSFONTDIR="/usr/local/share/fonts/truetype//:/usr/local/share/fonts/opentype//" $prg

will re­sult in fonts found in the above two given di­rec­to­ries to be searched in ad­di­tion.

Out­put files

If no out­put op­tion is given, the pro­gram searches for a Ghostscript in­ter­preter 'gs' and de­ter­mines its Re­source di­rec­tory. This might fail, in which case one need to pass the out­put di­rec­tory man­u­ally.

Since the pro­gram adds files and link to this di­rec­tory, suf­fi­cient per­mis­sions are nec­es­sary.

Aliases

Aliases are man­aged via the Pro­vides val­ues in the font database. At the mo­ment en­tries for the ba­sic font names for CJK fonts are added:

Ja­panese:

Ryumin-Light GothicBBB-Medium FutoMinA101-Bold FutoGoB101-Bold
MidashiMin-MA31 MidashiGo-MB31 Jun101-Light

Korean:

HYSMyeongJo-Medium HYGoThic-Medium HYRGoThic-Medium

Sim­pli­fied Chi­nese:

STSong-Light STSong-Regular STHeiti-Regular STHeiti-Light
STKaiti-Regular STFangsong-Light STFangsong-Regular

Tra­di­tional Chi­nese:

MSung-Light MSung-Medium MHei-Medium MKai-Medium

In ad­di­tion, we also in­clude pro­vide en­tries for the OTF Mori­sawa names:

RyuminPro-Light GothicBBBPro-Medium
FutoMinA101Pro-Bold FutoGoB101Pro-Bold
MidashiMinPro-MA31 MidashiGoPro-MB31 Jun101Pro-Light

The or­der is de­ter­mined by the Provides set­ting in the font database. That is, the first font found in this or­der will be used to pro­vide the alias if nec­es­sary.

For the Ja­panese fonts: Mori­sawa Pr6N, Mori­sawa, Hi­ragino ProN, Hi­ragino, Kozuka Pr6N, Kozuka ProVI, Kozuka Pro, Kozuka Std, Yu OS X, Yu Win, MS, Moga-Mobo-ex, Moga-Mobo, IPAex, IPA, Ume

For the Korean fonts: (Hanyang,) Adobe, So­laris, MS, Un­fonts, Baek­muk

For the Sim­pli­fied Chi­nese: Adobe, Fan­dol, Hi­ragino, Founder, MS, CJKUni­fonts, Ar­phic, CJKUni­fonts-ttf

For the Tra­di­tional Chi­nese: Adobe, MS, CJKUni­fonts, Ar­phic, CJKUni­fonts-ttf

Over­rid­ing aliases

Us­ing the com­mand line op­tion --alias LL=RR one can add ar­bi­trary aliases, or over­ride ones se­lected by the pro­gram. For this to work the fol­low­ing re­quire­ments of LL and RR must be ful­filled:

  • LL is not pro­vided by a real font
    • RR is avail­able ei­ther as real font, or as alias (in­di­rect alias)

Authors, Con­trib­u­tors, and Copy­right

The script and its doc­u­men­ta­tion was writ­ten by Nor­bert Prein­ing, based on re­search and work by Yusuke Kuroki, Yusuke Ter­ada, Bruno Voisin, Hironobu Ya­mashita, Mune­hiro Ya­mamoto and the Q&A wiki page.

Main­tained by Ja­panese Devel­op­ment Com­mu­nity. For de­vel­op­ment, see https://github.com/texj­porg/cjk-gs-sup­port

The script is li­censed un­der GNU Gen­eral Public Li­cense Ver­sion 3 or later. The con­tained font data is not copy­rightable.

Down­load the con­tents of this pack­age in one zip archive (58.6k).

cjk-gs-in­te­grate – Tools to in­te­grate CJK fonts into Ghostscript

This script searches a list of di­rec­to­ries for CJK fonts, and makes them avail­able to an in­stalled Ghostscript. In the sim­plest case, with suf­fi­cient priv­i­leges, a run with­out ar­gu­ments should re­sult in a com­plete setup of Ghostscript.

Pack­agecjk-gs-in­te­grate
Re­pos­i­toryhttps://github.com/texj­porg/cjk-gs-sup­port
Ver­sion20190303.0
Li­censesGNU Gen­eral Public Li­cense, ver­sion 3
Copy­right2015–2019 Nor­bert Prein­ing
2016–2019 Ja­panese Devel­op­ment Com­mu­nity
Main­tainerNor­bert Prein­ing
Con­tained inTeX Live as cjk-gs-in­te­grate
MiKTeX as cjk-gs-in­te­grate
TopicsFont util
...
Guest Book Sitemap Contact Contact Author