How exactly is the font Computer Moder stored on my hard drive?

I know that Computer Modern was designed using METAFONT and that METAFONT only outputs bitmaps. So does my hard drive actually just contains the geometric description of the font, and whenever TeX is executed it calls METAFONT to generate the bitmaps needed for this specific source file? Does it generate the font on each execution again? Does this mean that my final PDF contains a bitmap for each symbol I used in each variation (larger, bold, italic, ...) in a pretty high resolution (zooming in using Acrobat Reader has not shown any pixelation)?

If it is not the case that the font is always generated "on the fly", how can such an easy customization of Computer Modern be possible as demonstrated e.g. here.

  • No, there are vector outlines of Computer Modern that were made by BlueSky (etc.), and these Type1 scalable fonts are what are normally used. You actually have to fight the defaults to get the bitmap fonts (and you probably don't want them—they don't look great on screen). – ShreevatsaR Jun 23 '17 at 22:41
  • The Computer Modern fonts have long been made into Type1, so they needn't be generated as bitmaps. – egreg Jun 23 '17 at 22:42
  • @egreg And these Type1 fonts, are they generated by some modern version of METAFONT, so that they are easily tweakable from inside LaTeX? And are they generated any time LaTeX is run? – M. Winter Jun 23 '17 at 22:50
up vote 4 down vote accepted

Nowadays normally the type1 version of the font is used which is resident in your texsystem. You can force the use of the bitmap version e.g. by disabling the map file:

\documentclass{article}
\pdfmapfile{}

\begin{document}
Hello

\end{document} 

Then you will get this: enter image description here

The bitmap font is created once (for each font size) and then stored in your texsystem. You can find the exact location at the end of the log-file:

 XXX\AppData\Local\MiKTeX\2.9\fonts\pk\ljfour\public\cm\dpi600\cmr10.pk
  • Thank you! What software is used by LaTeX to generate these type1 files and is it similar enough to METAFONT to make sense to learn METAFONT? And these type1 fonts are also generated once (during their first use ever I guess), and then used when needed again? – M. Winter Jun 23 '17 at 23:19
  • 1
    @M.Winter -- the type 1 fonts were not generated by metafont, nor are they (re)created by any latex-related software. they were recreated using a professional font development program (possibly fontographer; i'm not certain and i don't have the ability to check just now), then reviewed and refined by individuals with typography experience (including hermann zapf). they are now "frozen", and available from ctan and included in tex live. as for whether it makes sense to learn metafont, that's an entirely different question, but probably not for "western" alphabets. – barbara beeton Jun 24 '17 at 0:29
  • @M.Winter If you want to experiment, you could use MetaPost (which has almost the same input as MetaFont except for the font-specific parts) to generate the outline of each character as a PostScript file, and then create a PostScript font from those outlines plus the kerning information, etc. But if you just want to use the fonts, don't bother. But for drawing diagrams etc in LaTeX, you might prefer tickz or asymptote to MetaPost, unless you enjoy doing things the minimalist hard way! – alephzero Jun 24 '17 at 3:09
  • @barbarabeeton I do not understand completely! If these fonts where frozen up to the vector graphic description layer, then how is it that I can still slightly modify them in my LaTeX code, e.g. make them a bit bolder as stated in my question. In my opinion this has to generate a unique font (the vector graphics) uniquely for my document. – M. Winter Jun 24 '17 at 7:19
  • 1
    @M.Winter -- one of the features of type 1 vector fonts is that some features (e.g. stem width, slant) can be modified at the time of use by programmatic instructions. the type 1 specs have been published, so are available to programmers to study and use. fonts modified in this way are not stored separately, but are regenerated at run time within the document from the extra instructions included there. only the basic type 1 "pattern" is stored permanently. – barbara beeton Jun 24 '17 at 12:00

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.