FacetDocs

Font

font   = [family] size ["/" line] [word ...]
family = every word before the first number or keyword ("Instrument Sans"),
         a Google Fonts family named with a keyword in it ("Archivo Black"),
         a number ending it when a size follows ("Source Serif 4 16/26"),
         a known family with a number inside ("M PLUS 1 Code 13/20"),
         or quoted ("\"Source Serif 4\" 16/26")
size   = number, in pixels
line   = number of pixels | number "%" | multiple of the size, up to 4 ("1.4")
word   = weight | "italic" | spacing | case
weight = 100 … 900 in hundreds | thin | extralight | light | regular | medium | semibold | bold | extrabold | black
spacing= "+" or "-" then pixels ("+0.4") or a percentage ("-2%")
case   = caps | upper | lower | title
FontfontFamilyfontSizelineHeightfontWeightother
Inter 15/22Inter1522
Fraunces 44/1.1 600 -1Fraunces44110%600letterSpacing −1
12/16 700 +1.6 capsinherited1216700letterSpacing 1.6, upper case
Tiro Devanagari Hindi 20/28Tiro Devanagari Hindi2028

On a Mac, Apple's own families are written by their plain names: SF Pro (the system font), New York (its serif), SF Mono, SF Compact and SF Pro Rounded; they exist on Macs only, so a file that must draw the same elsewhere uses a Google Fonts family. PingFang SC is the exception: recent macOS keeps its outlines in a format Facet's text engine does not read, so a text naming it is drawn in another family and the build warns FONT_SUBSTITUTED; for Chinese, name Hiragino Sans GB, Songti SC or Noto Sans SC.

The first number after the family is the size, so write a weight after it. A weight with no size ("Fraunces 600", "Inter 100 italic") changes the family and weight and keeps the size, as "600" alone changes only the weight; a size of a whole hundred is written with its line height ("Fraunces 200/200"). A family whose name ends in a number keeps it when a size follows ("Source Serif 4 16/26"), and a Google Fonts family whose name holds a weight or case word keeps it whole ("Archivo Black 18/20", "Black Ops One 24"), as does one with a number inside its name ("M PLUS 1 Code 13/20"), while "Inter Bold 16" is Inter in bold; quote a family to be sure ("\"Noto Serif Display 2\" 40"). A family from Google Fonts is downloaded the first time a build names it. Italic asked of a family without an italic face shows upright, and the build notes it (FONT_STYLE_MISSING). Tracking (+1.6, letterSpacing) is not applied to scripts whose letters join (Arabic, Syriac, N'Ko, Mongolian, Devanagari, Bengali, Gurmukhi), as browsers do, so a tracked heading in several scripts keeps them whole.

Documentation for Facet 0.3.228-g032727de