Skip to content

Instantly share code, notes, and snippets.

@myfonj
Last active December 5, 2018 16:08
Show Gist options
  • Save myfonj/20e0cff663066e4138ce4bce3594911c to your computer and use it in GitHub Desktop.
Save myfonj/20e0cff663066e4138ce4bce3594911c to your computer and use it in GitHub Desktop.
Latin-related font feature settings with descriptions from Wikipedia
/*
https://en.wikipedia.org/wiki/List_of_typographic_features
2018-12-05
*/
html {
font-feature-settings:
/*
Features intended for bicameral [cased] alphabets (Latin, Greek, Cyrillic, etc.)
*/
"smcp" off, /* S1 Small Caps - Substitutes lower-case letters with small caps versions */
"c2sc" off, /* S1 Capitals to Small Caps - Substitutes capital letters with small caps */
"pcap" off, /* S1 Petite Caps - Substitute lower-case letters with their petite caps analogs */
"c2pc" off, /* S1 Capitals to Petite Caps - Substitutes capital letters with petite caps */
"unic" off, /* S1 Unicase - Replaces lowercase and uppercase letters with a set of single case glyphs */
"cpsp" off, /* P1 Capital Spacing - Adjusts spacing between letters in all-capitals text */
"case" off, /* P1 Case Sensitive Forms - Replace characters, especially punctuation, with forms better suited for all-capital text, cf. titl */
"ital" off, /* S1 Italics - Replaces letter with corresponding italic glyph */
"ordn" off, /* S6,4 Ordinals - Replaces characters with ordinal forms for use after numbers */
/*
Features intended for digits and math
*/
"lnum" off, /* S1 Lining Figures - Replaces numerals with glyphs meant to fit better in all-capitals text, often also tnum*/
"tnum" off, /* S1 Tabular Figures - Replaces numerals with glyphs of uniform width, often also lnum*/
"zero" off, /* S1 Slashed Zero - Replaces 0 figure with slashed 0*/
"frac" off, /* S4 Fractions - Converts figures separated by slash with diagonal fraction*/
"onum" off, /* S1 Oldstyle Figures - Replaces numerals with cased old-style numerals, often also pnum*/
"pnum" off, /* S1 Proportional Figures - Replaces numerals with glyphs of proportional width, often also onum*/
"afrc" off, /* S4 Alternative Fractions - Converts figures separated by slash with alternative stacked fraction form*/
"dnom" off, /* S1 Denominator - Converts to appropriate fraction denominator form, invoked by frac*/
"numr" off, /* S1 Numerator - Converts to appropriate fraction numerator form, invoked by frac*/
"sinf" off, /* S1 Scientific Inferiors - as in "H2O", "SOx" or "YCbCr"*/
"mgrk" off, /* S1 Mathematical Greek - Replaces Greek characters with special forms for use in mathematics */
"flac" off, /* -- Flattened accent forms*/
"dtls" off, /* -- Dotless Forms*/
"ssty" off, /* -- Math script style alternates*/
/*
Ligation and alternate forms features intended for all scripts
*/
"aalt" off, /* S1,3 Access All Alternates - Special feature: used to present user with choice all alternate forms of the character */
"swsh" off, /* S1,3 Swash - Either replaces character with or displays multiple swashed versions */
"cswh" off, /* S8 Contextual Swash - Converts letter to a swashed version based on characters around the letter */
"calt" off, /* S6 Contextual Alternates - Applies a second substitution feature based on a match of a character pattern within a context of surrounding patterns */
"hist" off, /* S1 Historical Forms - Obsolete forms of characters to be applied at the user's discretion, cf. hlig */
"locl" off, /* S1 Localized Forms - Substitutes character with the preferred form based on script language */
"rand" off, /* S3 Randomize - Replaces character with random forms (meant to simulate handwriting) */
"nalt" off, /* S1,3 Alternate Annotation Forms - Provides user access to circled digits, inverse letters etc. */
"cv99" off, /* S3 Character Variant 1–99 - Multiple variants of a single character, which may not apply to many other characters, see references for voluminous documentation */
"salt" off, /* S1,3 Stylistic Alternates - Either replaces with, or displays list of, stylistic alternatives for a character */
"ss20" off, /* S1 Stylistic Set 1 – 20 - Replaces character with one from a font-specific set of stylistic alternatives */
"subs" off, /* S1 Subscript - Replaces character with subscript version, cf. numr */
"sups" off, /* S1 Superscript - Replaces character with superscript version, cf. dnom */
"titl" off, /* S1 Titling Alternates - Replaces characters with forms suited for large type, as in titles */
"rvrn" off, /* S1 Required Variation Alternates - Special variants of a single character, which need apply to specific font variation, required by variable fonts */
"clig" off, /* S8 Contextual Ligatures - Applies a second ligature feature based on a match of a character pattern within a context of surrounding patterns */
"dlig" off, /* S4 Discretionary Ligatures - Ligatures to be applied at the user's discretion */
"hlig" off, /* S1 Historical Ligatures - Obsolete ligatures to be applied at the user's discretion */
"liga" off, /* S4 Standard Ligatures - Replaces (by default) sequence of characters with a single ligature glyph */
/*
Ligation and alternate forms features intended for all scripts
*/
"ccmp" off, /* S4,2 Glyph Composition/Decomposition - Either calls a ligature replacement on a sequence of characters or replaces a character with a sequence of glyphs. Provides logic that can for example effectively alter the order of input characters. */
"kern" off, /* P2,8 Kerning - Fine horizontal positioning of one glyph to the next, based on the shapes of the glyphs */
"mark" off, /* P4,5 Mark Positioning - Fine positioning of a mark glyph to a base character */
"mkmk" off, /* P6 Mark-to-mark Positioning - Fine positioning of a mark glyph to another mark character */
"opbd" off, /* P1 Optical Bounds - Re-positions glyphs at beginning and end of line, for precise justification of text. */
"lfbd" off, /* P1 Left Bounds - Re-positions glyphs at end of line. Called by opbd. */
"rtbd" off, /* P1 Right Bounds - Re-positions glyphs at beginning of line. Called by opbd. */
/*
Special features intended for all scripts
*/
"size" off, /* Not a lookup: feature's table provides to applications information about the appearance and intent of the font, to aid in font selection.*/
"ornm" off; /* S3,1 Decorative alternates for the bullet character • */
/*
abbrev. type description
S1 GSUB 1 simple substitution of one glyph with another
S2 GSUB 2 multiple substitution of one character by several glyphs
S3 GSUB 3 variant selection
S4 GSUB 4 ligatures
S5 GSUB 5 contextual substitution
S6 GSUB 6 chained contextual substitution
S7 GSUB 7 extension for GSUB tables past 64kB
S8 GSUB 8 reverse chained contextual substitution
P1 GPOS 1 positioning of single glyph
P2 GPOS 2 positioning of pair of glyphs
P3 GPOS 3 cursive attachment
P4 GPOS 4 positioning of mark glyphs relative to base
P5 GPOS 5 positioning of mark glyphs relative to ligature
P6 GPOS 6 positioning of mark glyphs relative to another mark glyph
P7 GPOS 7 contextual positioning
P8 GPOS 8 extended contextual positioning
P9 GPOS 9 extension for GPOS tables past 64kB
*/
}
body::before {
content: "\
(H-H-H) \
ff fi ffl ffi fh fk \
0123456789 \
(1) (2) [3] --> -> -^ ^- \
No.1 1a, 20 \
aäāăąàáãåæcçćĉċčdďđeèéêëēĕėęěfgĝğġģhĥħiìíîïĩīĭįıijjĵķĸlĺļľŀłnñńņňʼnŋoøðòóôõöōŏőœrŕŗřsśŝşštţťŧuùúûüũūŭůűųwŵyýŷÿzźżžþſ\
";
font-size: 16px;
font-feature-settings:
/*
https://en.wikipedia.org/wiki/List_of_typographic_features
*/
"liga" 1 , /* `ff`, `fi` */
"smcp" 0, /* Small Caps */
"c2sc" 0, /* Capitals to Small Caps */
"case" 0, /* H-H:+- Case Sensitive Forms brackets, parenthesis, dashes and hyphens are replaced with their capital forms */
"dlig" 0, /* (1) (2) [3] --> -> -^ ^- Discretionary Ligatures */
"subs" 0, /* Subscript */
"sups" 0, /* Superscript */
"lnum" 0, /* Lining Figures */
"tnum" 0, /* Tabular Figures */
"pnum" 0, /* Proportional Figures */
"onum" 0, /* Oldstyle Figures - Replaces numerals with cased old-style numerals, often also pnum*/
"zero" 0, /* Slashed Zero */
"locl" 0, /* Localized Forms - Substitutes character with the preferred form based on script language */
"ordn" 0, /* No.1 1a, 20 Ordinals */
"frac" 0, /* 1/2 Fractions */
"afrc" 0, /* Alternative Fractions - Converts figures separated by slash with alternative stacked fraction form */
"ss01" 0, /* maybe ‘g‘ alternatives */
"ss02" 0, /* maybe ‘f‘ alternatives */
"ss03" 0, /* maybe ‘β‘, ‘θ‘ and ‘φ‘ alternatives */
"ss06" 0, /* maybe ‘Q‘ alternatives */
"ss08" 0; /* maybe ‘i‘ and ‘l‘ alternative characters. */
}
p[style]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment