.MF

MF File

Metafont Source File
Ask a question
QUICK ANSWER

A MF file is a plain-text program written in Donald Knuth's Metafont language that describes a font by pen strokes and parameters. Any text editor opens it for reading; to build a usable font, compile it with the 'mf' program from a TeX distribution (TeX Live, MiKTeX, or MacTeX). If your file is named MANIFEST.MF, it is a Java JAR manifest - an unrelated format that shares the extension.

Developer: Donald E. Knuth (Metafont system, part of the TeX project) Category: Developer Files Open standard MIME: text/plain
OPENS ON Windows macOS Linux
Related: .DO · .MD · .HEX · .XSD

On this page

19k+ extensions indexed
Last reviewed Jul 8, 2026

Not sure what your file is?

Drop any file into our identifier - we read just the first bytes to name the format.

Identify a file

What is the MF file format?

.mf is a plain-text source file written in the Metafont programming language, created by Donald E. Knuth as part of the TeX typesetting system. Rather than describing glyphs as fixed outlines, a .mf file defines letterforms programmatically using pen strokes, curves, and parametric equations - letting a single source file generate fonts at any resolution or optical size by adjusting variables.

To produce usable output, a .mf file is compiled by the mf command-line program (included in distributions such as TeX Live and MiKTeX). The compiler takes the source along with a mode specification (e.g., ljfour for a LaserJet at 600 dpi) and produces two outputs:

  • A .TFM metric file that TeX reads for character widths, heights, and kerns.
  • A .GF or .PK bitmap file containing rasterized glyphs at the target resolution.

The files are ASCII text with no magic bytes or binary header. Typical statements include mode_setup;, beginchar(...);, pickup pen;, and endchar;, ending the program with end. The companion format MetaPost (.mp) later extended Metafont's language for general vector graphics.

Metafont remains in active use because the Computer Modern and AMS typeface families - the default fonts of TeX and LaTeX - are distributed as .mf source. Editing requires knowledge of the Metafont language; any plain-text editor can open the files, though dedicated TeX editors such as TeXstudio provide syntax awareness.

Security & safety

RISK: LOW

A Metafont .mf is plain text and contains no executable machine code, so reading it is safe. Compiling runs the trusted 'mf' interpreter from a TeX distribution. The only confusion risk is mistaking it for a JAR MANIFEST.MF; both are harmless text, but they belong to entirely different toolchains.

Format details

in a nutshell
FULL NAMEMetafont Source Fileaka METAFONT file, Metafont program
DEVELOPERDonald E. Knuth (Metafont system, part of the TeX project)since 1979 (Metafont); rewritten Metafont84 (1984)
MIME TYPEtext/plain
TYPEPlain-text font-description program (Metafont language source)
STANDARDOpen · royalty-free
This extension is also used by…
  • Java/JAR MANIFEST.MF - Inside a JAR, META-INF/MANIFEST.MF is a plain-text manifest (Main-Class, versions) - the likely source of the DB's 'Sun Microsystems' developer tag.
  • Maven / build metadata .mf - Some Java tooling and OSGi bundles ship manifest fragments with a .mf extension; plain text key:value pairs.

Programs that open MF files

