Faster, and (Coincidentally) More Secure Webfonts

163
FASTER, & () WEBFONTS bram@brampitoyo.com

description

TypeKit, FontSquirrel and Kernest are all great solutions to have webfonts in your sites, but wouldn’t you like to know what these services actually do in the underbellies, for once? And do you know that making fonts load faster often means also making it more secure? Kill two glyphs with one stone by subseting, embedding and randomizing your own webfonts. See actual performance benchmarks (for once), and learn some hacks that would drive every would be type-pirate crazy (really).

Transcript of Faster, and (Coincidentally) More Secure Webfonts

Page 2: Faster, and (Coincidentally) More Secure Webfonts

3

Page 3: Faster, and (Coincidentally) More Secure Webfonts
Page 4: Faster, and (Coincidentally) More Secure Webfonts

1. Subset

Page 5: Faster, and (Coincidentally) More Secure Webfonts

1. Subset, which can mean 2 things

Page 6: Faster, and (Coincidentally) More Secure Webfonts

1. Using a subset vs. using a font’s full character set

Page 7: Faster, and (Coincidentally) More Secure Webfonts

1. Subseting, which means splitting 1 font file into multiple parts

Page 8: Faster, and (Coincidentally) More Secure Webfonts

1. Subset2. Embed

Page 9: Faster, and (Coincidentally) More Secure Webfonts

1. Subset2. Embed vs. linking directly to a font file

Page 10: Faster, and (Coincidentally) More Secure Webfonts

1. Subset2. Embed3. Randomize

Page 11: Faster, and (Coincidentally) More Secure Webfonts

1. Subset2. Embed3. Randomize, a new way to secure

Page 12: Faster, and (Coincidentally) More Secure Webfonts

1. Subset2. Embed Make webfonts both faster & more secure

Page 13: Faster, and (Coincidentally) More Secure Webfonts

3. Randomize Taking a step further

Page 14: Faster, and (Coincidentally) More Secure Webfonts

’ formats

Page 15: Faster, and (Coincidentally) More Secure Webfonts

’ formats,although, let’s talk about it over beer aerwards.

Page 16: Faster, and (Coincidentally) More Secure Webfonts

Fonts should be naked,or come with minimal obscuring

Page 17: Faster, and (Coincidentally) More Secure Webfonts

Fonts should be naked,or come with minimal obscuring, because it creates the best user & developer experience.

Page 18: Faster, and (Coincidentally) More Secure Webfonts

Fonts should be naked,or come with minimal obscuring, because it creates the best user & developer experience.

Page 19: Faster, and (Coincidentally) More Secure Webfonts

Fonts should be naked,or come with minimal obscuring, because it creates the fastest experience.

Page 20: Faster, and (Coincidentally) More Secure Webfonts

Fonts should be naked,or come with minimal obscuring, because it creates the most compatible experience

Page 21: Faster, and (Coincidentally) More Secure Webfonts

Fonts should be naked,or come with minimal obscuring, because it creates the most @font-face browsers

Page 22: Faster, and (Coincidentally) More Secure Webfonts

Fonts should be naked,or come with minimal obscuring, because it creates the least complex experience.

Page 23: Faster, and (Coincidentally) More Secure Webfonts

Fonts should be naked,or come with minimal obscuring, because it creates the less bugsfor you and me

Page 24: Faster, and (Coincidentally) More Secure Webfonts

1. Using a subset vs. using a font’s full character set

Page 25: Faster, and (Coincidentally) More Secure Webfonts

+-Basic Latin !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

Page 26: Faster, and (Coincidentally) More Secure Webfonts

+- Latin-1 Supplement !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ

Page 27: Faster, and (Coincidentally) More Secure Webfonts

+-, -Punc., Currency, Number Forms !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ

