Mercurial > hg > Papers > 2015 > kaito-lola
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/extras/font_install_how.txt Sun May 10 22:54:12 2015 +0900 @@ -0,0 +1,422 @@ + + + + ***** Mike Shell's Step-By-Step Guide to Manually ***** + ***** Installing (Type 1 PostScript) Fonts Under ***** + ***** LaTeX Using Adobe's Euro Font as an ***** + ***** Illustrative Example ***** + +Version 1.4 +January 10, 2007 + +Copyright 2002-2007, by Michael Shell + http://www.michaelshell.org/ +See: +http://www.ctan.org/tex-archive/macros/latex/contrib/IEEEtran/extras/ +for the latest version of this document. + +NOTE: This text file uses Unix line feed conventions. When (human) +reading this file on other platforms, you may have to use a text +editor that can handle lines terminated by the Unix line feed +character (0x0A). + +*** Free to use and distribute if all credits are retained and the *** +*** document is unchanged. No warranty expressed or implied. User *** +*** assumes all risk. *** + +Note: This guide is intended to be "hands on" and covers only a specific, +practical example. There are other, more formal and comprehensive guides +to installing fonts under LaTeX: + +1. "The Font Installation Guide" + by Philipp Lehman + http://www.ctan.org/tex-archive/info/Type1fonts/fontinstallationguide/ + This is perhaps the best book ever written on the subject. Tutorial IV, + "The Euro Currency Symbol" covers the euro symbol. + +2. "Fonts and layouts", Chapter 8 of "A Beginner's Introduction to + Typesetting with LaTeX" (Section 8.3.2 covers the installation of + PostScript fonts) by Peter Flynn + http://www.ctan.org/tex-archive/info/beginlatex/html/chapter8.html#instfonts + +3. "fontinst - Font Installation Software for LaTeX" + by Alan Jeffrey, Rowland McDonnell and Lars Hellstrom + http://ctan.tug.org/tex-archive/fonts/utilities/fontinst/doc/ + +4. "The Simple Guide to Type 1 Fonts in LaTeX" + by Matthew Amster-Burton + http://www.mamster.net/tex/latex-fontfaq-amster-burton.pdf + Although the author states that this guide has been superseded by + Lehman's, it may still be of some value. + +5. "The No BS Guide to teTeX Font Installation" + by Donovan Rebbechi + http://www.pegasus.rutgers.edu/~elflord/unix/latex/no-bs.html + May be out of date today, but may still have some useful tips about the + fontinst application. + + + +Installing a euro font in LaTeX, although not always trivial, is a straight +forward task. Furthermore, it is an instructive exercise for learning how +to manually install fonts in LaTeX. Many other fonts are easier to install +as they do not require renaming, and/or have parts that have to be obtained +from multiple sources. So, if you can get a euro font going, you can +probably handle most other fonts you might want to install. Admittedly, +there are also those that are more difficult to install, especially if the +TeX metric and/or dvips map files have not already been created for them. +The installation of such fonts is not covered by the information provided +here. + +The four basic steps for manually installing a (type 1) font under LaTeX are: + +1. Install the actual PostScript font (.pfb) files; +2. Install the .tfm metric files; +3. Install the .sty and .fd files to provide a LaTeX interface; +4. Update the map configuration files and LaTeX directory lookup (hash) + tables. + + +The euro font has a number of issues that make it a tad more difficult +to install than most LaTeX fonts. The euro standards commission: + +http://europa.eu.int/euro/ + +originally mandated that the official standard euro symbol should always be +rendered in the sans style even if the surrounding text uses a different +style. This requirement violated traditional typesetting conventions and +was later overturned. However, this policy did cause a rift as to what was +considered the "proper" thing to do. + +Also, several different vendors/individuals have made their own versions of +the euro symbol using their interpretations of what it meant to have a +serf euro. + +Furthermore, LaTeX is independent of the type of fonts used - it can use +bitmap (Type 3), PostScript (Type 1 and 1C) and even fonts of the future +that haven't even been thought of yet - LaTeX could care less what is used +to describe the glyph shapes, it only needs to know the height, depth, and +width of each glyph. + +All of this results in the fact that there are several types of euro fonts +(and LaTeX packages) to choose from. So, I have to make a judgement call +as to what to recommend to use here. + +I assume that you want a Type 1 Postscript font as opposed to anything +bitmapped - this will help ensure the best quality rendering possible for a +given printer resolution. I will also assume here that the LaTeX system +you have does not already have any support for Type 1 euro glyphs, as is +often the case. + +Adobe gives out a free set of PostScript Type 1 euro fonts. +See: + +http://www.adobe.com/type/eurofont.html + +However, Adobe does not allow its fonts to be bundled with other software +products. This is why the fonts cannot be already pre-loaded in the LaTeX +distributions and LaTeX users must manually obtain and install them. + +[Note: Also worthy of consideration is Martin Vogel's marvosym package: + http://www.ctan.org/tex-archive/fonts/psfonts/marvosym/ + which includes several euro symbols as well as other symbols such + as astronomy, structural engineering, zodiac, and the "CE" symbol. + The marvosym package is licensed under the GPL.] + +This guide will focus on the use of the Adobe euro fonts. Now, you do not +have to register, but can get the needed Adobe euro font files directly +from: + +Windows and Unix: +ftp://ftp.adobe.com/pub/adobe/type/win/all/ +eurofont.exe +eurofont.txt + +Mac: +ftp://ftp.adobe.com/pub/adobe/type/mac/all/ +eurofont.sea.hqx +eurofont.txt + +Note that the file eurofont.exe is actually a zip file that is self +extracting when run under Windows. Unix users can do a: + +unzip eurofont.exe + +to unpack it. + + + +STEP #1 - INSTALL THE ACTUAL POSTSCRIPT FONT FILES + +Now, the eurofont.txt will tell you that you need ATM - ignore this since +you are using LaTeX and will have to do a manual install of the font files. +You can install them into MS Windows using Adobe ATM, but even if you do, +you will still have to follow the instructions here. + +The Adobe font files will have strange looking names. You are primarily +interested in the ones that end in PFB ("Printer Font Binary" - but +"PostScript Font Binary" might be a better name). These contain the +PostScript code which describes what the glyphs look like. It is these +files (or portions of them) that get embedded into your PostScript or PDF +output files. The AFM (Adobe Font Metric) files describe the size of the +boxes each glyph takes up. The PFM files do the same thing, but are used +only by the MS Windows system. LaTeX does not use AFM or PFM files, but +rather uses TFM (TeX Font Metric) files. There is a program (afm2tfm) that +can convert AFM to TFM, but you don't need this as the TeX/LaTeX developers +have done this for you already. Some font conversion programs (e.g., ps2pk) +may require access to the AFM or PFM files. The INF files describe the +fonts to Windows - so you don't need them (but, if curious, you can find +the formal font names listed within them). + +Now, rename the PFB files from the archive as follows: + +_1______.PFB -> zpeurs.pfb +_1B_____.PFB -> zpeubs.pfb +_1I_____.PFB -> zpeuris.pfb +_1BI____.PFB -> zpeubis.pfb +_2______.PFB -> zpeurt.pfb +_2B_____.PFB -> zpeubt.pfb +_2I_____.PFB -> zpeurit.pfb +_2BI____.PFB -> zpeubit.pfb +_3______.PFB -> zpeur.pfb +_3B_____.PFB -> zpeub.pfb +_3I_____.PFB -> zpeuri.pfb +_3BI____.PFB -> zpeubi.pfb + + +The new names are, more or less, based on Karl Berry's scheme for TeX font +names. For more information on this topic, see Karl Berry's "Filenames +for TeX Fonts": http://www.ctan.org/tex-archive/info/fontname/fontname.pdf + +Now, find your texmf directory where your LaTeX system is installed. I'll +call this directory "<texmf>". (You may wish to use the local tree +"<texmf-local>", or "localtexmf" under MiKTeX, instead so that your changes +will remain even after the system is upgraded.) Go to +<texmf>/fonts/type1/adobe and make a directory called "eurofont". Copy all +the renamed .pfb files into <texmf>/fonts/type1/adobe/eurofont + +[Note: Some PostScript font files come in ASCII, not binary. Such ".pfa" + files would go in the same directory as their pfb equivalents. Any virtual + font files ".vf" would go in the <texmf>/fonts/vf/ directory tree.] + +You may also want to do the same with the AFM and PFM files so that certain +font conversion programs can access these as well. Put the renamed AFM and +PFM files in <texmf>/fonts/afm/adobe/eurofont and +<texmf>/fonts/pfm/adobe/eurofont, respectively. + +Unix users will have to have super user privileges to make changes to the +<texmf> directory. + + + +Now, LaTeX's configuration will have to be updated so that it knows about +the new Adobe euro fonts. + + +Of the several LaTeX packages that do this, I think that two are the best. +The most complete, and complex, is Rowland McDonnell's eurofont package: + +http://www.ctan.org/tex-archive/macros/latex/contrib/eurofont/ + +This is an EXTREMELY comprehensive (and high quality) work. The user's +guide alone is over 60 pages. But, I'll show here how to install the +leaner, LaTeX euro package (this actually consists of two smaller LaTeX +packages "europs" and "eurosans"): + +http://www.ctan.org/tex-archive/fonts/euro/ + +Download and unpack this euro package archive. The readme.txt tells what +to do. But, I'll repeat the steps here in my own words. I will show how +to do things manually rather than rely on any automated install scripts. + +Some of these files (including the tfm and map files) may already be +installed in some LaTeX systems, you don't have to reinstall them if +that is the case. + + + +STEP #2 - INSTALL THE TFM METRIC FILES + +The tfm subdirectory (of the unpacked euro.tar.gz or euro.zip archive) +contains the tfm files for the Adobe fonts you just installed. These tfm +files need to be copied to: +<texmf>/fonts/tfm/adobe/eurofont +make this /eurofont directory as needed. + + + +STEP #3 - INSTALL THE .sty and .fd FILES TO PROVIDE A USER INTERFACE + +OK, now at this point the LaTeX system has access to the PostScript +descriptions of the glyphs and their size metrics. Now, you need to provide +LaTeX with set of names that the euro glyphs will be called by. + +In the latex subdirectory of the archive there will be two packages: europs +and eurosans. eurosans restricts it's use to the sans euro because many +people who are knowledgeable in the typographic field feel that the sans +euro better matches with most fonts, including many popular serif ones such +as Times. eurosans also allows the user to specify an arbitrary scaling +factor so that the size of the euro can be adjusted (if needed) to more +closely match that of the surrounding text. The europs package allows you +to decide if you want a serif euro. It is easy enough to install them both. + + +Now, in your <texmf>/tex/latex directory, make a directory called +"euro" i.e., <texmf>/tex/latex/euro. + +Copy the eurosans.sty file into <texmf>/tex/latex/euro. + +Now, in the europs package will have a europs.dtx and a europs.ins file. +Run latex on the europs.ins (e.g., latex europs.ins) to make the europs.sty +and the uzpeu.fd, uzpeus.fd, uzpeut.fd files. Copy these four files into +your <texmf>/tex/latex/euro directory just like you did with eurosans.sty. + + + +STEP #4 - UPDATE THE DVIPS/PDFTEX/YAP/XDVI CONFIGURATION FILES + +OK, now LaTeX understands how to use these new fonts and users have LaTeX +commands that refer to them. + +The next step is to also inform dvips, pdfTeX, Yap, and/or xdvi, etc., +so that you can make and view documents with the euro symbol. + +The file you need is "zpeu.map" which is found in the dvips subdirectory of +the archive. There is also a "zpeu-origname.map" which will allow the use +of the original Adobe names (e.g., "_1______.PFB"), but it is best to change +the names, as mentioned previously, to follow the LaTeX convention (so as to +improve clarity and avoid future name clashes). + + +Font map handling has been changed to use an updmap utility in conjunction +with an updmap.cfg configuration file for the newer (teTeX 2.0, MiKTeX 2.4 +and later) LaTeX systems. Use one of the appropriate subsections below +depending on your system: + + +-- For Systems Older Than teTeX 2.0 or MiKTeX 2.4 -- +Copy zpeu.map to your <texmf>/dvips/config directory. Now, in your +<texmf>/dvips/config directory, edit your config.ps file (with a text editor) +and add the following line (somewhere after the "p psfonts.map" line - there +will be a bunch of other "p +" lines in this area): + +p +zpeu.map + +Save the changes to config.ps. + +For pdfTeX (and pdfLaTeX), the line: + +map +zpeu.map + +should be added to the pdftex.cfg file in the <texmf>/pdftex/config +directory (there is no need to make another copy of the zpeu.map file as +pdfTeX will know to look for it in dvips' config directory). + +MiKTeX users will also want to add to the line: + +p +zpeu.map + +to the <texmf>\miktex\config\config.makepk file so that Yap can find the +font if it does not already look at dvips' config.ps file. + +MiKTeX users may also want to add the lines contained in the zpeu.map to +<texmf>\miktex\dvips\ps2pk\ps2pk.map for other applications that may need +it. + +MetaPost users may want to add the lines contained in the zpeu.map file to +the <texmf>/dvips/config/psfonts.map file as that is what MetaPost relies +on. + +Older versions of xdvi that rely on gsftopk (to convert Type 1 fonts to +bitmap form) may also require the psfonts.map file to be updated. Newer +versions of (the Kpathsea enabled version "xdvi-k") xdvi are able to render +Type 1 fonts directly from the .pfb files. See Stefan Ulrich's xdvi-k site +on Sourceforge for details: +http://xdvi.sourceforge.net/ + +Note that versions of dvips prior to V5.83 have a bug with partial font +downloading that may cause a dvips error when using some types of fonts, +like the euro packages. (The error messages can be like: "File <xxx.pfb> +ended before all chars have been found" or "xx Subr not found", etc.) +If you encounter this, the workaround is to update dvips or use the +-j0 option: + +dvips -j0 -o myfile.ps myfile + +Thanks to Dan Luecking for posting much information about map file +configuration. + +OK, now all the files are in place. Most TeX systems (teTeX Unix and MiKTeX +Windows) need to be told to rescan their directories in order to add the +names of all the newly added files to the lookup cache. + +In teTeX (and fpTeX), the command to run is "texhash" or "mktexlsr". + +In MiKTeX it is "initexmf -u" to refresh the filename database and then +"initexmf --mkpsres --search" to rebuild the PostScript resource database. +The MiKTeX Options application has a "Refresh Now" button which does the +same thing. + +These are the same commands that you run after you add any package to +LaTeX's directories. Run this application/command. + + + +-- For teTeX 2.0, MiKTeX 2.4 and Newer Systems -- +Copy zpeu.map to your <texmf>/fonts/map/dvips/misc directory. Edit the +<texmf>/web2c/updmap.cfg file with a text editor and add the line: + +Map zpeu.map + +Now, you will have to refresh the directory lookup (hash) tables so +that the LaTeX system can see the new zpeu.map file in the lookup cache. + +In teTeX (and fpTeX), the command to run is "texhash" or "mktexlsr". + +In MiKTeX use "initexmf -u" to refresh the filename database. The +MiKTeX Options application has a "Refresh Now" button which does the +same thing. + +Now, for teTeX 2.0 and MiKTeX systems, run the "updmap" command to update +the map file configuration. For teTeX 3.0 and later, the command you will +likely want to run is "updmap-sys" which updates the map files system-wide +(as "updmap" does in teTeX 2.0). (Under teTeX 3.0 and later, "updmap" updates +the map file settings only for the current user.) + + + +HOW TO USE THE EURO GLYPHS + +Now, you can use the euro packages. + +To use eurosans.sty, just: + +\usepackage{eurosans} + +and then \euro will produce the euro symbol that will be in sans. The other +attributes (series, shape) will vary with that of the surrounding font. + + +To use europs.sty, do a + +\usepackage{europs} + +then + +\EUR will produce a euro symbol that varies with the current font family +(serif, sans, or mono). +\EURofc will produce an "official" (old commission policy) euro symbol +that is always in sans. There is also: + +\EURhv (Euro-Sans) +\EURtm (Euro-Serif) +\EURcr (Euro-Mono) + + + +That was easy right? Enjoy! ;) + + + Mike Shell + +***********************************