[Tex/LaTex] Using a Local Font for a Few Maths Symbols

fontssymbols

To be compatible with my publisher, I had to make my own font (using fontforge) for a few math symbols. However, I could not figure out how to get latex to use my font, so I ended up just making a pdf/eps with just one symbol for each symbol and including the pdf/eps as a graphic. This works, but now compilation takes forever even when there's only a few pages.

So, how do I get latex to use my font directly rather than include graphics? I need a solution that lets my coauthors simply check out our directory and compile (possible with special flags and stiff) via both latex and pdflatex on both Windows and Linux (assuming they have appropriate packages in the miktex and texlive suites installed). That is, any solution that requires me to put files anywhere besides the directory with my latex files or subdirectories thereof unfortunately does not suffice.

Any help would be most appreciated (if there is a solution at all). I'm not an advanced user, so detailed instructions would be desirable. I have access to both Windows and Linux (specifically Ubuntu) machines for creating any necessary files. Thank you!

Best Answer

You need at first a tfm-files with the metrics. (If you have an afm-file it is easy to generate the tfm with afm2tfm.) Put at first the tfm and the pfb in the same folder as your test document to test the font. In a small latex document add the line \pdfmapline{=tfm-name fontname type1.pfb} (with the correct names) and then try the positions where your symbols should be. Here an example how such a test looks like with the wasy font:

\documentclass{article}
\pdfmapline{=wasy10 wasy10 <wasy10.pfb}

\begin{document}
\font\test=wasy10 \test \char62 \char63
\end{document}

When this works make a list of all symbols, their positions, the command names you would want to use, the name of the tfm and the pfb, so that someone can make a you a small sty and a map-file.

Edit: Next step: The map file. As you could see pdflatex can load the mapping information simply with \pdfmapline (or \pdfmapfile), but dvips, dvidpfmx etc need the informations in their maps.

Make a wpl.map which contains the line from the \pdfmapline (without the equal sign). Save it in a local texmf tree in somewhere below /fonts/map/.... While you are at it move also the other files to the local texmf tree. Update the FNDB/run texhash. Then add the map file with updmap-sys (normally) or updmap (miktex and in special cases with texlive). See also the TeX-FAQ: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=instt1font.

Then test again. At first with pdflatex. When it works try with dvips. If it works with pdflatex but not with dvips then the "font name" (the middle entry) in the map line is wrong (dvips is more picky). Check the correct name in the afm, correct in the map and regenerate the maps with udpmap(-sys)

Related Question