Important

This slide deck was created for use in a controlled environment, during a talk. It works best with a recent Firefox at 1920x1080. It WILL PROBABLY NOT work correctly in other browsers, due to limited support for CSS3 font-variant-* properties and css variables at this time. But the other browsers will catch up. Right? Right??!!

Everything Changes WebFonts in 2018

me

Hello!
I’m Chris or @svgeesus

Technical Director at W3C

ex-W3C Technical Architecture Group

W3C Core Web Strategy

Started SVG (1996)

SVG WG Chair (1998-2006)

Co-authored PNG (1996)

WebFonts

Topics for today

Basics

Character
a codepoint, with properties
Glyph
visual representation of character(s)

character(s), glyph(s)

é

character(s), glyph(s), font(s)

Myriad Pro  <— Font family

  •   <— Faces
  • Light
  • Roman
  • Bold
  • Black
  • Italic
  • Condensed

Baskerville <— Font family

  •   <— Faces
  • Roman
  • Semibold
  • Bold
  • Italic
Descriptors
describe individual font faces
Properties
requests for styling

Properties & descriptors


                @font-face {
                	font-family: Arvo; /* Descriptor */
                	src: url(fonts/s.woff); /* Descriptor */
                	font-weight: bold; /* Descriptor */
                }

                h1 {
                	font-family: Arvo; /* Property */
                	font-weight: bold; /* Property */
                }
            

Font stacks

First font with glyphs for a given character is used

Problem: avoiding bad Latin glyphs in Japanese fonts


                @font-face {
                	font-family: Demo;
                	src: url(Latin.woff), url(Japanese.woff);
                }
            

Both fonts can’t be first!

unicode-range
Descriptor for allowed range of Unicode characters

            @font-face {
            	font-family: 'Headings';
            	src: url(fonts/Japanese.woff);
            	unicode-range: U+A5, U+4E00-9FFF, U+30??, U+FF00-FF9F;
            	/* yen, kanji, hiragana, katakana */
            }
            
unicode-range: U+A5, U+4E00-9FFF, U+30??, U+FF00-FF9F;
poop

I'm really sorry about the unicode-range syntax. :(
What was I thinking?!

This & That
no need for extra elements
U+26
Use just the ampersand

Variable Fonts

Tofino, by Alanna Munro

Tofino family

37 files

Regular WebFonts
download 37 separate font files
Variable fonts
download one variable font
interpolate along design axes

Weight axis

glyph outline deltas

Registered variation axes

Axis tag Name
'ital' Italic
'opsz' Optical size
'slnt' Slant
'wdth' Width
'wght' Weight
/* select position  on each axis */
font-variation-settings:
    "wght" 2.4,
    "wdth" .7,
    "opsz" 32;

Quick question

font-weight: 400;
font-weight: calc(9 * 100);
AaΑα 400
BbΒβ 900
CSS3 font-weight
Number-like strings "100" "200" etc
CSS4 font-weight
a number from 1 to 999
/* properties select position  on each axis */
font-weight: 362; /* fairly light */
font-stretch: 70; /* condensed */
font-optical-sizing: auto

Using registered variation axes

Axis tag Name Property/Descriptor
'ital' Italic font-style
'opsz' Optical size font-optical-sizing
'slnt' Slant font-style
'wdth' Width font-stretch
'wght' Weight font-weight

Dunbar variable font

@font-face {
    font-family: "Dunbar";
    src: url("dunbar.otf");
    font-weight: 100 900;
    font-stretch: 50% 200%;
    font-style: -10deg 40deg;
}

h1 {
    font-weight: 234;
    font-stretch: 80%;
    font-style: oblique 24deg;
    font-optical-sizing: none;
}
/* Supported Safari (TP 16+), Firefox 62 & Chrome 62 */
font-variation-settings:"wght" 2.4, "wdth" .7, "radi" .4;
@keyframes expand {
    from { font-variation-settings: 'radi' .3 }
    to { font-variation-settings: 'radi' 3.1; }
}
@font-face {
    /* By David Berlow */
    font-family: "Decovar";
    src: url(fonts/decovar.ttf);
}
p {
    font-family: Decovar;
    font-variation-settings:     
      "TRMC" [TRMC], /* Rounded slab */
      "TRMB" [TRMB], /* Flared */
      "SKLA" [SKLA], /* Inline Skeleton */
      "TRMK" [TRMK]; /* Inline Terminal */
}

De co var

peace

This may be the most significant development for design on the web since responsive design itself

—Jason Pamental

Color fonts

From illuminated manuscripts…

illuminated manuscript

…to emoji

😀 😎 🤖 👨‍👩‍👧‍👦 👦🏻 👧🏻 👨🏻 👩🏻 👦🏼 👧🏼 👨🏼 👩🏼 👦🏽 👧🏽 👨🏽 👩🏽 👦🏾 👧🏾 👨🏾 👩🏾 👦🏿 👧🏿 👨🏿 👩🏿 🐱 🐶 🐌 🌎 🍕 🍲 🍫 🍻 ⚽️ 🏀 🏈 ⚾️ 🌈 🏯 🗽 🚆 📱 🎉 🗓 💸 🇫 🇴 🇳 🇹 🇺🇸 🇧🇷 🇲🇹 🇸🇪 🇳🇬 🇰🇭 🇭🇷 🇮🇩 🇳🇿 🇪🇬 🇫🇮 🇨🇳

