Controlling, designing and improving Text on the web

A presentation at Web Directions Summit in December 2022 in Sydney NSW, Australia by Mandy Michael

Slide 1

Slide 1

Improving TEXT ON THE WEB. @mandy_kerr

Slide 2

Slide 2

MANDY MICHAEL @mandy_kerr

Slide 3

Slide 3

@mandy_kerr

Slide 4

Slide 4

Improving TEXT ON THE WEB. @mandy_kerr

Slide 5

Slide 5

Choosing THE RIGHT TYPE. @mandy_kerr

Slide 6

Slide 6

HEADINGS ABBREVIATION LINK PARAGRAPH EMPHASIS TIME ORDERED LIST SUPERSCRIPT D E F I N I T I O N L I ST CA P T I O N BLOCKQUOTE UNORDERED LIST PRE-FORMATTED DEFINITION @mandy_kerr

Slide 7

Slide 7

Using FONTS ON THE WEB @mandy_kerr

Slide 8

Slide 8

Looking at VARIABLE FONTS @mandy_kerr

Slide 9

Slide 9

Variable font file Individual font files a a a a a a a a a a a a @mandy_kerr

Slide 10

Slide 10

Weight Axis Interpolated weights Named Instance @mandy_kerr

Slide 11

Slide 11

@mandy_kerr

Slide 12

Slide 12

Source Sans Pro WOFF2 file size Single weight 111kb Variable font 112kb @mandy_kerr

Slide 13

Slide 13

When we are not limited by technical considerations, creativity can determine our choices. @mandy_kerr

Slide 14

Slide 14

More Accessible fonts https://www.lexend.com/

Slide 15

Slide 15

@mandy_kerr

Slide 16

Slide 16

@mandy_kerr

Slide 17

Slide 17

@mandy_kerr

Slide 18

Slide 18

Get fancy with COLOUR FONTS @mandy_kerr

Slide 19

Slide 19

Rocher Color, Henrique Beier @mandy_kerr

Slide 20

Slide 20

font-palette @font-palette-values “—blue { base-palette: 7; } h1 { font-family: Rocher; font-palette: “—blue; } @mandy_kerr

Slide 21

Slide 21

@mandy_kerr

Slide 22

Slide 22

