2

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.

M. Winter
  • 531
  • 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

1 Answers1

4

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
Ulrike Fischer
  • 327,261
  • 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 00: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 03: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 07:19
  • There are lots of type1 fonts, including versions for bold and italic and others. Check at the end of log of a pdflatex compilation for files ending with .pfb. – Ulrike Fischer Jun 24 '17 at 08:02
  • @UlrikeFischer I cannot imagine that any combination of any font family in any size with any style, shape, etc. is present on my computer, or even on the internet. I mean I can do stuff like this or this. This must have been created on the fly, right? – M. Winter Jun 24 '17 at 10:04
  • Hmm. We are getting philosophical. When you have an image and resize or rotate or distort or slant it when including it in a document do you call this creation on the fly? When you color your font is that a creation? – Ulrike Fischer Jun 24 '17 at 10:24
  • 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
  • @barbarabeeton Thank you very much. This clarified everything! Until know I believed that type1 was just a set of bezier curves for each letter. If you are going to wrap this in an own answer I am ready to accept it. Otherwise I would accept this answer because your helpful comment can be found here. – M. Winter Jun 24 '17 at 15:48