‐‑‒–—―‖‗‘’‚‛“”„‟†‡•‣․‥…‧ ‰‱′″‴‵‶‷‸‹›※‼‽‾‿⁀⁁⁂⁃ ⁄⁅⁆⁇⁈⁉⁊⁋⁌⁍⁎⁏⁐⁑⁒⁓⁔⁕⁖⁗⁘⁙Ю⁛⁜бẦ⁰ⁱ⁴⁵⁶⁷⁸⁹⁺⁻⁼⁽⁾ⁿ₀₁₂₃₄₅₅₆₇₈₉₊₋₌₍₎₠₡₢₣₤₥₦₧₨₩₪₫€₭₮₯₰₱� ���⅓⅔⅕⅖⅗⅘⅙⅚⅛⅜⅝⅞⅟

Page 29: Faster, and (Coincidentally) More Secure Webfonts

— ,

Page 30: Faster, and (Coincidentally) More Secure Webfonts

-

Page 31: Faster, and (Coincidentally) More Secure Webfonts

@- {font-family: Gentium;src: url(Gentium.ttf );

}

Page 32: Faster, and (Coincidentally) More Secure Webfonts

@- {font-family: Gentium;src: url(Gentium.ttf );unicode-range:+-}

Page 33: Faster, and (Coincidentally) More Secure Webfonts

Most of our documents are designed to be typeset in 1 language.

Page 34: Faster, and (Coincidentally) More Secure Webfonts

Most of our documents are designed to be typeset in 1 language ( it’s faster to load what you use.)

Page 35: Faster, and (Coincidentally) More Secure Webfonts
Page 36: Faster, and (Coincidentally) More Secure Webfonts

Full:Basic Latin, Latin-1,Latin Extended-A, Greek, Cyrillic, Punctuation, Super & Sub, Currency, Number Forms

Page 37: Faster, and (Coincidentally) More Secure Webfonts

Full: 112

Page 38: Faster, and (Coincidentally) More Secure Webfonts

Full: 112 Latin-1: 44

Page 39: Faster, and (Coincidentally) More Secure Webfonts

Full: 112 Latin-1: 44 Basic Latin: 28

Page 40: Faster, and (Coincidentally) More Secure Webfonts

Full: 112 Latin-1: 44 Basic Latin: 28 OptimizedBasic Latin, Fractions, Punctuation, Currency, Math

Page 41: Faster, and (Coincidentally) More Secure Webfonts

Full: 112 Latin-1: 44 Basic Latin: 28 OptimizedJust like Latin-1, but– diacritics and + helpful stuff

Page 42: Faster, and (Coincidentally) More Secure Webfonts

Full: 112 Latin-1: 44 Basic Latin: 28 Optimized: 44

Page 43: Faster, and (Coincidentally) More Secure Webfonts
Page 44: Faster, and (Coincidentally) More Secure Webfonts

Full: 2.9 s

Page 45: Faster, and (Coincidentally) More Secure Webfonts

Full: 2.9 sLatin-1: 1.9 s

Page 46: Faster, and (Coincidentally) More Secure Webfonts

Full: 2.9 sLatin-1: 1.9 sBasic Latin: 1.5 s

Page 47: Faster, and (Coincidentally) More Secure Webfonts

Full: 2.9 sLatin-1: 1.9 sBasic Latin: 1.5 sOptimized: 1.7 s

Page 48: Faster, and (Coincidentally) More Secure Webfonts

1. Using a subset vs. using a font’s full character set

Page 49: Faster, and (Coincidentally) More Secure Webfonts

?

Page 50: Faster, and (Coincidentally) More Secure Webfonts

1. Using a subset vs. using a font’s full character set

Page 51: Faster, and (Coincidentally) More Secure Webfonts

1. Subseting, which means splitting 1 font file into multiple parts

Page 52: Faster, and (Coincidentally) More Secure Webfonts

+-Basic Latin !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

Page 53: Faster, and (Coincidentally) More Secure Webfonts

’ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\^_`abcdefghijklmnopqrstuvwxyz{|}~

Page 54: Faster, and (Coincidentally) More Secure Webfonts

!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\^_`abcdefghijklmnopqrstuvwxyz{|}~

Page 55: Faster, and (Coincidentally) More Secure Webfonts

!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\^_`abcdefghijklmnopqrstuvwxyz{|}~

Page 56: Faster, and (Coincidentally) More Secure Webfonts

!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\^_`abcdefghijklmnopqrstuvwxyz{|}~