Painter Kafeel

TransType Editor

screenshot for demo

COLR + CPAL

Where did the styling go?

CSS4 font-palette
select from provided palettes
CSS4 @font-palette-values
override baked-in palettes
create new palettes

SVG (+ CPAL)

Painter Kaffeel

@font-face {
    /* By Pixel Ambacht */
    font-family: "Poo";
    src: url(fonts/poo.ttf);
}

p {
    font: 600%/1 Poo;                   
    font-variation-settings: "crap" [crap];
}

💩

supports <font-technology>

@font-face {
font-family: "Sample";
src: url("smp-colr.otf") format(opentype supports color(COLR)),
     url("smp-bw.otf") format(opentype);
}

features | variations | color(COLR | SVG | sbix) | palettes

OpenType Features & CSS

CAPITALE FULGURANT

et modeste avec ça

INCROYABLE astrale

OpenType features
Optional stylistic controls
Control with CSS
Fonts vary in features provided
font-variant
Preferred, support improving
font-feature-settings
Cryptic, low-level, widespread support

1234567890ABC
1234567890abj

font-variant-numeric:  ;

1/2 3/4 5/8
13/27 86/483

font-variant-numeric: ;
112,113.56
89,546.87
286,111.10
font-variant-numeric: ;

1st, 2nd, 3rd, 4th

font-variant-numeric: ;

INCROYABLE
flaneur

font-variant-ligatures: ;

Roman
Italic
Bold

font-synthesis: ;
font-family: ;

JAVA Ta Wa

font-kerning: ;
letter-spacing: 0em;

The Font Display Timeline

 the font face’s font download timer
  • font block period (invisible fallback)
  • font swap period (loaded fallback)
  • font failure period (font stack)

font-display descriptor

block: ??

swap: ??

failure: ??


        @font-face {
            font-family: 'Foo';
            src: url(foo.woff2);
            font-display: auto;
        }

font-display descriptor

block: 3s

swap:

failure: -


        @font-face {
            font-family: 'Foo';
            src: url(foo.woff2);
            font-display: block;
        }

font-display descriptor

block: 0s

swap:

failure: -


        @font-face {
            font-family: 'Foo';
            src: url(foo.woff2);
            font-display: swap;
        }

font-display descriptor

block: 100ms

swap: 3s

failure: -


        @font-face {
            font-family: 'Foo';
            src: url(foo.woff2);
            font-display: fallback;
        }

font-display descriptor

block: 100ms

swap: 0s

failure: -


        @font-face {
            font-family: 'Foo';
            src: url(foo.woff2);
            font-display: optional;
        }

Image credits

Typography I/Helvetica
David Costa, cc-by-nc
Coordinated axes to preserve line length
Bob Taylor, Monotype
Periodic Table of Font Elements 1.1
FontShop, cc-by
Wooden type blocks at Fremont indoor Sunday market
Jonathon Colman, cc-by-nc-nd
Manuscript of Church Law
Unknown Miniaturist, English (active 1120s in Canterbury). Public domain.
“Lab” Variable font
David Jonathan Ross, "intended for fun and experimentation"
peace variable font demo
Erik van Blokland
Grassy Text with Variable fonts.
Codepen by Mandy Michael

WebFonts used

Arvo
Geometric slab serif with four faces (Roman, Italic, Roman Bold, Bold Italic) by Anton Koovit. Used here for headings.
Linux Libertine
OpenType serif font with many OpenType features: ligatures, small caps, oldstyle and tabular numeric variants, fractions, greek final forms, superiors & inferiors, contextual alternates. Used here for all the numeric feature demos.
Painter Kafeel
Commercial (50 USD). Set of ten fonts intended to be manually overlaid to produce lettering in the Indian hand-painted street signage style, by Painter Kafeel and sold by Handpainted Type. Used here as input to produce COLR and SVG demo chromatic fonts. (Because this is a commercially licensed font, I could use it personally but not put the font into the GitHub repo).
Rochester Regular
Formal, flowing handwriting script, by Sideshow. Used here for the ampersand, and the WebFonts logo.
MEgalopolis Extra
OpenType display font with a single, bold, weight by SMeltery. Has many OpenType features such as discretionary ligatures, contextual forms, swash forms, numerical alternates, and a range of stylistic sets. Used here to demonstrate common and discretionary ligatures.
Reenie Beanie
Informal handwriting script, by James Grieshaber. Used here for comments and other annotations.
EmojiOne
SVG-in-OT emoji font by Brad Erickson. CC-BY-4.0 Includes skin colour modifiers, circled letters, flags.
Multicolore
SVG-in-OT conversion by Xerographer fonts of Illustrator concept font by Ivan Filipov. CC-BY-SA 4.0.