RFC 8081
The "font" Top-Level Media Type
Part 1 of 4 π
RFC 8081: The "font" Top-Level Media Type β¨
okay bestie, so this is RFC 8081 π, a Standards Track doc from the Internet Engineering Task Force (IETF). It's written by C. Lilley from the W3C π
and dated February 2017. The ISSN is 2070-1721. The title block doesn't list anything it obsoletes or updates, so there's no drama there π«Ά.
Internet Engineering Task Force (IETF) C. Lilley
Request for Comments: 8081 W3C
Category: Standards Track February 2017
ISSN: 2070-1721
The "font" Top-Level Media Type
Table of Contents πΈ
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
2. Background and Justification . . . . . . . . . . . . . . . . 3
3. Security Considerations . . . . . . . . . . . . . . . . . . . 4
4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5
4.1. Definition and Encoding . . . . . . . . . . . . . . . . . 5
4.2. Fragment Identifiers for Font Collections . . . . . . . . 5
4.3. Registration Procedure . . . . . . . . . . . . . . . . . 6
4.4. Subtype Registrations . . . . . . . . . . . . . . . . . . 6
4.4.1. Generic SFNT Font Type . . . . . . . . . . . . . . . 6
4.4.2. TTF Font Type . . . . . . . . . . . . . . . . . . . . 9
4.4.3. OpenType Layout (OTF) Font Type . . . . . . . . . . . 10
4.4.4. Collection Font Type . . . . . . . . . . . . . . . . 12
4.4.5. WOFF 1.0 . . . . . . . . . . . . . . . . . . . . . . 14
4.4.6. WOFF 2.0 . . . . . . . . . . . . . . . . . . . . . . 15
5. References . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.1. Normative References . . . . . . . . . . . . . . . . . . 16
5.2. Informative References . . . . . . . . . . . . . . . . . 17
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 18
Abstract π
so basically this memo registers and documents the "font" top-level media type, which is the umbrella where font format subtypes can get registered π§. It also doubles as a registration application for a set of intended subtypes. These are representative of some existing subtypes that are already in use, and they're currently registered under the "application" tree by their own separate registrations π¦.
Status of This Memo π
This is an Internet Standards Track document. π₯
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). If you want more info on Internet Standards, check out Section 2 of RFC 7841 π.
Info about the current status of this document, any errata, and how to send feedback on it lives at http://www.rfc-editor.org/info/rfc8081 π
.
Copyright Notice πΈ
Copyright (c) 2017 IETF Trust and the persons identified as the document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, since they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. π«Ά
1. Introduction π¦
okay so setting type in computer systems (and other text presentation systems) uses fonts to give us the visual representations of glyphs β¨. Just like with images, there are a bunch of different ways to represent that visual info. Early font formats often used bitmaps, because they could be carefully tuned for max readability at a given size on low-res screens π. More recently, scalable vector outline fonts have become super widespread π. With these, the outlines of the glyphs are described, and the presentation system renders the outline in the desired position and size. it's giving precision π.
Over time, a number of standard formats for recording font descriptions have evolved π. Internet Media Types [RFC6838] are used to label content that travels over Internet protocols. This document defines a new top-level type "font" according to Section 4.2.7 of [RFC6838] π. This top-level type says the content specifies font data. Under it, different representation formats of fonts can be registered π§.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119] π«Ά.
More to come, bestie π
4.2. Fragment Identifiers for Font Collections π
okay so fragment identifiers for font collections let you pick out one font inside a collection, using its PostScript name (name ID=6) [ISO.14496-22.2015] π«Ά it's a string, max 63 characters, and it has to stick to the printable ASCII subset, codes 33 ? 126. The catch is that the 10 characters [, ], (, ), {, }, <, >, /, and % are forbidden by [ISO.14496-22.2015], so they're not allowed at all π
the next bit is so iconic: 6 more characters could show up in a PostScript name but are forbidden in fragments by [RFC3986], so they must be escaped π
those are ", #, \, ^, `, and |.
once you un-escape the string, if it matches one of the PostScript names in the name table, that font gets selected β¨ for example, "#Foo-Bold" points to the font with PostScript name Foo-Bold, and "#Caret%5Estick" points to the font with PostScript name Caret^stick (the %5E is just the escaped ^, bestie π¦). if the name doesn't match, or there's no fragment at all, the first font in the collection gets matched.
β οΈ don't get too attached to the first font being first! the order of fonts in a collection can change when the font gets revised, so relying on a particular font always being first is unwise π
4.3. Registration Procedure πΈ
so new font formats should be registered using the online form [Media-Type-Registration] π [RFC6838] should be consulted on the registration procedures too. the font specification should preferably be freely available, and if the font format can hold multiple fonts, a fragment identifier syntax should also be defined π
new parameter sub-values might show up later, so heads up π if an implementation doesn't recognize a sub-value in the comma-separated list, it should ignore that sub-value and keep processing the other sub-values in the list. main character energy for graceful degradation π
4.4. Subtype Registrations π
okay this is where the initial entries under the top-level font media type get specified π§ they also act as examples for future registrations, so pay attention!
for each subtype, there's an @font-face format identifier listed. it's for use with the @font-face src descriptor, which is defined by the Cascading Style Sheets Level 3 (CSS3) Fonts specification [W3C.CR-css-fonts-3-20131003]. that spec is normative, and the identifiers here are informative π
4.4.1. Generic SFNT Font Type β¨
Type name: font
Subtype name: sfnt
Required parameters: None
Optional parameters:
there are two optional parameters here, and they're both lists π
outlines(Values: a comma-separated subset of True Type Font (TTF), Compact Font Format (CFF), and SVG): this one tells you what kind of outlines the font provides. the valueTTFshall be used when a font resource has glyph outlines in TrueType format,CFFshall be used to identify fonts with PostScript/CFF outlines [cff-wiki], andSVG[svg-wiki] shall be used to identify fonts that include SVG outlines. TTF, CFF, and SVG outlines can show up in different combos in the same font file, so this parameter is a list of one or more items separated by commas. order in the list doesn't matter π¦layout(Values: a comma-separated subset of OTL, Apple Advanced Typography (AAT), and SIL): this one tells you what kind of advanced text layout support is implemented. the predefined valuesOTL,AAT, andSILmean support for OpenType text layout, Apple Advanced Typography, or Graphite SIL, respectively. one font file can offer more than one shaping and layout mechanism, so again it's a comma-separated list, and the order doesn't matter π
the rest of the template:
- Encoding considerations:
Binary - Interoperability considerations: as it was noted in the first paragraph of the Security Considerations section, one font file can encode the same glyphs using several different representations, like both TrueType and PostScript (CFF) outlines. existing font rendering engines might not be able to handle some of those outline formats, and downloading a font resource that only has an unsupported glyph data format would be futile π so it's really useful to clearly identify the glyph outline format using an optional parameter. that way applications can decide sooner whether to download a particular font resource. the other optional parameter does the same job for the text shaping and layout mechanism π«Ά
- Published specification: ISO/IEC 14496-22 "Open Font Format" (OFF) specification [ISO.14496-22.2015] being developed by ISO/IEC SC29/WG11.
- Applications that use this media type: all applications that are able to create, edit, or display textual media content π
now, font/sfnt is an abstract type. the widely used font/ttf and font/otf types are conceptually derived from it. so font/sfnt is likely to be rare in practice, and it might be limited to:
- uncommon combinations such as
font/sfnt; layout=silthat don't have a shorter type - cases where a new parameter value gets registered
- test cases, experimentation, etc.
Additional information, lowercase-main-character style πΈ
- Magic number(s): TrueType fonts, and OFF / OpenType fonts containing TrueType outlines, should use
0x00010000as the'sfnt'version number. OFF / OpenType fonts containing CFF data should use the tag'OTTO'as the'sfnt'version number π₯ - File extension(s): font file extensions used for OFF / OpenType fonts are
.ttfand.otf. typically,.ttfis only used for fonts with TrueType outlines, whereas.otfcan be used for any OpenType/OFF font, and either can be used with TrueType or CFF outlines π - Macintosh file type code(s): (no code specified)
- Macintosh Universal Type Identifier code:
"public.font" - @font-face Format: None
- Fragment Identifiers: None
- Deprecated Alias: the existing registration
"application/font-sfnt"is deprecated in favor of"font/sfnt"π
the contact is Vladimir Levantovsky (vladimir.levantovsky@monotype.com) π¬
- Intended usage: COMMON
- Restrictions on usage: None
- Author: the ISO/IEC 14496-22 "Open Font Format" specification is a product of the ISO/IEC JTC1 SC29/WG11 π
- Change controller: the ISO/IEC has change control over this specification π¦
4.4.2. TTF Font Type π§
Type name: font
Subtype name: ttf
Required parameters: None
Optional parameters:
one optional parameter here:
- Name:
layout - Values: a comma-separated subset of
OTL,AAT, andSIL
this parameter identifies the type of support mechanism for advanced text layout features β¨ the predefined values OTL, AAT, and SIL mean support for OpenType text layout, Apple Advanced Typography, or Graphite SIL, respectively. a single font file can provide more than one shaping and layout mechanism, so this optional parameter is a list of one or more items separated by commas, and the order doesn't matter π
the rest of the template:
- Encoding considerations:
Binary - Interoperability considerations: as it was noted in the first paragraph of Section 3, one font file can encode the same glyphs using several different representations, like both TrueType and PostScript (CFF) outlines. existing font rendering engines might not be able to process some of those outline formats, and downloading a font resource that only has an unsupported glyph data format would be futile π so it's useful to clearly identify the glyph outline format within a font with an optional parameter, so applications can decide sooner about downloading a particular font resource. the other optional parameter does the same job for text shaping and layout π«Ά
- Published specification: ISO/IEC 14496-22 "Open Font Format" (OFF) specification [ISO.14496-22.2015] being developed by ISO/IEC SC29/WG11 π
- Applications that use this media type: all applications that are able to create, edit, or display textual media content π
- Additional information:
- Magic number(s): TrueType fonts, and OFF / OpenType fonts containing TrueType outlines, should use
0x00010000as the'sfnt'version number π₯ - File extension(s): font file extensions used for TrueType / OFF / OpenType fonts are
.ttfand.otf. typically,.ttfis only used for fonts containing TrueType outlines, while.otfmay be used for any OpenType/OFF font, either with TrueType or CFF outlines π - Macintosh file type code(s): (no code specified)
- Macintosh Universal Type Identifier code:
"public.truetype-font" - @font-face Format:
truetype - Fragment Identifiers: None
- Magic number(s): TrueType fonts, and OFF / OpenType fonts containing TrueType outlines, should use
- Person & email address to contact for further information: Vladimir Levantovsky (vladimir.levantovsky@monotype.com) π
- Intended usage: COMMON
- Restrictions on usage: None
- Author: the ISO/IEC 14496-22 "Open Font Format" specification is a product of the ISO/IEC JTC1 SC29/WG11 π
- Change controller: the ISO/IEC has change control over this specification π¦
4.4.3. OpenType Layout (OTF) Font Type πΈ
okay bestie, this one is the OTF type and it's giving "one file, many outline flavors" π₯ here's the skeleton:
Type name: font
Subtype name: otf
Required parameters: None
Optional parameters
Name: outlines
Values: a comma-separated subset of TTF, CFF, and SVG
The outlines parameter tells you what kind of outlines the font has β¨ The value "TTF" shall be used when a font resource has glyph outlines in TrueType format, "CFF" shall be used for fonts with PostScript/CFF outlines, and SVG shall be used for fonts with SVG outlines. A single font can mix TTF, CFF, and SVG outlines in pretty much any combo, so this param is a list with one or more items separated by commas. The order in the list doesn't matter π
Encoding considerations: Binary
Interoperability considerations: ngl this part is super important π«Ά As we already flagged in the first paragraph of the Security Considerations section, one font file can store the same glyphs in several different representations, like TrueType and PostScript (CFF) outlines π€― Some rendering engines can't handle every outline format, so downloading a font that only has glyph data in a format your app can't read is totally futile π That's why it's useful to label the outline format with that optional parameter. Apps can then decide whether to download a font resource sooner. A second optional parameter tells you what text shaping and layout mechanism the font provides π
Published specification: this is the ISO/IEC 14496-22 "Open Font Format" (OFF) specification [ISO.14496-22.2015], which is being developed by ISO/IEC SC29/WG11 π
Applications that use this media type: literally any app that can create, edit, or display textual media content π
Additional information:
- Magic number(s): TrueType fonts and OFF / OpenType fonts with TrueType outlines should use
0x00010000as the'sfnt'version number π§ OFF / OpenType fonts with CFF outlines should use the tag'OTTO'as the'sfnt'version number. SVG outlines don't have a magic number of their own. They're always paired with either TrueType or CFF outlines, so they use that corresponding magic number π¦ - File extension(s): the font file extensions for OFF / OpenType fonts are
.ttfand.otfπ Typically.ttfis only used for fonts with TrueType outlines, while.otfcan be used for any OpenType/OFF font, whether it has TrueType, CFF, or SVG outlines. - Macintosh file type code(s): (no code specified)
- Macintosh Universal Type Identifier code:
"public.opentype-font" - @font-face Format:
opentype - Fragment Identifiers: None
Person & email address to contact for further information: Vladimir Levantovsky (vladimir.levantovsky@monotype.com) π
Intended usage: COMMON
Restrictions on usage: None
Author: the ISO/IEC 14496-22 "Open Font Format" specification is a product of the ISO/IEC JTC1 SC29/WG11 π
Change controller: the ISO/IEC has change control over this specification π
4.4.4. Collection Font Type π§
Next up is the collection type, which is the one for font bundles π Same vibes as OTF, just packaged together.
Type name: font
Subtype name: collection
Required parameters: None
Optional parameters
Name: outlines
Values: a comma-separated subset of TTF, CFF, and SVG
The outlines parameter works exactly like it does in Section 4.4.3 β¨ "TTF" shall be used when a font resource contains TrueType glyph outlines, "CFF" shall be used to identify fonts with PostScript/CFF outlines, and SVG shall be used to identify fonts with SVG outlines. TTF, CFF, and SVG outlines can show up in different combinations in the same font file, so this optional parameter is a list of one or more comma-separated items, and the order doesn't matter π
Encoding considerations: Binary
Interoperability considerations: this is basically the same story as the OTF type π The first paragraph of the Security Considerations section already pointed out that one font file can encode the same glyphs using multiple representations, like both TrueType and PostScript (CFF) outlines. Some font rendering engines can't process certain outline formats, so grabbing a font resource with only unsupported glyph data is a waste of time π So, labeling the outline format with an optional parameter is useful, since it lets apps decide about downloading a particular font resource sooner. Another optional parameter identifies the text shaping and layout mechanism the font provides π«Ά
Published specification: this is the ISO/IEC 14496-22 "Open Font Format" (OFF) specification [ISO.14496-22.2015], being developed by ISO/IEC SC29/WG11 πΈ
Applications that use this media type: every app that can create, edit, or display textual media content π
Additional information:
- Magic number(s): TrueType fonts and OFF / OpenType fonts with TrueType outlines should use
0x00010000as the'sfnt'version number. OFF / OpenType fonts with CFF outlines should use the tag'OTTO'as the'sfnt'version number. SVG outlines have no magic number. They always come with TrueType or CFF outlines, so they use the matching magic number π¦ - File extension(s): font file extensions for OFF / TrueType and OpenType fonts are
.ttcπ - Macintosh file type code(s): (no code specified)
- Macintosh Universal Type Identifier code:
"public.truetype-collection-font" - @font-face Format:
collection - Fragment Identifiers: See Section 4.2. π§
Person & email address to contact for further information: Vladimir Levantovsky (vladimir.levantovsky@monotype.com) π
Intended usage: COMMON
Restrictions on usage: None
Author: the ISO/IEC 14496-22 "Open Font Format" specification is a product of the ISO/IEC JTC1 SC29/WG11 π
Change controller: the ISO/IEC has change control over this specification π
4.4.5. WOFF 1.0 π
Now we're at WOFF 1.0, the web font format that browsers actually use π
Type name: font
Subtype name: woff
Required parameters: None
Optional parameters: None
Encoding considerations: Binary
Interoperability considerations: None
Published specification: this media type registration updates the WOFF specification [W3C.REC-WOFF-20121213] at W3C π
Applications that use this media type: web browsers use WOFF, often together with HTML and CSS π«Ά
Additional information:
- Magic number(s): the signature field in the WOFF header MUST contain the "magic number"
0x774F4646('wOFF') π₯ - File extension(s):
woff - Macintosh file type code(s): (no code specified)
- Macintosh Universal Type Identifier code:
"org.w3.woff" - @font-face Format:
woff - Fragment Identifiers: None
- Deprecated Alias: the existing registration
"application/font-woff"is deprecated in favor of"font/woff"π
Person & email address to contact for further information: Chris Lilley (www-font@w3.org) π
Intended usage: COMMON
Restrictions on usage: None
Author: the WOFF specification is a work product of the World Wide Web Consortium's WebFonts working group π
Change controller: the W3C has change control over this specification π
4.4.6. WOFF 2.0 π¦
And here's WOFF 2.0, the glow-up of WOFF 1.0 β¨
Type name: font
Subtype name: woff2
Required parameters: None
Optional parameters: None
Encoding considerations: Binary
Interoperability considerations: WOFF 2.0 is an improvement on WOFF 1.0 πΈ The two formats have different Internet Media Types and different @font-face formats, and they may be used in parallel.
Published specification: this media type registration is extracted from the WOFF 2.0 specification [W3C.CR-WOFF2-20150414] at W3C π
Applications that use this media type: web browsers use WOFF 2.0, often together with HTML and CSS π
Additional information:
- Magic number(s): the signature field in the WOFF header MUST contain the "magic number"
0x774F4632('wOF2') π₯ - File extension(s):
woff2 - Macintosh file type code(s): (no code specified)
- Macintosh Universal Type Identifier code:
"org.w3.woff2" - @font-face Format:
woff2 - Fragment Identifiers: See Section 4.2. π§
Person & email address to contact for further information: Chris Lilley (www-font@w3.org) π
Intended usage: COMMON
Restrictions on usage: None
Author: the WOFF2 specification is a work product of the World Wide Web Consortium's WebFonts working group π
Change controller: the W3C has change control over this specification π
5. References π
5.1. Normative References
Here are the normative references, bestie, all of them π«Ά
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997,
<http://www.rfc-editor.org/info/rfc2119>.
[RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform
Resource Identifier (URI): Generic Syntax", STD 66,
RFC 3986, DOI 10.17487/RFC3986, January 2005,
<http://www.rfc-editor.org/info/rfc3986>.
[RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type
Specifications and Registration Procedures", BCP 13,
RFC 6838, DOI 10.17487/RFC6838, January 2013,
<http://www.rfc-editor.org/info/rfc6838>.
[W3C.CR-css-fonts-3-20131003]
Daggett, J., "CSS Fonts Module Level 3", World Wide Web
Consortium CR CR-css-fonts-3-20131003, October 2013,
<http://www.w3.org/TR/2013/CR-css-fonts-3-20131003>.
[ISO.14496-22.2015]
International Organization for Standardization, "Coding of
audio-visual objects Part 22: Open Font Format",
ISO Standard 14496-22, 10 2015,
<http://standards.iso.org/ittf/PubliclyAvailableStandards/c066391_ISO_IEC_14496-22_2015.zip>.
[W3C.REC-WOFF-20121213]
Kew, J., Leming, T., and E. Blokland, "WOFF File Format
1.0", World Wide Web Consortium Recommendation
REC-WOFF-20121213, December 2012,
<http://www.w3.org/TR/2012/REC-WOFF-20121213>.
[W3C.CR-WOFF2-20150414]
Levantovsky, V. and R. Levien, "WOFF File Format 2.0",
World Wide Web Consortium WD CR-WOFF2-20150414, March
2016, <https://www.w3.org/TR/2016/CR-WOFF2-20160315/>.
5.2. Informative References
These ones are the background reading: useful context, but the spec itself doesn't lean on them for anything it requires πβ¨ Here's the full list, exactly as it appears:
[cff-wiki] Wikipedia, "Compact Font Format", November 2016,
<https://en.wikipedia.org/w/
index.php?title=PostScript_fonts&oldid=747740863>.
[opentype-wiki]
Wikipedia, "OpenType", February 2017,
<https://en.wikipedia.org/w/
index.php?title=OpenType&oldid=763528773>.
[truetype-wiki]
Wikipedia, "TrueType", January 2017,
<https://en.wikipedia.org/w/
index.php?title=TrueType&oldid=759367886>.
[svg-wiki] Wikipedia, "Scalable Vector Graphics", February 2017,
<https://en.wikipedia.org/w/
index.php?title=Scalable_Vector_Graphics&oldid=763136508>.
[HTTP-Archive-Trends]
Kuetell, D., "HTTP Archive trend analysis", March 2015,
<http://httparchive.org/trends.php?s=All&minlabel=Nov+15+2
010&maxlabel=Feb+15+2015#perFonts>.
[Font-Media-Type-Analysis]
Kuetell, D., "Web Font Media Type (mime type) Analysis
2015", 2015, <http://goo.gl/zbDhUN>.
[WG-tlt] W3C, "ACTION-164: Bring widely used top-level type to
w3c-ietf liaison", 2015,
<https://www.w3.org/Fonts/WG/track/actions/164>.
[Media-Type-Registration]
IANA, "Application for a Media Type",
<http://www.iana.org/form/media-types>.
The wiki pages cover the font formats (CFF, OpenType, TrueType, and SVG) and the trend data and liaison pages cover where web fonts and their media types have been heading πΈ Lots of good stuff to dig into, bestie π«Ά
Author's Address
Meet the author π¦ Chris Lilley, from W3C, with the address and email exactly as listed:
Chris Lilley
W3C
2004 Route des Lucioles
Sophia Antipolis 06902
France
Email: chris@w3.org
π¦ where this page comes from
- ietf: rfc8081 2017-02
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms