[TLContrib] How do I properly modify an existing map file?

Leo Liu leoliu.pku at gmail.com
Mon Mar 26 13:28:25 CEST 2012


Hello,

Thank you. I know definitely that modifying an existing map file might be unsafe.
But it is useful for my package --- and it is one of the core techniques of the package.

A CJK font (via CJK package) is split into hundreds of individual ones. For example,
when you use `kai' font family in the C70 font encoding under CJK package, CJK characters
(like 汉字) would refer to 256 TFM files:

    unikai00.tfm    unikai01.tfm    ...    unikaiff.tfm

Then a font mapping for pdfTeX or dvipdfmx with proper sub-font definition is used to
specify the actual TrueType font `simkai.ttf'.

A very important feature is that all CJK ideograms are square, and usually have the same
size (width and height). It is not necessary to produce different TFM files for every fonts.
The zhmCJK package let the different Chinese fonts share only one TFM file, and use TFM
font mapping instead of reproducing them time and time again. That's why I need to use
texfonts.map faculty.

zhmCJK is not installed in TeX Live, and we (the ctex-kit project) plan to merge current
zhmCJK package and zhmetrics package. Then it will be deleted from tlcontrib.

I'm sorry that the document of zhmCJK is written only in Chinese and the problem we meet
is not typical in other languages. And I won't explain all the special techniques used in the
package here. But I think it would suffice.

And sorry for my English.

Best,
Leo

-----Original Message-----
From: Norbert Preining [mailto:preining at logic.at] 
Sent: Monday, March 26, 2012 3:46 PM
To: Leo Liu; Taco Hoekwater
Cc: TLContrib at ntg.nl
Subject: Re: [TLContrib] How do I properly modify an existing map file?

Hi Leo,

On Mo, 26 Mär 2012, Leo Liu wrote:
> I've just uploaded my zhmCJK package.
>     
> http://tlcontrib.metatex.org/cgi-bin/package.cgi/action=view/id=594
> 
> I need to modify $TEXMFDIST/fonts/map/fontname/texfonts.map, which is in the fontname package.

Can you explain *why* you need to modify that file? It provides very special replacement of font names.

Up to now there is NO mechanism to make changes of this file through packages, but the mechanism you described, BUT this is unsave, since on update of the containing package will change this.

> I think I should use a postaction to run a script to do it, like dvipdfmx package do. However, I'm not sure which path should I put the script. Now it is in the texmf-dist/source (certainly wrong), and I add
>     script file=texmf-dist/source/latex/zhmCJK/zhmCJK-addmap.pl
> in the `TL postactions' box to specify the postactions. It might be put into texmf-dist/script, but how about tlpkg/tlpostcode which I cannot specify? Or there is a better way to do that?

You can put it wherever you want, and specify the remainder of the location in the tlpsrc file. In your case the above would be fine.


But again, think about why you are changing texfonts.map. My suggestion is to create a copy of texfonts.map in TEXMFSYSVAR and edit this, but OTOH this creates another bag of possible problems if the main package is updated and texfonts.map changes ... I don't know the perfect solution.

Can you explain what is your intention behind changing that files?


On Mo, 26 Mär 2012, Taco Hoekwater wrote:
>   addMap zhmchk.map

That is something different, I guess.

Best wishes

Norbert
------------------------------------------------------------------------
Norbert Preining            preining@{jaist.ac.jp, logic.at, debian.org}
JAIST, Japan                                 TeX Live & Debian Developer
DSA: 0x09C5B094   fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094
------------------------------------------------------------------------
BURTON COGGLES
A bunch of keys found in a drawer whose purpose has long been forgotten, and which can therefore now be used only for dropping down people's backs as a cure for nose-bleeds.
			--- Douglas Adams, The Meaning of Liff



More information about the TLContrib mailing list