Page 57: Faster, and (Coincidentally) More Secure Webfonts

!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\^_`abcdefghijklmnopqrstuvwxyz{|}~

Page 58: Faster, and (Coincidentally) More Secure Webfonts

!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\^_`abcdefghijklmnopqrstuvwxyz{|}~

Page 59: Faster, and (Coincidentally) More Secure Webfonts
Page 60: Faster, and (Coincidentally) More Secure Webfonts

@- {font-family: Gentium1;src: url(Gentium1.ttf );}

Page 61: Faster, and (Coincidentally) More Secure Webfonts

@- {font-family: Gentium1;src: url(Gentium1.ttf );}

Page 62: Faster, and (Coincidentally) More Secure Webfonts

@- {font-family: Gentium2;src: url(Gentium2.ttf );}

Page 63: Faster, and (Coincidentally) More Secure Webfonts

@- {font-family: Gentium3;src: url(Gentium3.ttf );}

Page 64: Faster, and (Coincidentally) More Secure Webfonts

{ font-family: “Gentium1”, “Gentium2”, “Gentium3”; }

Page 65: Faster, and (Coincidentally) More Secure Webfonts

Multiple font files can load in parallel.

Page 66: Faster, and (Coincidentally) More Secure Webfonts

Multiple font files can load in parallel( faster loading time.)

Page 67: Faster, and (Coincidentally) More Secure Webfonts

If you don’t have a font creation soware handy, you can’t get the full file.

Page 68: Faster, and (Coincidentally) More Secure Webfonts

If you don’t have a font creation soware handy, you can’t get the full file(harder to pirate.)

Page 69: Faster, and (Coincidentally) More Secure Webfonts
Page 70: Faster, and (Coincidentally) More Secure Webfonts
Page 71: Faster, and (Coincidentally) More Secure Webfonts

One set: 112

Page 72: Faster, and (Coincidentally) More Secure Webfonts

Capital: 13 Lowercase: 13 Number: 12 Symbol: 33 Expert: 66

Page 73: Faster, and (Coincidentally) More Secure Webfonts

One set: 112 Multiple subsets: 137

Page 74: Faster, and (Coincidentally) More Secure Webfonts
Page 75: Faster, and (Coincidentally) More Secure Webfonts

One set: 2.9 s

Page 76: Faster, and (Coincidentally) More Secure Webfonts

One set: 2.9 sMultiple subsetsCapital, Lowercase,Number, Symbol &Expert (everything else)

Page 77: Faster, and (Coincidentally) More Secure Webfonts

One set: 2.9 sMultiple subsets: 1.9 s

Page 78: Faster, and (Coincidentally) More Secure Webfonts

1. Subseting, which means splitting 1 font file into multiple parts

Page 79: Faster, and (Coincidentally) More Secure Webfonts

?

Page 80: Faster, and (Coincidentally) More Secure Webfonts

1. Subset

Page 81: Faster, and (Coincidentally) More Secure Webfonts

1. Subset2. Embed vs. linking directly to a font file

Page 82: Faster, and (Coincidentally) More Secure Webfonts

.

Page 83: Faster, and (Coincidentally) More Secure Webfonts

Reading embedded data is faster than reading linked ones.

Page 84: Faster, and (Coincidentally) More Secure Webfonts

If you don’t pass the file through a Base-64 decoder, you can’t have it

Page 85: Faster, and (Coincidentally) More Secure Webfonts

If you don’t pass the file through a Base-64 decoder, you can’t have it(harder to pirate.)

Page 87: Faster, and (Coincidentally) More Secure Webfonts
Page 88: Faster, and (Coincidentally) More Secure Webfonts

@- {font-family: Gentium;

}

Page 89: Faster, and (Coincidentally) More Secure Webfonts

@- {font-family: Gentium;src: url(Gentium.ttf );

}

Page 90: Faster, and (Coincidentally) More Secure Webfonts

@- {font-family: Gentium;src: url(Gentium.ttf );

}

