Installing Truetype fonts in context.
--Like a good little TeXer I have always avoided Truetype fonts. But now I have a situation where the customer is requesting it, and has provided the font. So I have tried to follow the instructinns in the pdftex manual as well as those in Texfont Explained manual. First I got apparently clean results but the font looks just like Computer Modern. The only error message I can see is one asking for a pfb file which of course I don't have. Then following an earlier post I tried something like this. The font is a Devangari font, or perhaps more properly a Western font that looks a bit like Devnagari script. Here is my run script: ----------------------------------------------------- ttf2afm -e 8r.enc -o ds_izmir.afm ds_izmir.ttf texfont --en=8r --ve=truetype --co=all --makepath --install cd /usr/share/texmf-local/fonts/map/pdftex/context/ cat *map >plus.map mv plus.map /usr/share/texmf/fonts/map/pdftex/updmap updmap texhash ----------------------------------------------------------- With this run stream texfont has two complaints: first that it is an unknown vendor and second that it cannot find either a pfa or pfb file. There is a trick to it I am sure, and I am sure I do not know the trick. John Culleton The answers to all your publishing questions are found in the excellent books listed in the word-famous shortlist! http://wexfordpress.com/tex/shortlist.pdf
On Jun 4, 2005, at 4:21 PM, John R. Culleton wrote:
--Like a good little TeXer I have always avoided Truetype fonts. But now I have a situation where the customer is requesting it, and has provided the font. So I have tried to follow the instructinns in the pdftex manual as well as those in Texfont Explained manual. First I got apparently clean results but the font looks just like Computer Modern. The only error message I can see is one asking for a pfb file which of course I don't have.
Then following an earlier post I tried something like this. The font is a Devangari font, or perhaps more properly a Western font that looks a bit like Devnagari script. Here is my run script:
----------------------------------------------------- ttf2afm -e 8r.enc -o ds_izmir.afm ds_izmir.ttf texfont --en=8r --ve=truetype --co=all --makepath --install cd /usr/share/texmf-local/fonts/map/pdftex/context/ cat *map >plus.map mv plus.map /usr/share/texmf/fonts/map/pdftex/updmap updmap texhash ----------------------------------------------------------- With this run stream texfont has two complaints: first that it is an unknown vendor and second that it cannot find either a pfa or pfb file.
There is a trick to it I am sure, and I am sure I do not know the trick.
John Culleton The answers to all your publishing questions are found in the excellent books listed in the word-famous shortlist! http://wexfordpress.com/tex/shortlist.pdf
_______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
This: http://tug.org/pracjourn/2005-2/schmitz/schmitz.pdf might have a lot of information that is too basic for you, but it just might hold some useful bits and pieces. In your case, the key is that you created a afm. If texfont "sees" a afm, it expects the font to be a pfb. The tfm it creates is valid nevertheless, you just have to adjust the map accordingly. But if you follow the advice in the article above, things should be easier. Good luck Thomas
John R. Culleton wrote:
ttf2afm -e 8r.enc -o ds_izmir.afm ds_izmir.ttf
ttf2afm -a -o ds_izmir.afm ds_izmir.ttf will produce an afm with *all* glyph names/metrics, the 8r will be made from that one next time; ssuch an afm can be used then for other encodings as well
texfont --en=8r --ve=truetype --co=all --makepath --install cd /usr/share/texmf-local/fonts/map/pdftex/context/ cat *map >plus.map mv plus.map /usr/share/texmf/fonts/map/pdftex/updmap updmap texhash ----------------------------------------------------------- With this run stream texfont has two complaints: first that it is an unknown vendor and second that it cannot find either a pfa or pfb file.
can you check the map file? maybe you need to replace the pfb suffix by ttf Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Saturday 04 June 2005 09:34 pm, Hans Hagen wrote:
John R. Culleton wrote:
ttf2afm -e 8r.enc -o ds_izmir.afm ds_izmir.ttf
ttf2afm -a -o ds_izmir.afm ds_izmir.ttf
will produce an afm with *all* glyph names/metrics, the 8r will be made from that one next time; ssuch an afm can be used then for other encodings as well
Interesting fact #1: The ttv2afm program that comes with Slackware-current (version =1.0) doesn't use the -a option. The ttf2afm program that comes with TeXlive does. OTOH the Slack version allows for the option -v for version but the TeXlive version doesn't. The source in the TeXLive distro says it is version 1.0 also. So we have two variants of ttf2afm, both claiming to be version 1.0. The limited TeX for Linux distro from Pragma.nl is apparently the same as the texLive version in this respect. Therefore I will use the TeXLive version of ttf2afm. Interesting fact #2. The afm files produced for this particular font by the TeXLive version with and without option -a are virtually identical. Here are the results of the diff: ------------------------------------- < Comment Converted at Sun Jun 5 07:57:17 2005 by ttf2afm from font file `ds_izmir.ttf' ---
Comment Converted at Sun Jun 5 07:56:39 2005 by ttf2afm from font file `ds_izmir.ttf' 15c15,17 < StartCharMetrics 457
StartCharMetrics 459 C -1 ; WX 500 ; N .notdef ; B 0 0 0 0 ; C -1 ; WX 0 ; N .null ; B 0 0 0 0 ;
Continuing:
With this run stream texfont has two complaints: first that it is an unknown vendor and second that it cannot find either a pfa or pfb file.
can you check the map file? maybe you need to replace the pfb suffix by ttf
Hans -- Interesting Fact #3. Apparently the map file created by texfont needs this tweak. This is not documented elsewhere.
Interesting Fact #4. There is a more or less undocumented option of texfont which apparently converts a ttf file to its pfb equivalent using pfaedit. Since pfaedit is now fontforge perhaps fontforge needs to be aliased back to the earlier name. Or perhaps it doesn't work with the latest fontforge. I will explore further. Whether this option is intended to be used alone or integrated in a regular texfont run is also not clear. No doubt Hans will enlighten all of us. The plot thickens, but hopefully the light at the end of the ttf font tunnel is not just another onrushing train. John Culleton f
Thanks to all who assisted earlier in the thread. Let me start with a clean sheet of paper. My environment is Slackware Linux, which puts TeX in /usr/share/. However I have updated the ttf2afm program by copying the newer version from TeXLive as previously discussed. Here are my two font install scripts. The first is for a pfb file not accompanied by an afm file. The second is for a ttf file. They both seem to work for me, given my environment. Both require that the font be put in a subdirectory by itself to start with. Both require that the font be assigned an unique name. Both require that updmap.cfg be modified initially to include a file called plus.map. Both are called with <command> vendorname fontname. Comments/criticisms appreciated. Are they candidates for the contextgarden WIKI? -----------------makefonts----------------------------------- pf2afm *pfb mkdir /usr/share/texmf-local/fonts/source/$1 mkdir /usr/share/texmf-local/fonts/source/$1/$2 cp * /usr/share/texmf-local/fonts/source/$1/$2/ texfont --en=8r --ve=$1 --co=$2 --ma --in cd /usr/share/texmf-local/fonts/map/pdftex/context/ cat *map >plus.map mv plus.map /usr/share/texmf/fonts/map/pdftex/updmap updmap texhash ------------------------------------------------------------- --------------------makettls-------------------------------- ttf2afm *ttf mkdir /usr/share/texmf-local/fonts/source/$1 mkdir /usr/share/texmf-local/fonts/source/$1/$2 cp * /usr/share/texmf-local/fonts/source/$1/$2/ texfont --en=8r --ve=$1 --co=$2 --ma --in cd /usr/share/texmf-local/fonts/map/pdftex/context/ sed {s/pfb/ttf/} *$2* cat *map >plus.map mv plus.map /usr/share/texmf/fonts/map/pdftex/updmap updmap texhash ------------------------------------------ -- John Culleton
participants (3)
-
Hans Hagen
-
John R. Culleton
-
Thomas A. Schmitz