Adding Glyphs to PDFs with PDFTeX on MacOS Catalina
In this article, we will explore how to add custom glyphs to PDF documents using the PDFTeX system on MacOS Catalina. We will cover the key concepts and provide detailed instructions on how to accomplish this task. This article assumes that you have a basic understanding of how to use the command line on MacOS.
Introduction to PDFTeX
PDFTeX is a typesetting system that is used to create high-quality PDF documents. It is based on TeX, a typesetting system that was first developed in the 1970s by Donald Knuth. PDFTeX is an extension of TeX that allows you to create PDF documents directly, without having to go through an intermediate DVI or PostScript stage. This makes it an ideal choice for creating PDF documents that include custom glyphs.
Adding Custom Glyphs
To add custom glyphs to a PDF document using PDFTeX, you will need to create a font that includes the glyphs that you want to use. There are several tools that you can use to create fonts, including FontForge and the MetaFont language. Once you have created a font that includes the glyphs that you want to use, you can use PDFTeX to include that font in your PDF document.
Using PDFTeX to Include a Font
To use PDFTeX to include a font in a PDF document, you will need to use the \fontfamily command. This command allows you to specify the font that you want to use for a particular piece of text. For example, the following command will use the Arial font for the text that follows:
\fontfamily{arial}\selectfont This is some text in the Arial font.To use a custom font that you have created, you will need to specify the path to the font file using the \pdfmapfile command. For example, the following command will use the MyFont font that is located in the /fonts directory:
\pdfmapfile{=/fonts/myfont.map}Once you have specified the path to the font file, you can use the \fontfamily command to use the font in your document. For example:
\pdfmapfile{=/fonts/myfont.map}
\fontfamily{myfont}\selectfont This is some text in the MyFont font.Creating a PDF with PDFTeX
To create a PDF document with PDFTeX, you will need to use the pdflatex command. This command will compile a LaTeX document and create a PDF file. For example, the following command will create a PDF file called mydocument.pdf from a LaTeX file called mydocument.tex:
pdflatex mydocument.texIn this article, we have explored how to add custom glyphs to PDF documents using the PDFTeX system on MacOS Catalina. We have covered the key concepts and provided detailed instructions on how to accomplish this task. With the information in this article, you should be able to create high-quality PDF documents that include custom glyphs.
References
Donald Knuth. The TeXbook, Volume A of Computers and Typesetting, Addison-Wesley, 1986.
Jonathan Kew. PDFTeX: A simple guide, https://tex.stackexchange.com/questions/112389/pdft%C3%A9x-a-simple-guide
FontForge. https://fontforge.github.io/
MetaFont. https://www.ctan.org/pkg/metafont