Page 91: Faster, and (Coincidentally) More Secure Webfonts

@- {font-family: Gentium;src: url(“data:font/truetype;base64,…”);}

Page 92: Faster, and (Coincidentally) More Secure Webfonts
Page 93: Faster, and (Coincidentally) More Secure Webfonts
Page 94: Faster, and (Coincidentally) More Secure Webfonts

Linked: 2.9 s

Page 95: Faster, and (Coincidentally) More Secure Webfonts

Linked: 2.9 sEmbedded: 1.9 s

Page 96: Faster, and (Coincidentally) More Secure Webfonts

1. Subset2. Embed vs. linking directly to a font file

Page 97: Faster, and (Coincidentally) More Secure Webfonts

?

Page 98: Faster, and (Coincidentally) More Secure Webfonts

1. Subset

Page 99: Faster, and (Coincidentally) More Secure Webfonts

1. Subset2. Embed

Page 100: Faster, and (Coincidentally) More Secure Webfonts

1. Subset2. Embed vs. linking directly to a font file

Page 101: Faster, and (Coincidentally) More Secure Webfonts

1. Subset2. Embed3. Randomize

Page 102: Faster, and (Coincidentally) More Secure Webfonts

1. Subset2. Embed3. Randomize, A new way to secure.

Page 103: Faster, and (Coincidentally) More Secure Webfonts

Proceed at your own risk.

Page 104: Faster, and (Coincidentally) More Secure Webfonts

Proceed at your own risk(hacky, maybe faster& can be more efficient.)

Page 105: Faster, and (Coincidentally) More Secure Webfonts

Proceed at your own risk(hacky, maybe faster& can be more efficient,but incredibly fun.)

Page 106: Faster, and (Coincidentally) More Secure Webfonts

+-Basic Latin !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

Page 107: Faster, and (Coincidentally) More Secure Webfonts

’ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\^_`abcdefghijklmnopqrstuvwxyz{|}~

Page 108: Faster, and (Coincidentally) More Secure Webfonts

!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\^_`abcdefghijklmnopqrstuvwxyz{|}~

Page 109: Faster, and (Coincidentally) More Secure Webfonts

!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\^_`abcdefghijklmnopqrstuvwxyz{|}~

Page 110: Faster, and (Coincidentally) More Secure Webfonts

!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\^_`abcdefghijklmnopqrstuvwxyz{|}~

Page 111: Faster, and (Coincidentally) More Secure Webfonts

!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\^_`abcdefghijklmnopqrstuvwxyz{|}~

Page 112: Faster, and (Coincidentally) More Secure Webfonts

!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\^_`abcdefghijklmnopqrstuvwxyz{|}~

Page 113: Faster, and (Coincidentally) More Secure Webfonts

!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\^_`abcdefghijklmnopqrstuvwxyz{|}~

Page 114: Faster, and (Coincidentally) More Secure Webfonts

!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\^_`abcdefghijklmnopqrstuvwxyz{|}~

Page 115: Faster, and (Coincidentally) More Secure Webfonts

!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\^_`abcdefghijklmnopqrstuvwxyz{|}~

Page 116: Faster, and (Coincidentally) More Secure Webfonts

!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\^_`abcdefghijklmnopqrstuvwxyz{|}~

Page 117: Faster, and (Coincidentally) More Secure Webfonts

