Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Metafont
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Modes of operation== Metafont is most often run as a helper to output device (printer, screen) drivers; in those cases, its job is to generate bitmaps for a font for a specific combination of output device (called a ''mode'' in Metafont) and [[Dots per inch|resolution]] (visible in the name of the output file, see below). These bitmaps are typically stored for later reuse, so that Metafont does not have to be run every time a document is displayed, but on the other hand TeX distributions with a Metafont component have typically not included any prebuilt bitmap fonts, since they would be rather large in comparison to the sources from which they could be generated. Since Metafont fonts were traditionally the TeX default from which other font formats were exceptions, an incomplete installation of a non-Metafont font can sometimes result in Metafont being called and emitting a confusing "''somefont''.mf not found" error message. Equally important, but not as common, is running Metafont to generate a font metric (TFM) file; a TFM file is only generated if the ''fontmaking'' variable is positive. Traditionally TeX distributions have often come with all TFM files pregenerated (since they are pretty small), but someone installing a Metafont font from sources will have to generate its TFM file before TeX can use it. A third way of operating Metafont is ''proof mode'': if the ''proofing'' variable is positive then the bitmap font file also contains additional information provided via <code>special</code> commands, in particular the positions and names of points the font designer considered important for the design. If using the separate <code>gftodvi</code> utility to generate enlarged images of the font glyphs, this information from specials is included; point positions are not limited to pixel resolution. Metafont can also be run interactively, and has commands for displaying on the screen the images it produces. Knuth has said that he uses Metafont as a kind of desk calculator for solving complicated equations, though he now uses MetaPost for mathematical illustrations. <!-- could say something here about alternatives β e.g. vector versions such as pdftex uses --> Metafont can render any kind of graphical output, not just glyphs. However, [[MetaPost]] and [[Asymptote (vector graphics language)|Asymptote]] are preferred for mathematical illustrations. Metafont is most commonly invoked without a direct request from the user. [[DVI file format|DVI files]] can only contain references to typefaces, rather than the sets of raster or vector glyphs that other formats like PostScript allow. Consequently, the glyphs in the typefaces need to be accessed whenever a request is made to view, print or convert a DVI file. ===Output files=== Metafont outputs several kinds of files: for a file called NAME.mf, it can output: * NAME.NNNNgf β File with raster output at resolution NNNN (2602 by default). * NAME.tfm β File with [[TeX font metric]] information, which is the information TeX needs. Usually metafont has to be told to generate this file. * NAME.log β Log file output from processing After running Metafont, typically one uses the gftopk program to convert the NNNNgf files to pk (packed) format (.NNNNpk). The pk format was primarily introduced to reduce file size (to about half), but expected to also speed up processing since less data would have to be [[input/output]]. The GF and PK formats both employ [[run-length encoding]] of bitmaps, but make different binary encodings of the run-lengths. The PK format also does some preprocessing of the bitmaps (bounding box, eliding repeated rows) and encodes all rows of a character as one long bit-sequence.<ref>{{cite journal |last1=Rokicki |first1=Tomas |title=Packed (PK) Font File Format |journal=TUGboat |date=1985 |volume=6 |issue=3 |pages=115β120 |url=https://www.tug.org/TUGboat/tb06-3/tb13pk.pdf |archive-url=https://web.archive.org/web/20111106100403/http://tug.org/TUGboat/tb06-3/tb13pk.pdf |archive-date=2011-11-06 |url-status=live |access-date=2019-08-09}}</ref> In the ''TeX Directory Structure'' standard, filenames are limited to 8+3 characters, so GF and PK files would only have extensions <code>.gf</code> and <code>.pk</code>. Files for different resolutions are kept apart by placing them in separate directories, named <code>dpi</code>NNNN, e.g. <code>dpi300/cmr10.pk</code>.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Metafont
(section)
Add topic