Mercurial > hg > Papers > 2015 > kaito-lola
comparison extras/font_install_how.txt @ 0:c0d36568602d
1st commit
author | Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 10 May 2015 22:54:12 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:c0d36568602d |
---|---|
1 | |
2 | |
3 | |
4 ***** Mike Shell's Step-By-Step Guide to Manually ***** | |
5 ***** Installing (Type 1 PostScript) Fonts Under ***** | |
6 ***** LaTeX Using Adobe's Euro Font as an ***** | |
7 ***** Illustrative Example ***** | |
8 | |
9 Version 1.4 | |
10 January 10, 2007 | |
11 | |
12 Copyright 2002-2007, by Michael Shell | |
13 http://www.michaelshell.org/ | |
14 See: | |
15 http://www.ctan.org/tex-archive/macros/latex/contrib/IEEEtran/extras/ | |
16 for the latest version of this document. | |
17 | |
18 NOTE: This text file uses Unix line feed conventions. When (human) | |
19 reading this file on other platforms, you may have to use a text | |
20 editor that can handle lines terminated by the Unix line feed | |
21 character (0x0A). | |
22 | |
23 *** Free to use and distribute if all credits are retained and the *** | |
24 *** document is unchanged. No warranty expressed or implied. User *** | |
25 *** assumes all risk. *** | |
26 | |
27 Note: This guide is intended to be "hands on" and covers only a specific, | |
28 practical example. There are other, more formal and comprehensive guides | |
29 to installing fonts under LaTeX: | |
30 | |
31 1. "The Font Installation Guide" | |
32 by Philipp Lehman | |
33 http://www.ctan.org/tex-archive/info/Type1fonts/fontinstallationguide/ | |
34 This is perhaps the best book ever written on the subject. Tutorial IV, | |
35 "The Euro Currency Symbol" covers the euro symbol. | |
36 | |
37 2. "Fonts and layouts", Chapter 8 of "A Beginner's Introduction to | |
38 Typesetting with LaTeX" (Section 8.3.2 covers the installation of | |
39 PostScript fonts) by Peter Flynn | |
40 http://www.ctan.org/tex-archive/info/beginlatex/html/chapter8.html#instfonts | |
41 | |
42 3. "fontinst - Font Installation Software for LaTeX" | |
43 by Alan Jeffrey, Rowland McDonnell and Lars Hellstrom | |
44 http://ctan.tug.org/tex-archive/fonts/utilities/fontinst/doc/ | |
45 | |
46 4. "The Simple Guide to Type 1 Fonts in LaTeX" | |
47 by Matthew Amster-Burton | |
48 http://www.mamster.net/tex/latex-fontfaq-amster-burton.pdf | |
49 Although the author states that this guide has been superseded by | |
50 Lehman's, it may still be of some value. | |
51 | |
52 5. "The No BS Guide to teTeX Font Installation" | |
53 by Donovan Rebbechi | |
54 http://www.pegasus.rutgers.edu/~elflord/unix/latex/no-bs.html | |
55 May be out of date today, but may still have some useful tips about the | |
56 fontinst application. | |
57 | |
58 | |
59 | |
60 Installing a euro font in LaTeX, although not always trivial, is a straight | |
61 forward task. Furthermore, it is an instructive exercise for learning how | |
62 to manually install fonts in LaTeX. Many other fonts are easier to install | |
63 as they do not require renaming, and/or have parts that have to be obtained | |
64 from multiple sources. So, if you can get a euro font going, you can | |
65 probably handle most other fonts you might want to install. Admittedly, | |
66 there are also those that are more difficult to install, especially if the | |
67 TeX metric and/or dvips map files have not already been created for them. | |
68 The installation of such fonts is not covered by the information provided | |
69 here. | |
70 | |
71 The four basic steps for manually installing a (type 1) font under LaTeX are: | |
72 | |
73 1. Install the actual PostScript font (.pfb) files; | |
74 2. Install the .tfm metric files; | |
75 3. Install the .sty and .fd files to provide a LaTeX interface; | |
76 4. Update the map configuration files and LaTeX directory lookup (hash) | |
77 tables. | |
78 | |
79 | |
80 The euro font has a number of issues that make it a tad more difficult | |
81 to install than most LaTeX fonts. The euro standards commission: | |
82 | |
83 http://europa.eu.int/euro/ | |
84 | |
85 originally mandated that the official standard euro symbol should always be | |
86 rendered in the sans style even if the surrounding text uses a different | |
87 style. This requirement violated traditional typesetting conventions and | |
88 was later overturned. However, this policy did cause a rift as to what was | |
89 considered the "proper" thing to do. | |
90 | |
91 Also, several different vendors/individuals have made their own versions of | |
92 the euro symbol using their interpretations of what it meant to have a | |
93 serf euro. | |
94 | |
95 Furthermore, LaTeX is independent of the type of fonts used - it can use | |
96 bitmap (Type 3), PostScript (Type 1 and 1C) and even fonts of the future | |
97 that haven't even been thought of yet - LaTeX could care less what is used | |
98 to describe the glyph shapes, it only needs to know the height, depth, and | |
99 width of each glyph. | |
100 | |
101 All of this results in the fact that there are several types of euro fonts | |
102 (and LaTeX packages) to choose from. So, I have to make a judgement call | |
103 as to what to recommend to use here. | |
104 | |
105 I assume that you want a Type 1 Postscript font as opposed to anything | |
106 bitmapped - this will help ensure the best quality rendering possible for a | |
107 given printer resolution. I will also assume here that the LaTeX system | |
108 you have does not already have any support for Type 1 euro glyphs, as is | |
109 often the case. | |
110 | |
111 Adobe gives out a free set of PostScript Type 1 euro fonts. | |
112 See: | |
113 | |
114 http://www.adobe.com/type/eurofont.html | |
115 | |
116 However, Adobe does not allow its fonts to be bundled with other software | |
117 products. This is why the fonts cannot be already pre-loaded in the LaTeX | |
118 distributions and LaTeX users must manually obtain and install them. | |
119 | |
120 [Note: Also worthy of consideration is Martin Vogel's marvosym package: | |
121 http://www.ctan.org/tex-archive/fonts/psfonts/marvosym/ | |
122 which includes several euro symbols as well as other symbols such | |
123 as astronomy, structural engineering, zodiac, and the "CE" symbol. | |
124 The marvosym package is licensed under the GPL.] | |
125 | |
126 This guide will focus on the use of the Adobe euro fonts. Now, you do not | |
127 have to register, but can get the needed Adobe euro font files directly | |
128 from: | |
129 | |
130 Windows and Unix: | |
131 ftp://ftp.adobe.com/pub/adobe/type/win/all/ | |
132 eurofont.exe | |
133 eurofont.txt | |
134 | |
135 Mac: | |
136 ftp://ftp.adobe.com/pub/adobe/type/mac/all/ | |
137 eurofont.sea.hqx | |
138 eurofont.txt | |
139 | |
140 Note that the file eurofont.exe is actually a zip file that is self | |
141 extracting when run under Windows. Unix users can do a: | |
142 | |
143 unzip eurofont.exe | |
144 | |
145 to unpack it. | |
146 | |
147 | |
148 | |
149 STEP #1 - INSTALL THE ACTUAL POSTSCRIPT FONT FILES | |
150 | |
151 Now, the eurofont.txt will tell you that you need ATM - ignore this since | |
152 you are using LaTeX and will have to do a manual install of the font files. | |
153 You can install them into MS Windows using Adobe ATM, but even if you do, | |
154 you will still have to follow the instructions here. | |
155 | |
156 The Adobe font files will have strange looking names. You are primarily | |
157 interested in the ones that end in PFB ("Printer Font Binary" - but | |
158 "PostScript Font Binary" might be a better name). These contain the | |
159 PostScript code which describes what the glyphs look like. It is these | |
160 files (or portions of them) that get embedded into your PostScript or PDF | |
161 output files. The AFM (Adobe Font Metric) files describe the size of the | |
162 boxes each glyph takes up. The PFM files do the same thing, but are used | |
163 only by the MS Windows system. LaTeX does not use AFM or PFM files, but | |
164 rather uses TFM (TeX Font Metric) files. There is a program (afm2tfm) that | |
165 can convert AFM to TFM, but you don't need this as the TeX/LaTeX developers | |
166 have done this for you already. Some font conversion programs (e.g., ps2pk) | |
167 may require access to the AFM or PFM files. The INF files describe the | |
168 fonts to Windows - so you don't need them (but, if curious, you can find | |
169 the formal font names listed within them). | |
170 | |
171 Now, rename the PFB files from the archive as follows: | |
172 | |
173 _1______.PFB -> zpeurs.pfb | |
174 _1B_____.PFB -> zpeubs.pfb | |
175 _1I_____.PFB -> zpeuris.pfb | |
176 _1BI____.PFB -> zpeubis.pfb | |
177 _2______.PFB -> zpeurt.pfb | |
178 _2B_____.PFB -> zpeubt.pfb | |
179 _2I_____.PFB -> zpeurit.pfb | |
180 _2BI____.PFB -> zpeubit.pfb | |
181 _3______.PFB -> zpeur.pfb | |
182 _3B_____.PFB -> zpeub.pfb | |
183 _3I_____.PFB -> zpeuri.pfb | |
184 _3BI____.PFB -> zpeubi.pfb | |
185 | |
186 | |
187 The new names are, more or less, based on Karl Berry's scheme for TeX font | |
188 names. For more information on this topic, see Karl Berry's "Filenames | |
189 for TeX Fonts": http://www.ctan.org/tex-archive/info/fontname/fontname.pdf | |
190 | |
191 Now, find your texmf directory where your LaTeX system is installed. I'll | |
192 call this directory "<texmf>". (You may wish to use the local tree | |
193 "<texmf-local>", or "localtexmf" under MiKTeX, instead so that your changes | |
194 will remain even after the system is upgraded.) Go to | |
195 <texmf>/fonts/type1/adobe and make a directory called "eurofont". Copy all | |
196 the renamed .pfb files into <texmf>/fonts/type1/adobe/eurofont | |
197 | |
198 [Note: Some PostScript font files come in ASCII, not binary. Such ".pfa" | |
199 files would go in the same directory as their pfb equivalents. Any virtual | |
200 font files ".vf" would go in the <texmf>/fonts/vf/ directory tree.] | |
201 | |
202 You may also want to do the same with the AFM and PFM files so that certain | |
203 font conversion programs can access these as well. Put the renamed AFM and | |
204 PFM files in <texmf>/fonts/afm/adobe/eurofont and | |
205 <texmf>/fonts/pfm/adobe/eurofont, respectively. | |
206 | |
207 Unix users will have to have super user privileges to make changes to the | |
208 <texmf> directory. | |
209 | |
210 | |
211 | |
212 Now, LaTeX's configuration will have to be updated so that it knows about | |
213 the new Adobe euro fonts. | |
214 | |
215 | |
216 Of the several LaTeX packages that do this, I think that two are the best. | |
217 The most complete, and complex, is Rowland McDonnell's eurofont package: | |
218 | |
219 http://www.ctan.org/tex-archive/macros/latex/contrib/eurofont/ | |
220 | |
221 This is an EXTREMELY comprehensive (and high quality) work. The user's | |
222 guide alone is over 60 pages. But, I'll show here how to install the | |
223 leaner, LaTeX euro package (this actually consists of two smaller LaTeX | |
224 packages "europs" and "eurosans"): | |
225 | |
226 http://www.ctan.org/tex-archive/fonts/euro/ | |
227 | |
228 Download and unpack this euro package archive. The readme.txt tells what | |
229 to do. But, I'll repeat the steps here in my own words. I will show how | |
230 to do things manually rather than rely on any automated install scripts. | |
231 | |
232 Some of these files (including the tfm and map files) may already be | |
233 installed in some LaTeX systems, you don't have to reinstall them if | |
234 that is the case. | |
235 | |
236 | |
237 | |
238 STEP #2 - INSTALL THE TFM METRIC FILES | |
239 | |
240 The tfm subdirectory (of the unpacked euro.tar.gz or euro.zip archive) | |
241 contains the tfm files for the Adobe fonts you just installed. These tfm | |
242 files need to be copied to: | |
243 <texmf>/fonts/tfm/adobe/eurofont | |
244 make this /eurofont directory as needed. | |
245 | |
246 | |
247 | |
248 STEP #3 - INSTALL THE .sty and .fd FILES TO PROVIDE A USER INTERFACE | |
249 | |
250 OK, now at this point the LaTeX system has access to the PostScript | |
251 descriptions of the glyphs and their size metrics. Now, you need to provide | |
252 LaTeX with set of names that the euro glyphs will be called by. | |
253 | |
254 In the latex subdirectory of the archive there will be two packages: europs | |
255 and eurosans. eurosans restricts it's use to the sans euro because many | |
256 people who are knowledgeable in the typographic field feel that the sans | |
257 euro better matches with most fonts, including many popular serif ones such | |
258 as Times. eurosans also allows the user to specify an arbitrary scaling | |
259 factor so that the size of the euro can be adjusted (if needed) to more | |
260 closely match that of the surrounding text. The europs package allows you | |
261 to decide if you want a serif euro. It is easy enough to install them both. | |
262 | |
263 | |
264 Now, in your <texmf>/tex/latex directory, make a directory called | |
265 "euro" i.e., <texmf>/tex/latex/euro. | |
266 | |
267 Copy the eurosans.sty file into <texmf>/tex/latex/euro. | |
268 | |
269 Now, in the europs package will have a europs.dtx and a europs.ins file. | |
270 Run latex on the europs.ins (e.g., latex europs.ins) to make the europs.sty | |
271 and the uzpeu.fd, uzpeus.fd, uzpeut.fd files. Copy these four files into | |
272 your <texmf>/tex/latex/euro directory just like you did with eurosans.sty. | |
273 | |
274 | |
275 | |
276 STEP #4 - UPDATE THE DVIPS/PDFTEX/YAP/XDVI CONFIGURATION FILES | |
277 | |
278 OK, now LaTeX understands how to use these new fonts and users have LaTeX | |
279 commands that refer to them. | |
280 | |
281 The next step is to also inform dvips, pdfTeX, Yap, and/or xdvi, etc., | |
282 so that you can make and view documents with the euro symbol. | |
283 | |
284 The file you need is "zpeu.map" which is found in the dvips subdirectory of | |
285 the archive. There is also a "zpeu-origname.map" which will allow the use | |
286 of the original Adobe names (e.g., "_1______.PFB"), but it is best to change | |
287 the names, as mentioned previously, to follow the LaTeX convention (so as to | |
288 improve clarity and avoid future name clashes). | |
289 | |
290 | |
291 Font map handling has been changed to use an updmap utility in conjunction | |
292 with an updmap.cfg configuration file for the newer (teTeX 2.0, MiKTeX 2.4 | |
293 and later) LaTeX systems. Use one of the appropriate subsections below | |
294 depending on your system: | |
295 | |
296 | |
297 -- For Systems Older Than teTeX 2.0 or MiKTeX 2.4 -- | |
298 Copy zpeu.map to your <texmf>/dvips/config directory. Now, in your | |
299 <texmf>/dvips/config directory, edit your config.ps file (with a text editor) | |
300 and add the following line (somewhere after the "p psfonts.map" line - there | |
301 will be a bunch of other "p +" lines in this area): | |
302 | |
303 p +zpeu.map | |
304 | |
305 Save the changes to config.ps. | |
306 | |
307 For pdfTeX (and pdfLaTeX), the line: | |
308 | |
309 map +zpeu.map | |
310 | |
311 should be added to the pdftex.cfg file in the <texmf>/pdftex/config | |
312 directory (there is no need to make another copy of the zpeu.map file as | |
313 pdfTeX will know to look for it in dvips' config directory). | |
314 | |
315 MiKTeX users will also want to add to the line: | |
316 | |
317 p +zpeu.map | |
318 | |
319 to the <texmf>\miktex\config\config.makepk file so that Yap can find the | |
320 font if it does not already look at dvips' config.ps file. | |
321 | |
322 MiKTeX users may also want to add the lines contained in the zpeu.map to | |
323 <texmf>\miktex\dvips\ps2pk\ps2pk.map for other applications that may need | |
324 it. | |
325 | |
326 MetaPost users may want to add the lines contained in the zpeu.map file to | |
327 the <texmf>/dvips/config/psfonts.map file as that is what MetaPost relies | |
328 on. | |
329 | |
330 Older versions of xdvi that rely on gsftopk (to convert Type 1 fonts to | |
331 bitmap form) may also require the psfonts.map file to be updated. Newer | |
332 versions of (the Kpathsea enabled version "xdvi-k") xdvi are able to render | |
333 Type 1 fonts directly from the .pfb files. See Stefan Ulrich's xdvi-k site | |
334 on Sourceforge for details: | |
335 http://xdvi.sourceforge.net/ | |
336 | |
337 Note that versions of dvips prior to V5.83 have a bug with partial font | |
338 downloading that may cause a dvips error when using some types of fonts, | |
339 like the euro packages. (The error messages can be like: "File <xxx.pfb> | |
340 ended before all chars have been found" or "xx Subr not found", etc.) | |
341 If you encounter this, the workaround is to update dvips or use the | |
342 -j0 option: | |
343 | |
344 dvips -j0 -o myfile.ps myfile | |
345 | |
346 Thanks to Dan Luecking for posting much information about map file | |
347 configuration. | |
348 | |
349 OK, now all the files are in place. Most TeX systems (teTeX Unix and MiKTeX | |
350 Windows) need to be told to rescan their directories in order to add the | |
351 names of all the newly added files to the lookup cache. | |
352 | |
353 In teTeX (and fpTeX), the command to run is "texhash" or "mktexlsr". | |
354 | |
355 In MiKTeX it is "initexmf -u" to refresh the filename database and then | |
356 "initexmf --mkpsres --search" to rebuild the PostScript resource database. | |
357 The MiKTeX Options application has a "Refresh Now" button which does the | |
358 same thing. | |
359 | |
360 These are the same commands that you run after you add any package to | |
361 LaTeX's directories. Run this application/command. | |
362 | |
363 | |
364 | |
365 -- For teTeX 2.0, MiKTeX 2.4 and Newer Systems -- | |
366 Copy zpeu.map to your <texmf>/fonts/map/dvips/misc directory. Edit the | |
367 <texmf>/web2c/updmap.cfg file with a text editor and add the line: | |
368 | |
369 Map zpeu.map | |
370 | |
371 Now, you will have to refresh the directory lookup (hash) tables so | |
372 that the LaTeX system can see the new zpeu.map file in the lookup cache. | |
373 | |
374 In teTeX (and fpTeX), the command to run is "texhash" or "mktexlsr". | |
375 | |
376 In MiKTeX use "initexmf -u" to refresh the filename database. The | |
377 MiKTeX Options application has a "Refresh Now" button which does the | |
378 same thing. | |
379 | |
380 Now, for teTeX 2.0 and MiKTeX systems, run the "updmap" command to update | |
381 the map file configuration. For teTeX 3.0 and later, the command you will | |
382 likely want to run is "updmap-sys" which updates the map files system-wide | |
383 (as "updmap" does in teTeX 2.0). (Under teTeX 3.0 and later, "updmap" updates | |
384 the map file settings only for the current user.) | |
385 | |
386 | |
387 | |
388 HOW TO USE THE EURO GLYPHS | |
389 | |
390 Now, you can use the euro packages. | |
391 | |
392 To use eurosans.sty, just: | |
393 | |
394 \usepackage{eurosans} | |
395 | |
396 and then \euro will produce the euro symbol that will be in sans. The other | |
397 attributes (series, shape) will vary with that of the surrounding font. | |
398 | |
399 | |
400 To use europs.sty, do a | |
401 | |
402 \usepackage{europs} | |
403 | |
404 then | |
405 | |
406 \EUR will produce a euro symbol that varies with the current font family | |
407 (serif, sans, or mono). | |
408 \EURofc will produce an "official" (old commission policy) euro symbol | |
409 that is always in sans. There is also: | |
410 | |
411 \EURhv (Euro-Sans) | |
412 \EURtm (Euro-Serif) | |
413 \EURcr (Euro-Mono) | |
414 | |
415 | |
416 | |
417 That was easy right? Enjoy! ;) | |
418 | |
419 | |
420 Mike Shell | |
421 | |
422 *********************************** |