!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\^_`abcdefghijklmnopqrstuvwxyz{|}~

Page 118: Faster, and (Coincidentally) More Secure Webfonts

Multiple font files can load in parallel.

Page 119: Faster, and (Coincidentally) More Secure Webfonts

Multiple font files can load in parallel(but it’s illogically split and harder to manage.)

Page 120: Faster, and (Coincidentally) More Secure Webfonts

As if assembling isn’t hard enough already, the font is split at random.

Page 121: Faster, and (Coincidentally) More Secure Webfonts

As if assembling isn’t hard enough already, the font is split at random(good luck trying it.)

Page 122: Faster, and (Coincidentally) More Secure Webfonts

1. Subset2. Embed3. Randomize, A new way to secure.

Page 123: Faster, and (Coincidentally) More Secure Webfonts

?

Page 124: Faster, and (Coincidentally) More Secure Webfonts

( )

Page 125: Faster, and (Coincidentally) More Secure Webfonts
Page 126: Faster, and (Coincidentally) More Secure Webfonts

-

Page 127: Faster, and (Coincidentally) More Secure Webfonts

Plain

Page 128: Faster, and (Coincidentally) More Secure Webfonts

2.9

Page 129: Faster, and (Coincidentally) More Secure Webfonts

#1

Page 130: Faster, and (Coincidentally) More Secure Webfonts

1.9

Page 131: Faster, and (Coincidentally) More Secure Webfonts

- #2

Page 132: Faster, and (Coincidentally) More Secure Webfonts

- 1.9

Page 133: Faster, and (Coincidentally) More Secure Webfonts

- #1 #2

Page 134: Faster, and (Coincidentally) More Secure Webfonts

- 3.3

Page 135: Faster, and (Coincidentally) More Secure Webfonts

2.9 1.9

- 1.9 3.3

Page 136: Faster, and (Coincidentally) More Secure Webfonts
Page 137: Faster, and (Coincidentally) More Secure Webfonts

One set + link

Page 138: Faster, and (Coincidentally) More Secure Webfonts

+ 1 font file

Page 139: Faster, and (Coincidentally) More Secure Webfonts

+ 1 font fileMultiple sets + link

Page 140: Faster, and (Coincidentally) More Secure Webfonts

+ 1 font file + x font files

Page 141: Faster, and (Coincidentally) More Secure Webfonts

+ 1 font file + x font filesOne set + embedded

Page 142: Faster, and (Coincidentally) More Secure Webfonts

+ 1 font file + x font files1 file

Page 143: Faster, and (Coincidentally) More Secure Webfonts

+ 1 font file + x font files1 fileMultiple sets + Embed

Page 144: Faster, and (Coincidentally) More Secure Webfonts

+ 1 font file + x font files1 file1 file (bigger)

Page 145: Faster, and (Coincidentally) More Secure Webfonts

?

Page 146: Faster, and (Coincidentally) More Secure Webfonts

1. Subset

Page 147: Faster, and (Coincidentally) More Secure Webfonts

1. Subset, which can means 2 things

Page 148: Faster, and (Coincidentally) More Secure Webfonts

1. Using a subset vs. using a font’s full character set

Page 149: Faster, and (Coincidentally) More Secure Webfonts

1. Subseting, which means splitting 1 font file into multiple parts

Page 150: Faster, and (Coincidentally) More Secure Webfonts

1. Subset2. Embed

Page 151: Faster, and (Coincidentally) More Secure Webfonts

1. Subset2. Embed vs. linking directly to a font file

Page 152: Faster, and (Coincidentally) More Secure Webfonts

1. Subset2. Embed3. Randomize

Page 153: Faster, and (Coincidentally) More Secure Webfonts

1. Subset2. Embed3. Randomize, a new way to secure

Page 154: Faster, and (Coincidentally) More Secure Webfonts
Page 155: Faster, and (Coincidentally) More Secure Webfonts

1. File sizes (subseting can be good)

Page 156: Faster, and (Coincidentally) More Secure Webfonts

1. File sizes2. Number of files to load (subseting can be bad)

Page 157: Faster, and (Coincidentally) More Secure Webfonts

1. File sizes2. Number of files to load (subseting can be good, if file loads parallel)

Page 158: Faster, and (Coincidentally) More Secure Webfonts

1. File sizes2. Number of files to load3. File format (Base-64 is faster)

Page 159: Faster, and (Coincidentally) More Secure Webfonts

1. File sizes2. Number of files to load3. File format (Base-64 is faster, but be careful splitting it.)

Page 160: Faster, and (Coincidentally) More Secure Webfonts

1. File sizes2. Number of files to load3. File format (Also, don’t subset and embed all at once.)

Page 161: Faster, and (Coincidentally) More Secure Webfonts

?

Page 162: Faster, and (Coincidentally) More Secure Webfonts

FASTER, &() WEBFONTS