Designing for words: elements of typography style for the web

124
Designing for Words Elements of Typographic Style for the Web Luke Murphy-Wearmouth @lurkmoophy

description

An introduction to typography and the thinking behind typographic choices, as well as how we can implement these rules and guides on the web. Delivered at Second Wednesday (#secwed) on Wednesday 13th August, 2014

Transcript of Designing for words: elements of typography style for the web

Page 1: Designing for words: elements of typography style for the web

Designing for Words

Elements of Typographic Style for the Web

Luke Murphy-Wearmouth @lurkmoophy

Page 2: Designing for words: elements of typography style for the web

I am not an expert. I am an enthusiast.

Page 3: Designing for words: elements of typography style for the web

leave the road when you wish.

Page 4: Designing for words: elements of typography style for the web

break the rules, break them beautifully, deliberately and well.

Page 5: Designing for words: elements of typography style for the web

The sections: 1. An Introduction to Type 2. Choosing the Right Tool 3. Typesetting for the Web 4. Typesetting for RWD

Page 6: Designing for words: elements of typography style for the web

An Introduction to Type

Page 7: Designing for words: elements of typography style for the web

Typeface vs Font 1. Typeface — the overall design of a collection

Helvetica is a typeface

Page 8: Designing for words: elements of typography style for the web

Typeface vs Font 1. Typeface — the overall design of a collection

Helvetica is a typeface 2. Font — The physical embodiment of a collection of

letters, numbers, symbols etc. Helvetica Bold is a font

Page 9: Designing for words: elements of typography style for the web

Typeface vs Font !

font is what you use Typeface is what you see

Page 10: Designing for words: elements of typography style for the web

Typesetting 1. Typesetting is the composition of text by means of

arranging physical types or the digital equivalents.

Page 11: Designing for words: elements of typography style for the web

Anatomy of a character 1. x-height — the space between the baseline and the

mean line. The height of a lowercase x.

Page 12: Designing for words: elements of typography style for the web

xbaseline

meanline

Page 13: Designing for words: elements of typography style for the web

Anatomy of a character 1. x-height — the space between the baseline and the

mean line. The height of a lowercase x. 2. ascenders and descenders — the tops and bottoms of

letters like b, d, j, q

Page 14: Designing for words: elements of typography style for the web

bascender qdescender

Page 15: Designing for words: elements of typography style for the web

Anatomy of a character 1. x-height — the space between the baseline and the

mean line. The height of a lowercase x. 2. ascenders and descenders — the tops and bottoms of

letters like b, d, j, q 3. cap-height — height of a capital letter

Page 16: Designing for words: elements of typography style for the web

Hcap-height

Page 17: Designing for words: elements of typography style for the web

Anatomy of a character 4. counter — the open space within a letter, both partially

closed (c) and closed (o)

Page 18: Designing for words: elements of typography style for the web

d counter

Page 19: Designing for words: elements of typography style for the web

Anatomy of a character 4. counter — the open space within a letter, both partially

closed (c) and closed (o) 5. serif — a little stroke found at the end of main vertical

and horizontal strokes of some letterforms

Page 20: Designing for words: elements of typography style for the web

dserif

serif

Page 21: Designing for words: elements of typography style for the web

Kerning 1. adjusting the space between characters in a

proportional font to achieve a visually pleasing result

Page 22: Designing for words: elements of typography style for the web

War

Page 23: Designing for words: elements of typography style for the web

War

Page 24: Designing for words: elements of typography style for the web

Leading 1. The space between baselines

Page 25: Designing for words: elements of typography style for the web

Choosing the Right Tool

Page 26: Designing for words: elements of typography style for the web

A type that stops you in the middle of a sentence and asks you to admire its smartness is a bad type

Page 27: Designing for words: elements of typography style for the web

Legibility & Beauty

Page 28: Designing for words: elements of typography style for the web

The way we read

Page 29: Designing for words: elements of typography style for the web

rodscones

Page 30: Designing for words: elements of typography style for the web

rodscones

process detail register sharpness

Page 31: Designing for words: elements of typography style for the web

detect movement sensitive in low light

rodscones

process detail register sharpness

Page 32: Designing for words: elements of typography style for the web

foveal

Page 33: Designing for words: elements of typography style for the web

foveal parafoveal

Page 34: Designing for words: elements of typography style for the web

foveal parafoveal peripheral

Page 35: Designing for words: elements of typography style for the web

this is a sentence made of words

saccade

Page 36: Designing for words: elements of typography style for the web

this is a sentence made of wordsfixation point

Page 37: Designing for words: elements of typography style for the web

The morning had dawned clear and cold, with a crispness that hinted at the end of summer. They set forth at daybreak to see a man beheaded, twenty in all, and Bran rode among them, nervous with excitement. This was the first time he had been deemed old enough to go with his lord father and his brothers to see the king's justice done. It was the ninth year of summer, and the seventh of Bran's life. !

The man had been taken outside a small holdfast in the hills. Robb thought he was a wildling, his sword sworn to Mance Rayder, the King-beyond-the-Wall. It made Bran's skin prickle to think of it. He remembered the hearth tales Old Nan told them. The wildlings were cruel men, she said, slavers and slayers and thieves. They consorted with giants and ghouls, stole girl children in the dead of night, and drank blood from polished horns. And their women lay with the Others in the Long Night to sire terrible half-human children.

Page 38: Designing for words: elements of typography style for the web

Testing 1. greater understanding > speed

Page 39: Designing for words: elements of typography style for the web

the Rules 1. Read the text before designing it

Page 40: Designing for words: elements of typography style for the web

the Rules 1. Read the text before designing it 2. Work out the inner logic of the text

Page 41: Designing for words: elements of typography style for the web

the Rules 1. Read the text before designing it 2. Work out the inner logic of the text 3. Consider the other elements

Page 42: Designing for words: elements of typography style for the web

the Rules 1. Read the text before designing it 2. Work out the inner logic of the text 3. Consider the other elements 4. Honour and elucidate the character of the text

Page 43: Designing for words: elements of typography style for the web

the Rules 1. Read the text before designing it 2. Work out the inner logic of the text 3. Consider the other elements 4. Honour and elucidate the character of the text 5. Shape the page

Page 44: Designing for words: elements of typography style for the web

the Rules 1. Read the text before designing it 2. Work out the inner logic of the text 3. Consider the other elements 4. Honour and elucidate the character of the text 5. Shape the page 6. Give full attention to incidental details

Page 45: Designing for words: elements of typography style for the web

Learn the basics of identification

Page 46: Designing for words: elements of typography style for the web

3 contexts 1. Technical

Page 47: Designing for words: elements of typography style for the web

What was the original intended use?

Page 48: Designing for words: elements of typography style for the web

Special effects

Page 49: Designing for words: elements of typography style for the web

Consider usage

Page 50: Designing for words: elements of typography style for the web

Licensing

Page 51: Designing for words: elements of typography style for the web

3 contexts 1. Technical 2. Thematic

Page 52: Designing for words: elements of typography style for the web

Suit the task as well as the subject

Page 53: Designing for words: elements of typography style for the web

3 contexts 1. Technical 2. Thematic 3. Historical

Page 54: Designing for words: elements of typography style for the web

the natural idiom

Page 55: Designing for words: elements of typography style for the web

Echos & associations

Page 56: Designing for words: elements of typography style for the web

Webfonts 1. Rendering

Page 57: Designing for words: elements of typography style for the web

Type Rendering Mix typerendering.com

Page 58: Designing for words: elements of typography style for the web

Webfonts 1. Rendering 2. FOUT

http://help.typekit.com/customer/portal/articles/6853-styling-fallback-fonts-using-font-events !

http://24ways.org/2010/using-the-webfont-loader-to-make-browsers-behave-the-same/

Page 59: Designing for words: elements of typography style for the web

Typesetting for the Web

Page 60: Designing for words: elements of typography style for the web

Modular scale

Page 61: Designing for words: elements of typography style for the web

Use ems not pt 1. EU law

Page 62: Designing for words: elements of typography style for the web

Use ems not pt 1. EU law 2. It keeps everything relative and scalable

Page 63: Designing for words: elements of typography style for the web

Use ems not pt 1. EU law 2. It keeps everything relative and scalable 3. ems vs rems

Page 64: Designing for words: elements of typography style for the web

Choosing your scale !

0.75 0.83 1 1.1667 1.333 1.5 1.75 2 3 4 5

http://www.type-scale.com.com/

Page 65: Designing for words: elements of typography style for the web

Choosing your scale !

0.75 0.83 1 1.1667 1.333 1.5 1.75 2 3 4 5 p h4 h3 h2 h1

Page 66: Designing for words: elements of typography style for the web

Choosing your scale !

body { font-size: 16px; } !

p { font-size: 1em; } !

h1 { font-size: 3em; }

Page 67: Designing for words: elements of typography style for the web

Margins 1. Lock the text block

Page 68: Designing for words: elements of typography style for the web

Margins 1. Lock the text block 2. Frame the text block

Page 69: Designing for words: elements of typography style for the web

Margins 1. Lock the text block 2. Frame the text block 3. Protect the text block

Page 70: Designing for words: elements of typography style for the web

Margins !

Rule of thumb: 5% either way

Page 71: Designing for words: elements of typography style for the web

Margins !

p { font-size: 1em; width: 90%; margin: 0 auto; }

Page 72: Designing for words: elements of typography style for the web

Measure 1. Ideal line length is 45-75 characters

http://css-tricks.com/bookmarklet-colorize-text-45-75-characters-line-length-testing/

Page 73: Designing for words: elements of typography style for the web

Measure 1. Ideal line length is 45-75 characters 2. Dependent on the font, alignment etc.

Page 74: Designing for words: elements of typography style for the web

Measure 1. Ideal line length is 45-75 characters 2. Dependent on the font, alignment etc. 3. Use ems not pxs/percentages

Page 75: Designing for words: elements of typography style for the web

Measure !

p { font-size: 1em; width: 90%; margin: 0 auto; max-width: 33em; }

Page 76: Designing for words: elements of typography style for the web

Letterspacing 1. Don’t letterspace lowercase letters without a reason

Page 77: Designing for words: elements of typography style for the web

Letterspacing 1. Don’t letterspace lowercase letters without a reason 2. Letterspace strings of capitals, small caps and

strings of digits

Page 78: Designing for words: elements of typography style for the web

letter-spacing: 1. You can use positive and negative values 2. It’s animatable 3. Sub-pixel values aren’t cross-browser

Page 79: Designing for words: elements of typography style for the web

letter-spacing: !

h1 { font-size: 3em; letter-spacing: 1em; } !

.string-of-digits { letter-spacing: 0.05em; }

Page 80: Designing for words: elements of typography style for the web

letter-spacing: !

$( document ).ready( function() { var rex = new RegExp( "([0-9]{3,})", “gm" ); $( “*” ).each( function(){    var $this = $( this );     var content = $this.html();    $this.html( content.replace( rex, “<span class= “string-of-digits”>$1</span>” ) ); });});

Page 81: Designing for words: elements of typography style for the web

Leading 1. Music is the space between notes

Page 82: Designing for words: elements of typography style for the web

Leading 1. Music is the space between notes 2. It’s about vertical rhythm and feel

Page 83: Designing for words: elements of typography style for the web

Leading 1. Music is the space between notes 2. It’s about vertical rhythm and feel 3. My rule of thumb: 140%

Page 84: Designing for words: elements of typography style for the web

Leading !

p { font-size: 1em; width: 90%; margin: 0 auto; max-width: 33em; line-height: 1.4em; }

Page 85: Designing for words: elements of typography style for the web

Kerning 1. Kern consistently or not at all 2. It’s more about font choice than technical solutions

Page 86: Designing for words: elements of typography style for the web

text-rendering: 1. auto

Page 87: Designing for words: elements of typography style for the web

text-rendering: 1. auto 2. optimizeSpeed

Page 88: Designing for words: elements of typography style for the web

text-rendering: 1. auto 2. optimizeSpeed 3. optimizeLegibility

Page 89: Designing for words: elements of typography style for the web

text-rendering: 1. auto 2. optimizeSpeed 3. optimizeLegibility 4. geometricPrecision

Page 90: Designing for words: elements of typography style for the web

text-rendering: !

p { font-size: 1em; width: 90%; margin: 0 auto; max-width: 33em; line-height: 1.4em; /*probably not a good idea yet */ text-rendering: optimizeLegibility }

Page 91: Designing for words: elements of typography style for the web

Kerning 1. Kern consistently or not at all 2. It’s more about font choice than technical solutions 3. kerning.js (if you’re a control freak)

#pixel-perfect { -letter-kern: 1px 1px 0 0 0   1px 0 2px 0 0   0 0 0; } !

Page 92: Designing for words: elements of typography style for the web

Vertical space and rhythm 1. Tempo should not change arbitrarily in music

Page 93: Designing for words: elements of typography style for the web

Vertical space and rhythm 1. Tempo should not change arbitrarily in music 2. Even multiples of the basic leading

Page 94: Designing for words: elements of typography style for the web

Vertical space and rhythm !

p { font-size: 1em; width: 90%; margin: 0 auto; max-width: 33em; line-height: 1.4em; margin-bottom: 0.7em; }

Page 95: Designing for words: elements of typography style for the web

Vertical space and rhythm !

p { font-size: 1em; width: 90%; margin: 0 auto 0.7em auto; max-width: 33em; line-height: 1.4em; }

Page 96: Designing for words: elements of typography style for the web

Vertical space and rhythm 1. Tempo should not change arbitrarily in music 2. Even multiples of the basic leading 3. Don’t interrupt the rhythm of the page

Page 97: Designing for words: elements of typography style for the web

Vertical space and rhythm !

p { font-size: 1em; width: 90%; margin: 0 auto 0.7em auto; max-width: 33em; line-height: 1.4em; hanging-punctuation: first; }

Page 98: Designing for words: elements of typography style for the web

Vertical space and rhythm !

blockquote p, .hanging-punctuation { text-indent: -0.5em; }

Page 99: Designing for words: elements of typography style for the web

Vertical space and rhythm !

ul, ol { padding-left: 0; overflow: visible; }

Page 100: Designing for words: elements of typography style for the web

Types of dashes 1. Pedantry at its finest

Page 101: Designing for words: elements of typography style for the web

Types of dashes !

subtraction sign/hyphen - en dash – &ndash; em dash — &mdash;

http://en.wikipedia.org/wiki/Dash

Page 102: Designing for words: elements of typography style for the web

Types of dashes 1. Pedantry at its finest 2. Use an en dashes with space either side in copy,

or a close set em dash

Page 103: Designing for words: elements of typography style for the web

Types of dashes 1. Pedantry at its finest 2. Use an en dashes with space either side in copy,

or a close set em dash 3. Use a close set en dash for ranges

Page 104: Designing for words: elements of typography style for the web

Hyphenation 1. Leave at least two characters behind 2. Take at least three forward 3. Avoid more than three hyphenated lines 4. Hyphenate according to conventions of language

Page 105: Designing for words: elements of typography style for the web

Quotation marks 1. " — straight quotes 2. &lsquo; &rsquo; and &ldquo; &rdquo;

Page 106: Designing for words: elements of typography style for the web

Quotation marks !

str = str.replace(/"(?=\w|$)/g, "&#8220;"); str = str.replace(/(?<=\w|^)"/g, "&#8221;"); str = str.replace(/(?<=[\w,.?!\)]|^)"/g, "&#8221;");

Page 107: Designing for words: elements of typography style for the web

Columns 1. Now possible with CSS3 and column-count:

Page 108: Designing for words: elements of typography style for the web

Columns !

p { font-size: 1em; width: 90%; margin: 0 auto 0.7em auto; max-width: 33em; line-height: 1.4em; column-count: 3; column-gap: 1.4em; -moz-column-count: 3; -moz-column-gap: 1.4em; -webkit-column-count: 3; -webkit-column-gap: 1.4em; }

Page 109: Designing for words: elements of typography style for the web

Columns 1. Now possible with CSS3 and column-count: 2. A word of caution…

Page 110: Designing for words: elements of typography style for the web

Rivers 1. Still manual

Page 111: Designing for words: elements of typography style for the web

Widows & orphans 1. Widows still manual, using &nbsp;

Page 112: Designing for words: elements of typography style for the web

Widows & orphans 1. Widows still manual, using &nbsp; 2. There are other solutions, but they come with a price

https://github.com/matthewlein/jQuery-widowFix

Page 113: Designing for words: elements of typography style for the web

Widows & orphans 1. Widows still manual, using &nbsp; 2. There are other solutions, but they come with a price 3. Orphans apparently sorted by the column algorithm

Page 114: Designing for words: elements of typography style for the web

Widows & orphans 1. Widows still manual, using &nbsp; 2. There are other solutions, but they come with a price 3. Orphans apparently sorted by the column algorithm 4. Don’t forget print

Page 115: Designing for words: elements of typography style for the web

Widows & orphans !

@media print { p { orphans: 3; } }

Page 116: Designing for words: elements of typography style for the web

Typesetting and Responsive Web Design

Page 117: Designing for words: elements of typography style for the web

The things that don’t matter !

(don’t hit me)

Page 118: Designing for words: elements of typography style for the web

Aim for consistency in quality

Page 119: Designing for words: elements of typography style for the web

The things that do matter

Page 120: Designing for words: elements of typography style for the web

Typographic scale

http://typecast.com/blog/a-more-modern-scale-for-web-typography

Page 121: Designing for words: elements of typography style for the web

Context

http://alistapart.com/column/responsive-typography-is-a-physical-discipline

Page 122: Designing for words: elements of typography style for the web

The rabbit hole

Page 123: Designing for words: elements of typography style for the web

colophon !

The body text was set in Minion Pro Medium, Medium Italic, Semibold and Semibold Italic !

The code text was set in Lucida Console Regular.

Page 124: Designing for words: elements of typography style for the web

Designing for Words

Elements of Typographic Style for the Web

Luke Murphy-Wearmouth @lurkmoophy