What is MIME type "application/x-font-adobe-metric"?
A MIME type is a string that tells browsers and other tools how to handle a particular kind of file.
This MIME type, application/x-font-adobe-metric, is used for files that store font metrics data. This data defines how a font is measured. It contains numeric values for character dimensions, spacing, and kerning. These details help software render text accurately on screen and in print.Software in graphic design and desktop publishing uses these metrics to ensure that fonts display consistently. They factor in the exact sizes and spacings needed for professional layouts.
- Main use: Provides measurement data for precise text layout.
- Other uses: Supports digital typography and high-quality print production.
- Key fact: Contains values like character width, kerning pairs, and baseline positions.
For more details, see the Adobe Font Metric reference on Wikipedia.
Associated file extensions
Usage Examples
HTTP Header
When serving content with this MIME type, set the Content-Type header:
Content-Type: application/x-font-adobe-metric
HTML
In HTML, you can specify the MIME type in various elements:
<a href="file.dat" type="application/x-font-adobe-metric">Download file</a>
Server-side (Node.js)
Setting the Content-Type header in Node.js:
const http = require('http');
http.createServer((req, res) => {
res.setHeader('Content-Type', 'application/x-font-adobe-metric');
res.end('Content here');
}).listen(3000);
Associated file extensions
FAQs
What is the purpose of the application/x-font-adobe-metric MIME type?
This MIME type identifies files containing Adobe Font Metrics (AFM), which store measurement data for Type 1 fonts. These files define character widths, kerning pairs, and spacing, allowing software to calculate text layout precisely without needing the actual font outline file.
How do I configure my server to serve .afm files correctly?
For Apache, add AddType application/x-font-adobe-metric .afm to your .htaccess or config file. For Nginx, add types { application/x-font-adobe-metric afm; } inside your http or server block to ensure the correct Content-Type header is sent.
Can web browsers render application/x-font-adobe-metric files?
No, browsers do not natively render these files because they contain raw metric data (text) rather than visual glyphs. Modern web design uses formats like WOFF2 for display, while .afm files are typically used by server-side PDF generation libraries (like FPDF) or desktop publishing tools.
Is an AFM file the same as the font file itself?
No, the AFM file only contains the "metrics" (measurements) and lacks the visual shapes of the letters. It usually accompanies a binary font file, such as a .pfb (Printer Font Binary), which contains the actual vector outlines used for printing and display.
Why does this MIME type start with "x-"?
The x- prefix indicates that application/x-font-adobe-metric is a non-standard type that was not officially registered with the IANA. Despite this, it is the widely accepted convention for serving .afm files on the web.
How can I open or view an .afm file?
Since AFM files use a plain text format, you can open them with any standard text editor like Notepad, TextEdit, or VS Code. You will see a list of keys and values detailing the dimensions of every character in the font set.
Why am I getting font errors when generating PDFs with PHP?
If you are using libraries like FPDF or TCPDF, missing or unreadable .afm files often cause errors because the script cannot calculate string widths. Ensure your application/x-font-adobe-metric files are present in the font directory and have the correct read permissions.
General FAQ
What is a MIME type?
A MIME (Multipurpose Internet Mail Extensions) type is a standard that indicates the nature and format of a document, file, or assortment of bytes. MIME types are defined and standardized in IETF's RFC 6838.
MIME types are important because they help browsers and servers understand how to process a file. When a browser receives a file from a server, it uses the MIME type to determine how to display or handle the content, whether it's an image to display, a PDF to open in a viewer, or a video to play.
MIME types consist of a type and a subtype, separated by a slash (e.g., text/html, image/jpeg, application/pdf). Some MIME types also include optional parameters.
How do I find the MIME type for a file?
You can check the file extension or use a file identification tool such as file --mime-type on the command line. Many programming languages also provide libraries to detect MIME types.
Why are multiple MIME types listed for one extension?
Different applications and historical conventions may use alternative MIME identifiers for the same kind of file. Showing them all helps ensure compatibility across systems.