Windows2 apps
MiKTeX (mf compiler) Open-source Install MiKTeX, then run 'mf <file>.mf' (or 'mf \mode=localfont; input file') in a terminal to compile to .tfm/.gf. Read/edit the source in any text editor.
Text editor (Notepad++, VS Code) Open-source Open the .mf to read or edit the Metafont source (it's plain text). Compiling still needs the 'mf' program.
macOS2 apps
Text editor Open-source Open the .mf to read/edit the source; use TextEdit (plain text mode) or any code editor.
MacTeX (mf compiler) Open-source Install MacTeX, then run 'mf' in Terminal to compile the .mf. Edit the source in any editor.
Linux2 apps
Text editor Open-source Open the .mf to read or edit the Metafont source.
TeX Live (mf compiler) Open-source Install texlive, then 'mf file.mf' compiles it to .tfm/.gf. Edit the source in any text editor.

Technical details

deep spec
Format typePlain-text Metafont-language source program; defines font glyphs as programs, not fixed outlines
Character encodingASCII; no multi-byte characters in the Metafont language itself; files open without conversion in any plain-text editor
Magic bytes / signatureNone - no binary header; identified by the `.mf` extension and leading Metafont keywords such as `mode_setup;`
MIME type`text/plain`; `application/x-metafont` used informally by some TeX tools
Compiler`mf` program, invoked as `mf '\mode=localfont; input fontname'`; included in TeX Live, MiKTeX, and MacTeX
Compilation outputsA `.tfm` metric file (character widths, heights, kerns for TeX) and a `.gf` or `.pk` bitmap at the chosen device resolution
Resolution / mode parameterTarget device and DPI chosen at compile time via a mode name (e.g., `ljfour` = 600 dpi LaserJet); changing the mode regenerates the bitmap
Parametric design modelGlyph shapes defined by pen strokes and numeric variables; adjusting one parameter (e.g., `stem#`) consistently rescales all dependent glyphs
Constraint solvingThe Metafont interpreter solves systems of linear equations simultaneously to position points - shapes are stated as constraints, not absolute coordinates
Checksum pairingThe `mf` compiler embeds a checksum in the companion `.tfm` file binding it to the generated bitmap; the `.mf` source itself carries no checksum
Color supportMonochrome (1-bit) only - Metafont rasterizes glyphs as black-and-white bitmaps; no grayscale or color output
Typical file sizeA few KB to tens of KB; a complete typeface family consists of dozens of `.mf` files sharing a common base file
Base macro libraryComputer Modern uses `plain.mf` and `cm` base files; any `.mf` source may `input` shared macro files to inherit definitions
Active use caseComputer Modern and AMS typeface families (default TeX and LaTeX fonts) are distributed as `.mf` source and compiled on demand by TeX distributions
Successor formatMetaPost (`.mp`) extended the Metafont language to produce scalable PostScript/SVG vector output instead of bitmaps
Released1979 (Metafont); rewritten Metafont84 (1984)
Latest versionMetafont version 2.71828… (asymptotically approaching e; current since the 1990s)
Open standardYes · royalty-free
Specificationwww.tug.org

MF conversions

Community Q&A

asked by users
Ask a quick question
Get help from people who work with MF files. Be specific - include your system and software version.
No account needed · answers usually within a day

No questions yet - be the first to ask about MF files.

Frequently asked questions

How do I open a .mf file?
Open it in any text editor to read the Metafont source. To actually build the font, compile it with the 'mf' program from a TeX distribution (TeX Live, MiKTeX, or MacTeX).
What is a Metafont (.mf) file?
It's a program written in Donald Knuth's Metafont language that describes a font by pen strokes and parameters. The 'mf' compiler turns it into TeX metrics (.tfm) and bitmaps (.gf/.pk).
Is a .mf file the same as MANIFEST.MF?
No. MANIFEST.MF is a Java JAR manifest (plain-text metadata inside a .jar). A Metafont .mf is a TeX font source. They share the extension but are unrelated - check the filename and content.
How do I compile a .mf into a usable font?
Run 'mf \mode=localfont; input yourfont' (or simply 'mf yourfont.mf') after installing TeX Live/MiKTeX. It outputs a .tfm and a resolution-specific .gf/.pk bitmap you then place where TeX looks for fonts.
Can I convert a Metafont .mf to TrueType/OpenType?
Not directly or cleanly. Tools like mftrace can trace Metafont bitmaps into outlines for FontForge, but it's an advanced, lossy workflow rather than a simple converter.

References

1TUG - Metafontwww.tug.org
2CTAN - Metafont packagewww.ctan.org

Keep exploring

across the database

Top extensions this week

1.AQQAQQ Instant Messenger File
2.CRDOWNLOADChrome Partial Download File
3.MDMarkdown Document
4.BCBitComet Incomplete Download File
5.PARTPartial Download File
6.BINCD/DVD Disc Image (BIN/CUE)
7.EXEWindows Executable (Portable Executable)
8.AVIFAV1 Image File Format (AVIF)
9.RPMSGRestricted Permission Message
10.NOMEDIAAndroid No-Media Marker File

Related extensions

.DOStata Do-File
.MDMarkdown Document
.HEXIntel HEX File
.XSDXML Schema Definition
.MAPSource Map (JavaScript / CSS)
.CONFIGConfiguration File

Free file tools

An in-browser file identifier and image converter - everything runs on your device.

Open the toolbox

Browse file extensions A-Z