font-palette @font-palette-values “—jello { override-colors: 0 #94b95e, 1 #eb1a7d, 2 #5f0552, 3 #f556d6; } h1 { font-family: Rocher; font-palette: “—jello; } @mandy_kerr

Slide 23

Slide 23

Nabla, Typearture @mandy_kerr

Slide 24

Slide 24

Reem Kufi Ink @mandy_kerr

Slide 25

Slide 25

Variable Color Initials by Typearture @mandy_kerr

Slide 26

Slide 26

Noto color emoji @mandy_kerr

Slide 27

Slide 27

Interesting FONT PROPERTIES @mandy_kerr

Slide 28

Slide 28

Better numbers with FONT-VARIANT-NUMERIC @mandy_kerr

Slide 29

Slide 29

font-variant-numeric font-variant-numeric: slashed-zero; 1234567890 font-variant-numeric: lining-nums; font-variant-numeric: tabular-nums; font-variant-numeric: oldstyle-nums; 988,826.09 font-variant-numeric: diagonal-fractions; font-variant-numeric: stacked-fractions; font-variant-numeric: ordinal; 1st 2nd 3rd @mandy_kerr

Slide 30

Slide 30

font-variant-numeric lining-nums Baseline tabular-nums oldstyle-nums 988,826.09 @mandy_kerr

Slide 31

Slide 31

oldstyle-nums tabular-nums Consect Ornare Consect Tortor Ornare Tortor Lorem 1450.09 1450.09 1235.30 Lorem 1450.09 763.09 32.5 Ipsum 2331.98 32.30 324.98 Ipsum 2331.98 32.30 324.98 Dolor 32.50 4456.49 2356.20 Dolor 32.50 4456.49 2356.20 Jello 146.43 212.49 3423.19 Jello 146.43 212.49 3423.19 @mandy_kerr

Slide 32

Slide 32

Lining nums Tabular mums @mandy_kerr

Slide 33

Slide 33

font-variant-numeric none diagonal-fractions Font: Surveyor: www.typography.com/fonts/surveyor/overview stacked-fractions @mandy_kerr

Slide 34

Slide 34

font-variant-numeric font-variant-numeric: tabular-nums diagonal-fractions; @mandy_kerr

Slide 35

Slide 35

font-variant-numeric font-feature-settings: frac; font-variant-numeric: diagonal-fractions; https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-numeric @mandy_kerr

Slide 36

Slide 36

Better characters with FONT-VARIANT-LIGATURES @mandy_kerr

Slide 37

Slide 37

font-variant-ligatures font-variant-ligatures: none; font-variant-ligatures: normal; font-variant-ligatures: common-ligatures; font-variant-ligatures: no-common-ligatures; font-variant-ligatures: discretionary-ligatures; font-variant-ligatures: no-discretionary-ligatures; font-variant-ligatures: historical-ligatures; font-variant-ligatures: no-historical-ligatures; font-variant-ligatures: contextual; font-variant-ligatures: no-contextual; @mandy_kerr

Slide 38

Slide 38

font-variant-ligatures font-variant-ligatures: common-ligatures; fluffy fluffy none common-ligatures @mandy_kerr

Slide 39

Slide 39

font-variant-ligatures font-feature-settings: “liga” 1; font-variant-ligatures: common-ligatures; https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-ligatures @mandy_kerr

Slide 40

Slide 40

Slide 41

Slide 41

Slide 42

Slide 42

Getting fancy with FONT-VARIANT-ALTERNATES @mandy_kerr

Slide 43

Slide 43

font-variant-alternates font-variant-alternates: historical-forms; font-variant-alternates: stylistic(); font-variant-alternates: stylesheet(); font-variant-alternates: character-variant(); font-variant-alternates: ornaments(); font-variant-alternates: swash(); @mandy_kerr

Slide 44

Slide 44

@mandy_kerr

Slide 45

Slide 45

font-variant-alternates @font-feature-values “MonteCarlo” { @swash { swsh: 1; } } .fancy-font { font-variant-alternates: swash(swsh); } @mandy_kerr

Slide 46

Slide 46

font-variant-alternates none font-variant-alternates: swash(swsh); @mandy_kerr

Slide 47

Slide 47

font-variant-alternates font-feature-settings: “swsh” 1; font-variant-alternates: swash(swsh); https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-alternates @mandy_kerr

Slide 48

Slide 48

https://codepen.io/mandymichael/pen/MWXpzMJ @mandy_kerr

Slide 49

Slide 49

Slide 50

Slide 50

@mandy_kerr @mandy_kerr

Slide 51

Slide 51

The Complete CSS Demo for OpenType Features twitter.com/tunghsiao sparanoid.com/lab/opentype-features @mandy_kerr

Slide 52

Slide 52

Exploring available TEXT PROPERTIES @mandy_kerr

Slide 53

Slide 53

Understanding INLINE/BLOCK DIRECTION. (previously horizontal vs vertical) @mandy_kerr

Slide 54

Slide 54

Inline Direction: left to right Vivamus ut dolor nec dolor aliquam scelerisque quis et nisl. Donec in ipsum eget tortor elementum bibendum. Block Direction: Top to Bottom Sed interdum nec neque eget pretium. Sed sit amet risus felis. Sed molestie leo id diam dignissim efficitur. Mauris a finibus lectus. Donec a ullamcorper ante. Suspendisse scelerisque odio augue, vitae venenatis nisl posuere a. Sed bibendum sem vitae lorem maximus mattis. @mandy_kerr

Slide 55

Slide 55

‫‪Inline Direction: Right to left‬‬ ‫تحركت أم‪ ,‬لها في كانتا التجارية‪.‬‬ ‫بـ بعد كرسي أل ّم طوكيو‪ ,‬عدد إذ جنوب ألداء‪ .‬وتم حقول ّ‬ ‫بالرد بمعارضة االنجليزية أخر بـ‪ .‬بل‬ ‫من قادة التقليدي األمريكية يكن‪ ,‬ثم لعدم الواقعة شيء‪ّ ,‬‬ ‫تسمى الطريق‪ ,‬كما عن اعتداء الصفحة‪ .‬وصل قد املحيط‬ ‫عدد الجو غريمه إتفاقية‪ .‬ما بحق‬ ‫ّ‬ ‫‪.‬الثقيل‪ ,‬جهة تم غضون اليابان الرئيسية‪ .‬مرمى النفط لكل عن‪ ,‬وقد فهرست اإلمتعاض لم‬ ‫و بعض املدن والعتاد‪ ,‬إستعمل بقيادة ا بـ دنو‪ .‬قام سكان وزارة ممثّلة أي‪ ,‬بال ‪ ٣٠‬دأبوا عرفها‬ ‫أعمال‪ .‬بل سكان إعادة أدوات حدى‪ .‬مما لم جنوب أعمال وق ّدموا‪ ,‬بني تاريخ كانتا الهادي هو‪.‬‬ ‫‪.‬لها قد النفط املضي‪ ,‬بها قررت لليابان وانتها ًء ما‬ ‫‪@mandy_kerr‬‬ ‫‪Block Direction:‬‬ ‫‪Top to Bottom‬‬

Slide 56

Slide 56

Block Direction: left to right Inline Direction: Top to Bottom @mandy_kerr

Slide 57

Slide 57

text-align Little mellow Jello, you squishy little fellow. text-align: left; ‫ قام سكان‬.‫ إستعمل بقيادة ا بـ دنو‬,‫و بعض املدن والعتاد‬ ‫ بل سكان إعادة‬.‫ دأبوا عرفها أعمال‬٣٠ @mandy_kerr

Slide 58

Slide 58

Example of LOGICAL PROPERTIES @mandy_kerr

Slide 59

Slide 59

logical properties Little mellow Jello, you squishy little fellow. text-align: start; ‫ قام سكان‬.‫ إستعمل بقيادة ا بـ دنو‬,‫و بعض املدن والعتاد‬ ‫ بل سكان إعادة‬.‫ دأبوا عرفها أعمال‬٣٠ @mandy_kerr

Slide 60

Slide 60

Making use of SPACING ELEMENTS @mandy_kerr

Slide 61

Slide 61

word-spacing word-spacing: 0.5em; Dap ibus Inceptos Cons ctetur word-spacing: -0.5em; DapibusInceptosConsctetur word-spacing: normal; Dap ibus Inceptos Cons ctetur @mandy_kerr

Slide 62

Slide 62

letter-spacing letter-spacing: 0.5em; letter-spacing: -0.15em; letter-spacing: normal; J e l l o i s a f l u f f y f e l l o w Jelloisafluffyfellow Jello is a fluffy fellow @mandy_kerr

Slide 63

Slide 63

line-height Cras justo odio, dapibus ac facilisis in, line-height: 0.5; egestas eget quam. Duis mollis, est non commodo luctus, nisi erat porttitor. line-height: -0.5; Cras justo odio, dapibus ac facilisis in, egestas eget quam. Duis mollis, est non commodo luctus, nisi erat porttitor. @mandy_kerr

Slide 64

Slide 64

Household Outdoors New Kitchen Kids & Games Shop By Price

Slide 65

Slide 65

Household Outdoors Kitchen New Kids & Games Shop By Price Xmas SALE

Slide 66

Slide 66

Household Outdoors Kitchen NewKids & Games Shop By Price Xmas SALE

Slide 67

Slide 67

@mandy_kerr

Slide 68

Slide 68

28px Jello is a fluffy fellow 28px Little fluffy Jello, the little mellow fellow, little yellow Jello, eating my marshmallow. Your little squishy face, and floopy little ears. Little floofy Jello, always here to say hello. @mandy_kerr

Slide 69

Slide 69

Jello is a fluffy fellow Jello is a fluffy fellow @mandy_kerr

Slide 70

Slide 70

Leading Jello is a fluffy fellow @mandy_kerr

Slide 71

Slide 71

leading-trim (Draft spec) Cap Height Jello is a fluffy fellow Ideographic baseline h1 { leading-trim: cap ideographic; } https://github.com/w3c/csswg-drafts/issues/3240 @mandy_kerr

Slide 72

Slide 72

Creating lines with TEXT-DECORATION @mandy_kerr

Slide 73

Slide 73

text-decoration-color Jello Is A Fluffy Fellow text-decoration-color: yellow @mandy_kerr

Slide 74

Slide 74

text-decoration-thickness Jello Is A Fluffy Fellow text-decoration-thickness: 10px @mandy_kerr

Slide 75

Slide 75

text-decoration-thickness auto from-font @mandy_kerr

Slide 76

Slide 76

text-underline-offset Jello Is A Fluffy Fellow text-underline-offset: 15px; @mandy_kerr

Slide 77

Slide 77

@mandy_kerr

Slide 78

Slide 78

@mandy_kerr

Slide 79

Slide 79

@mandy_kerr

Slide 80

Slide 80

@mandy_kerr

Slide 81

Slide 81

Cleaner rendering with FONT SMOOTHING @mandy_kerr

Slide 82

Slide 82

font-smooth -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; @mandy_kerr

Slide 83

Slide 83

Improving TEXT ON THE WEB. @mandy_kerr

Slide 84

Slide 84

Slide 85

Slide 85

Thanks & Resources… Font Types & Properties www.harbortype.com/fonts/rocher-color material.io/blog/color-fonts-are-here alistapart.com/article/web-typography-numerals www.typography.com/fonts/surveyor wakamaifondue.com developer.mozilla.org/en-US/docs/Web/CSS/font-variant-alternates developer.mozilla.org/en-US/docs/Web/CSS/font-variant-numeric developer.mozilla.org/en-US/docs/Web/CSS/font-variant-ligatures Text Properties usabilitypost.com/2012/11/05/stop-fixing-font-smoothing/ github.com/google/fonts/issues/1170 developer.mozilla.org/en-US/docs/Web/CSS/text-decoration-thickness @mandy_kerr