Upload
f-blanco
View
106
Download
1
Tags:
Embed Size (px)
DESCRIPTION
Citation preview
Beautiful WebTypography
Simon Pascal Klein — @klepas
Letter, text, & page
Version 5
❦
Beautiful Web Typography
Intro…
Beautiful Web Typography
I’m Pascal Klein.
Beautiful Web Typography
I’m…
Beautiful Web Typography
I’m…
a graphic & web designer;1.
Beautiful Web Typography
I’m…
a graphic & web designer;1.
a bit of a UI and UX aficionado;2.
Beautiful Web Typography
I’m…
a graphic & web designer;1.
a bit of a UI and UX aficionado;2.
and, incurably, a rampant ‘typophile’.3.
Beautiful Web Typography
‘Typophiles’ are über gεεks who
♥ typography.
Beautiful Web Typography
‘Typophiles’ are über gεεks who
♥ typography.
Hands up and make yourselves known.
Beautiful Web Typography
ty•pog•ra•phy | tīˈpägrəfē | •n
Beautiful Web Typography
ty•pog•ra•phy | tīˈpägrəfē | •n
Typography is the art of creating and setting type
with the purpose of honoring the text it sets.
Beautiful Web Typography
Beautiful Web Typography
Typography can bring aesthetic order to
information, helping users read & navigate.
Beautiful Web Typography
Beautiful Web Typography
i.e. make textual stuff look pretty.
☻
Beautiful Web Typography
Beautiful Web Typography
premise:
Beautiful Web Typography
The intertubes today are
info-heavy.
premise:
Beautiful Web Typography
The intertubes today are
info-heavy.
Much of it is textual.
premise:
Beautiful Web Typography
The intertubes today are
info-heavy.
Much of it is textual.
premise:
Much of it is a pain to read.
Beautiful Web Typography
Beautiful Web Typography
Assumptions?
Beautiful Web Typography
Assumptions?It sucks? It’s boring?
Beautiful Web Typography
Assumptions?
Limited to sans-serif only for readability?1.
It sucks? It’s boring?
Beautiful Web Typography
Assumptions?
Limited to sans-serif only for readability?1.
Only ‘web-safe’ fonts?2.
It sucks? It’s boring?
Beautiful Web Typography
Assumptions?
Limited to sans-serif only for readability?1.
Only ‘web-safe’ fonts?2.
Limited control—resort to Flash and other non-
standard technologies?
3.
It sucks? It’s boring?
Beautiful Web Typography
Beautiful Web Typography
Beautiful Web Typography
Not quite.
Beautiful Web Typography
Not quite.
(Yay!)
Beautiful Web Typography
Letter (micro)1.
Beautiful Web Typography
Letter (micro)1.
Page or grid (macro)3.
Beautiful Web Typography
Letter (micro)1.
Text2.
Page or grid (macro)3.
Beautiful Web Typography
Beautiful Web Typography
Reset0.
Beautiful Web Typography
Reset0.
All the browsers have their own default styling for
various (x)HTML elements. This makes it a pain for
cross-browser consistency.
Beautiful Web Typography
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td {margin:0;padding:0;}table {border-collapse:collapse;border-spacing:0;}fieldset,img {border:0;}address,caption,cite,code,dfn,em,strong,th,var {font-style: normal;font-weight:normal;}ul,ol {list-style:none;}caption,th {text-align:left;}h1,h2,h3,h4,h5,h6 {font-size:100%;font-weight:normal;}q:before,q:after {content:'';}abbr,acronym {border:0;}
Googling “CSS reset stylesheets” should land you
with numerous examples. This one above is from
the Yahoo! UI library.
Beautiful Web Typography
Beautiful Web Typography
Letter & Text
Beautiful Web Typography
Letter & Texttypeface (font) and style•
Beautiful Web Typography
Letter & Texttypeface (font) and style•
spacing (tracking/letter-spacing)•
Beautiful Web Typography
Letter & Texttypeface (font) and style•
spacing (tracking/letter-spacing)•
individual glyphs•
Beautiful Web Typography
Beautiful Web Typography
serifBeautiful Web Typography
serifsans serif
Beautiful Web Typography
serifsans serifscript
Beautiful Web Typography
serifsans serifscript
blackletter
Beautiful Web Typography
serifsans serifscript
blacklettermonospace
Beautiful Web Typography
Beautiful Web Typography
Mixing typefaces requires special attention. Try to
align x-heights and sizes. X-heights?
Beautiful Web Typography
Mixing typefaces requires special attention. Try to
align x-heights and sizes. X-heights?
Beautiful Web Typography
Helvetica Regular 96pt & Minion Pro Regular 96pt.
x-height x-height
Mixing typefaces requires special attention. Try to
align x-heights and sizes. X-heights?
Beautiful Web Typography
Helvetica Regular 96pt & Minion Pro Regular 96pt.
x-height x-height
Helvetica Regular 96pt & Minion Pro Regular 114pt.
x-heightx-height
Beautiful Web Typography
Use a limited palette of type families. A common
and effective technique is to pair a serif and a
sans serif face together. E.g.:
Beautiful Web Typography
Use a limited palette of type families. A common
and effective technique is to pair a serif and a
sans serif face together. E.g.:
one sets the body, the other the headings;1.
Beautiful Web Typography
Use a limited palette of type families. A common
and effective technique is to pair a serif and a
sans serif face together. E.g.:
one sets the body, the other the headings;1.
one sets primary content, the other UI controls.2.
Beautiful Web Typography
Use a limited palette of type families. A common
and effective technique is to pair a serif and a
sans serif face together. E.g.:
one sets the body, the other the headings;1.
one sets primary content, the other UI controls.2.
We do this with the font-family property.
Beautiful Web Typography
Beautiful Web Typography
…but only ‘web safe’ fonts?
Beautiful Web Typography
Beautiful Web Typography
Beautiful Web Typography
ArialVerdanaCourier New
Times New RomanGeorgiaTrebuchet MS
Options for setting fonts:
Beautiful Web Typography
Options for setting fonts:
Beautiful Web Typography
Installed fonts (mostly web-safe)1.
Options for setting fonts:
Beautiful Web Typography
sIFR or other JS and Flash replacement2.
Installed fonts (mostly web-safe)1.
Options for setting fonts:
Beautiful Web Typography
Cufón et al. (http://tinyurl.com/git-cufon)3.
sIFR or other JS and Flash replacement2.
Installed fonts (mostly web-safe)1.
Options for setting fonts:
Beautiful Web Typography
Cufón et al. (http://tinyurl.com/git-cufon)3.
sIFR or other JS and Flash replacement2.
webfonts: EOT/EOT Lite via @font-face4.
Installed fonts (mostly web-safe)1.
Options for setting fonts:
webfonts: OT/TTF via @font-face5.
Beautiful Web Typography
Cufón et al. (http://tinyurl.com/git-cufon)3.
sIFR or other JS and Flash replacement2.
webfonts: EOT/EOT Lite via @font-face4.
Installed fonts (mostly web-safe)1.
Options for setting fonts:
webfonts: OT/TTF via @font-face5.
Beautiful Web Typography
Cufón et al. (http://tinyurl.com/git-cufon)3.
sIFR or other JS and Flash replacement2.
webfonts: EOT/EOT Lite via @font-face4.
Installed fonts (mostly web-safe)1.
Typekit, Fontdeck, Kernest, et al.6.
Options for setting fonts:
webfonts: OT/TTF via @font-face5.
Beautiful Web Typography
Cufón et al. (http://tinyurl.com/git-cufon)3.
sIFR or other JS and Flash replacement2.
webfonts: EOT/EOT Lite via @font-face4.
Installed fonts (mostly web-safe)1.
OpenType permissions extension?7.
Typekit, Fontdeck, Kernest, et al.6.
Options for setting fonts:
webfonts: OT/TTF via @font-face5.
Beautiful Web Typography
Cufón et al. (http://tinyurl.com/git-cufon)3.
sIFR or other JS and Flash replacement2.
webfonts: EOT/EOT Lite via @font-face4.
Installed fonts (mostly web-safe)1.
OpenType permissions extension?7.
Typekit, Fontdeck, Kernest, et al.6.
.webfont proposal?8.
Beautiful Web Typography
. Installed or web-safe fonts
Simply call upon them directly in your font stack
declarations, e.g.:
Beautiful Web Typography
. Installed or web-safe fonts
Simply call upon them directly in your font stack
declarations, e.g.:
font-family: Baskerville, Times,
'Times New Roman', serif;
Beautiful Web Typography
. Installed or web-safe fonts
Simply call upon them directly in your font stack
declarations, e.g.:
font-family: Baskerville, Times,
'Times New Roman', serif;
Beautiful Web Typography
. Installed or web-safe fonts
font-family: 'Helvetica Neue', Helvetica,
'Arial', sans-serif;
Font stacks:
Beautiful Web Typography
Font stacks:
desired•
Beautiful Web Typography
Font stacks:
desired•
fallback•
Beautiful Web Typography
Font stacks:
desired•
fallback•
Beautiful Web Typography
generic (e.g. serif, sans-serif, monospace)•
Flash text replacement that in unison with JS
replaces type using type from a Flash file.
Beautiful Web Typography
. s et al.
Flash text replacement that in unison with JS
replaces type using type from a Flash file.
Beautiful Web Typography
. s et al.
Not a feasible solution long-term:
Flash text replacement that in unison with JS
replaces type using type from a Flash file.
Beautiful Web Typography
. s et al.
Not a feasible solution long-term:
does subsetting;1.
Flash text replacement that in unison with JS
replaces type using type from a Flash file.
Beautiful Web Typography
. s et al.
Not a feasible solution long-term:
does subsetting;1.
non-standard solution—relies on both Flash and JS;2.
Flash text replacement that in unison with JS
replaces type using type from a Flash file.
Beautiful Web Typography
. s et al.
Not a feasible solution long-term:
does subsetting;1.
non-standard solution—relies on both Flash and JS;2.
high page load time—not feasible for body copy.3.
These were the first JS-only implementations.
Cufón converts font paths to VML paths stored in
JSON, then rendering the font paths using JS.
Beautiful Web Typography
. Cufón & other implementations
These were the first JS-only implementations.
Cufón converts font paths to VML paths stored in
JSON, then rendering the font paths using JS.
Beautiful Web Typography
. Cufón & other implementations
Various thoughts and concerns:
These were the first JS-only implementations.
Cufón converts font paths to VML paths stored in
JSON, then rendering the font paths using JS.
Beautiful Web Typography
. Cufón & other implementations
Various thoughts and concerns:
not accessible but works in most browsers;1.
These were the first JS-only implementations.
Cufón converts font paths to VML paths stored in
JSON, then rendering the font paths using JS.
Beautiful Web Typography
. Cufón & other implementations
Various thoughts and concerns:
not accessible but works in most browsers;1.
type foundries are/were skeptical—not a ‘service’;
limited palette of typefaces;
2.
These were the first JS-only implementations.
Cufón converts font paths to VML paths stored in
JSON, then rendering the font paths using JS.
Beautiful Web Typography
. Cufón & other implementations
Various thoughts and concerns:
not accessible but works in most browsers;1.
type foundries are/were skeptical—not a ‘service’;
limited palette of typefaces;
2.
converter is often proprietary;3.
Developed by Microsoft, Embedded OpenType
subsets, compresses, and encrypts OT and TTF. Can
be restricted a list of trusted roots. Uses webfonts.
Described as ‘DRM icing on an OpenType cake’.
Beautiful Web Typography
. webfonts: / Lite
Developed by Microsoft, Embedded OpenType
subsets, compresses, and encrypts OT and TTF. Can
be restricted a list of trusted roots. Uses webfonts.
Described as ‘DRM icing on an OpenType cake’.
Beautiful Web Typography
. webfonts: / Lite
Not feasible as-is currently:
Developed by Microsoft, Embedded OpenType
subsets, compresses, and encrypts OT and TTF. Can
be restricted a list of trusted roots. Uses webfonts.
Described as ‘DRM icing on an OpenType cake’.
Beautiful Web Typography
. webfonts: / Lite
Not feasible as-is currently:
non-standard, proprietary solution;1.
Developed by Microsoft, Embedded OpenType
subsets, compresses, and encrypts OT and TTF. Can
be restricted a list of trusted roots. Uses webfonts.
Described as ‘DRM icing on an OpenType cake’.
Beautiful Web Typography
. webfonts: / Lite
Not feasible as-is currently:
non-standard, proprietary solution;1.
requires a proprietary converter (WEFT) to use;2.
Developed by Microsoft, Embedded OpenType
subsets, compresses, and encrypts OT and TTF. Can
be restricted a list of trusted roots. Uses webfonts.
Described as ‘DRM icing on an OpenType cake’.
Beautiful Web Typography
. webfonts: / Lite
Not feasible as-is currently:
non-standard, proprietary solution;1.
requires a proprietary converter (WEFT) to use;2.
proposal rejected by W3C & only supported by IE.3.
Also uses webfonts CSS @font-face and links
directly via the src: declaration to an OT/TTF file
which is downloaded and used to render the type.
Beautiful Web Typography
. webfonts: /
Also uses webfonts CSS @font-face and links
directly via the src: declaration to an OT/TTF file
which is downloaded and used to render the type.
Beautiful Web Typography
. webfonts: /
Feasible but:
Also uses webfonts CSS @font-face and links
directly via the src: declaration to an OT/TTF file
which is downloaded and used to render the type.
Beautiful Web Typography
. webfonts: /
Feasible but:
OT/TTF files can easily be downloaded;1.
Also uses webfonts CSS @font-face and links
directly via the src: declaration to an OT/TTF file
which is downloaded and used to render the type.
Beautiful Web Typography
. webfonts: /
Feasible but:
OT/TTF files can easily be downloaded;1.
supported in Safari 3.1+, Firefox 3.5+ (planned for
Opera 10 and Chrome 2.0 beta);
2.
Also uses webfonts CSS @font-face and links
directly via the src: declaration to an OT/TTF file
which is downloaded and used to render the type.
Beautiful Web Typography
. webfonts: /
Feasible but:
OT/TTF files can easily be downloaded;1.
supported in Safari 3.1+, Firefox 3.5+ (planned for
Opera 10 and Chrome 2.0 beta);
2.
subsetting or compression comes down to author.3.
Generally foundry initiatives that are JS-based
(though not exclusively) and hosted, paid
subscription models: select, pay, inject; done.
Beautiful Web Typography
. Typekit, Fontdeck, Kernetst, et al.
Generally foundry initiatives that are JS-based
(though not exclusively) and hosted, paid
subscription models: select, pay, inject; done.
Beautiful Web Typography
. Typekit, Fontdeck, Kernetst, et al.
Thoughts:
Generally foundry initiatives that are JS-based
(though not exclusively) and hosted, paid
subscription models: select, pay, inject; done.
Beautiful Web Typography
. Typekit, Fontdeck, Kernetst, et al.
Thoughts:
deemed ‘the solution’ (though still in-the-works);1.
Generally foundry initiatives that are JS-based
(though not exclusively) and hosted, paid
subscription models: select, pay, inject; done.
Beautiful Web Typography
. Typekit, Fontdeck, Kernetst, et al.
Thoughts:
deemed ‘the solution’ (though still in-the-works);1.
2. standards-based, good browser support, and easy;
Generally foundry initiatives that are JS-based
(though not exclusively) and hosted, paid
subscription models: select, pay, inject; done.
Beautiful Web Typography
. Typekit, Fontdeck, Kernetst, et al.
Thoughts:
deemed ‘the solution’ (though still in-the-works);1.
subsetting and/or compression service-side.3.
2. standards-based, good browser support, and easy;
Beautiful Web Typography
Proposed by David Burlow from Font Bureau as a
simple permissions table extension for OpenType
with a perm tag.
Beautiful Web Typography
. OpenType permissions extension?
Proposed by David Burlow from Font Bureau as a
simple permissions table extension for OpenType
with a perm tag.
Beautiful Web Typography
. OpenType permissions extension?
Thoughts:
Proposed by David Burlow from Font Bureau as a
simple permissions table extension for OpenType
with a perm tag.
Beautiful Web Typography
. OpenType permissions extension?
Thoughts:
simple: no change in the OT format, no wrapper;1.
Proposed by David Burlow from Font Bureau as a
simple permissions table extension for OpenType
with a perm tag.
Beautiful Web Typography
. OpenType permissions extension?
Thoughts:
simple: no change in the OT format, no wrapper;1.
2. standards-based, but no compression;
Proposed by David Burlow from Font Bureau as a
simple permissions table extension for OpenType
with a perm tag.
Beautiful Web Typography
. OpenType permissions extension?
Thoughts:
simple: no change in the OT format, no wrapper;1.
reverse-engineer-able (just edit the XML); 3.
2. standards-based, but no compression;
Proposed by Tal Leming & Erik van Blokland as an
alternative to EOT, compressing the font and an
accompanying meta-data XML file. Uses webfonts.
Beautiful Web Typography
. .webfont proposal
Proposed by Tal Leming & Erik van Blokland as an
alternative to EOT, compressing the font and an
accompanying meta-data XML file. Uses webfonts.
Beautiful Web Typography
. .webfont proposal
Considerations:
Proposed by Tal Leming & Erik van Blokland as an
alternative to EOT, compressing the font and an
accompanying meta-data XML file. Uses webfonts.
Beautiful Web Typography
. .webfont proposal
Considerations:
compact, simple, elegant, easily standards-based;1.
Proposed by Tal Leming & Erik van Blokland as an
alternative to EOT, compressing the font and an
accompanying meta-data XML file. Uses webfonts.
Beautiful Web Typography
. .webfont proposal
Considerations:
compact, simple, elegant, easily standards-based;1.
2. reverse-engineer-able; CORS in discussion;
Proposed by Tal Leming & Erik van Blokland as an
alternative to EOT, compressing the font and an
accompanying meta-data XML file. Uses webfonts.
Beautiful Web Typography
. .webfont proposal
Considerations:
compact, simple, elegant, easily standards-based;1.
…but (surprisingly) gaining huge support from
type designers and foundries alike.
3.
2. reverse-engineer-able; CORS in discussion;
Beautiful Web Typography
<fontdata> name, file name, format
<creationdate> creation data stamp of font file
<vendor> vendor info; attr.: name, URL
<designer> designer info; attr.: name, URL, role
<license> license; attr.: URL, ID
<licenseename> name for the licensee of the font
<description> description for the font
<copyright> copyright for the font
<trademark> trademark for the font
<privatedata> additional arbitrary, private info.
Beautiful Web Typography
Beautiful Web Typography
Meanwhile:
Beautiful Web Typography
Webfonts aren’t the holy grail of web
typography problems…
Meanwhile:
– Jeff Cro
“Typography is not picking a ‘cool’ font.”
Beautiful Web Typography
Webfonts aren’t the holy grail of web
typography problems…
Meanwhile:
Beautiful Web Typography
Beautiful Web Typography
Also remember, most fonts available from
type foundries are not optimised for screen
usage; they’re for print.
Beautiful Web Typography
Use a combination of families, styles, weights and
to breath some fresh air into your web type.
Beautiful Web Typography
Use a combination of families, styles, weights and
to breath some fresh air into your web type.
font-weight controls weight and accepts
numerical and descriptive (e.g. normal) values.
•
Beautiful Web Typography
Use a combination of families, styles, weights and
to breath some fresh air into your web type.
font-weight controls weight and accepts
numerical and descriptive (e.g. normal) values.
•
font-style controls… style. Accepts the descrip-
tive values (normal, italic, and oblique).
•
Beautiful Web Typography
Use a combination of families, styles, weights and
to breath some fresh air into your web type.
font-weight controls weight and accepts
numerical and descriptive (e.g. normal) values.
•
font-style controls… style. Accepts the descrip-
tive values (normal, italic, and oblique).
•
font-variant controls case and accepts the
values normal and small-caps.
•
Beautiful Web Typography
Beautiful Web Typography
roman (‘normal’)Beautiful Web Typography
roman (‘normal’)Beautiful Web Typography
roman (‘normal’)italic
Beautiful Web Typography
roman (‘normal’)italic oblique≠
Beautiful Web Typography
roman (‘normal’)italic oblique≠
Beautiful Web Typography
roman (‘normal’)italic oblique≠
Beautiful Web Typography
roman (‘normal’)italicultralight regular bold
oblique≠
Beautiful Web Typography
roman (‘normal’)italicultralight regular bold
oblique≠
Beautiful Web Typography
roman (‘normal’)italicultralight regular bold
& bold italic condensed
oblique≠
Beautiful Web Typography
roman (‘normal’)italicultralight regular bold
& bold italic condensed
oblique≠
Beautiful Web Typography
roman (‘normal’)italicultralight regular bold
& bold italic condensedSMALL-CAPITALS
oblique≠
Beautiful Web Typography
roman (‘normal’)italicultralight regular bold
& bold italic condensedSMALL-CAPITALS
oblique≠
Beautiful Web Typography
Web Typography
Web Typography
TRACKING
Web Typography
TRACKINGTRACKING
Web Typography
Letter-spacingTRACKINGTRACKING
Web Typography
Letter-spacingLetter-spacingTRACKINGTRACKING
Beautiful Web Typography
Letʼs see some loose word-spacing in action…
Beautiful Web Typography
Letʼs see some loose word-spacing in action…
And now both loose word-spacing and tracking featured together.
Beautiful Web Typography
Beautiful Web Typography
And finally, the recent popular trend of negative tracking.
Beautiful Web Typography
Beautiful Web Typography
Tracking and word-spacing can help differentiate,
aiding readability by removing disruption.
Beautiful Web Typography
Tracking and word-spacing can help differentiate,
aiding readability by removing disruption.
E.g. setting acronyms or numerical tabular data.
Beautiful Web Typography
Beautiful Web Typography
Full-capital acronyms, along with other full-cap-
sized glyphs can disturb the flow of the text:
Beautiful Web Typography
Full-capital acronyms, along with other full-cap-
sized glyphs can disturb the flow of the text:
Lorem ipsum dolor sit amet, NASA consectetur adipiscing et. Vestibulum elit pellentesque; habitant orci tristique senectus et 4,962 malesuada fames ac turpis egestas HTML sit lectus.
Beautiful Web Typography
Full-capital acronyms, along with other full-cap-
sized glyphs can disturb the flow of the text:
Lorem ipsum dolor sit amet, NASA consectetur adipiscing et. Vestibulum elit pellentesque; habitant orci tristique senectus et 4,962 malesuada fames ac turpis egestas HTML sit lectus.
Lorem ipsum dolor sit amet, NASA consectetur adipiscing et. Vestibulum elit pellentesque; habitant orci tristique senectus et , malesuada fames ac turpis egestas HTML sit lectus.
Beautiful Web Typography
Beautiful Web Typography
letter-spacing and word-spacing controls
tracking and word-spacing respectively. Both take
numerical values and normal.
•
Beautiful Web Typography
letter-spacing and word-spacing controls
tracking and word-spacing respectively. Both take
numerical values and normal.
•
Sadly no property for controlling figure variants—
hopes set for CSS3. For now use Georgia which
(only) features hanging or ‘old-style’ figures.
Beautiful Web Typography
Beautiful Web Typography
font-size controls… font sizes. Takes numerical
and descriptive values. Most user agents
(browsers) set default value at 16px.
•
Beautiful Web Typography
font-size controls… font sizes. Takes numerical
and descriptive values. Most user agents
(browsers) set default value at 16px.
•
Size font sizes relatively using ems or %.
Beautiful Web Typography
font-size controls… font sizes. Takes numerical
and descriptive values. Most user agents
(browsers) set default value at 16px.
•
Size font sizes relatively using ems or %.
An em is a relative unit best to be thought of as a
box. It is relative to the point size of a specific
font (i.e. 1 em in a 12 point typeface is 12 point).
Beautiful Web Typography
Why?
Beautiful Web Typography
Why?
Beautiful Web Typography
Some UAs don’t support font-resizing (Ctrl + +/-) or
page scaling when measurements are defined in
absolute terms.
•
Why?
Beautiful Web Typography
Some UAs don’t support font-resizing (Ctrl + +/-) or
page scaling when measurements are defined in
absolute terms.
•
JS-based text resize widgets ≠ text accessibility.•
Why?
Beautiful Web Typography
Some UAs don’t support font-resizing (Ctrl + +/-) or
page scaling when measurements are defined in
absolute terms.
•
JS-based text resize widgets ≠ text accessibility.•
Many devices and many user agents—be careful in
making assumptions.
•
Beautiful Web Typography
Key: remember font sizes are inherited:
parents → children.
Beautiful Web Typography
Key: remember font sizes are inherited:
parents → children.
To calculate, find what one pixel is in ems and
then multiply by the desired font size (in pixels):
Beautiful Web Typography
Key: remember font sizes are inherited:
parents → children.
1 ÷ parent font-size × required pixel value= em value
To calculate, find what one pixel is in ems and
then multiply by the desired font size (in pixels):
Beautiful Web Typography
.% trick
Beautiful Web Typography
.% trickSimplify your calculations. Consider:
p { font-size: 80%; }blockquote { font-size: 80%; }
Beautiful Web Typography
80% of 16px is 12.8px, so p and blockquote
elements will be that size, but what happens
when we put a p element inside a blockquote
element? The parent (blockquote) is 12.8px so the
p will be rendered at 80% of that: 10.42px.
.% trickSimplify your calculations. Consider:
p { font-size: 80%; }blockquote { font-size: 80%; }
Beautiful Web Typography
.% trick (cont’d)
Beautiful Web Typography
In 2004 Richard Rutter wrote an article outlining a trick he used to make these calculations simpler:
.% trick (cont’d)
browsers have common default size of 16px; thus:•
Beautiful Web Typography
In 2004 Richard Rutter wrote an article outlining a trick he used to make these calculations simpler:
.% trick (cont’d)
browsers have common default size of 16px; thus:•
set body to 62.5% and reset all to 10px; thus:•
Beautiful Web Typography
In 2004 Richard Rutter wrote an article outlining a trick he used to make these calculations simpler:
.% trick (cont’d)
browsers have common default size of 16px; thus:•
set body to 62.5% and reset all to 10px; thus:•
from here calculations are simpler for direct
descendants of the body, e.g. 12px = 1.2em; 8px =
0.8em. Further nested elements are (still) relative.
•
Beautiful Web Typography
In 2004 Richard Rutter wrote an article outlining a trick he used to make these calculations simpler:
Beautiful Web Typography
To find an element’s font size in absolute terms
(e.g. pixels) you can use the Firefox Web Develop
Extension, Information → Display Element
Information.
Beautiful Web Typography
Don’t just arbitrarily set type; use a scale:
Stick it to a scale
Beautiful Web Typography
Don’t just arbitrarily set type; use a scale:
Stick it to a scale
6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 21, 24, 36, 48, 60, 72.the “classic scale”
9, 10, 11, 12, 13, 14, 18, 24, 36, 48, 64, 72, 96.another scale
8, 13, 21, 34, 55, 89.scale based on the Fibonacci sequence
Beautiful Web Typography
Beautiful Web Typography
Beautiful Web Typography
At small sizes font-decoration: underline;
can render descender glyphs (g, j, p, q, y) difficult
to read: use border-bottom: 1px solid;
Beautiful Web Typography
At small sizes font-decoration: underline;
can render descender glyphs (g, j, p, q, y) difficult
to read: use border-bottom: 1px solid;
…consectetuer adipiscing elit…
…adipiscing elit…
Beautiful Web Typography
At small sizes font-decoration: underline;
can render descender glyphs (g, j, p, q, y) difficult
to read: use border-bottom: 1px solid;
…consectetuer adipiscing elit…
…adipiscing elit…
…consectetuer adipiscing elit…
…adipiscing elit…
Beautiful Web Typography
Correct glyphs
Beautiful Web Typography
Correct glyphsConsider:
' "
Beautiful Web Typography
Correct glyphsConsider:
' "1'61"
Beautiful Web Typography
"is is a group of words surrounded by a bunch of tick marks."
Beautiful Web Typography
“is is a quotation!”- Jeff Cro
Beautiful Web Typography
‘ ’ “ ”’
Beautiful Web Typography
Beautiful Web Typography
- hyphen Mary-Anne, Dominique Strauss-Kahn
– en dash April–May, ages –, pp. –
— em dash Phrase marker—not spaced—like this.
– minus 5–4=1
Beautiful Web Typography
Beautiful Web Typography
“ opening double quote “” closing double quote ”‘ opening single quote ‘’ closing single quote ’– en dash –— em dash —− minus −× multiplication ×… ellipsis …
Smartypants et al.
Beautiful Web Typography
Smartypants et al.‘Doing something repetitive? Likely you’re doing it wrong.’
Beautiful Web Typography
Smartypants et al. are scripts that translate plain
ASCII characters into “smart” typographic (x)HTML
entities (not just for punctuation).
Smartypants et al.‘Doing something repetitive? Likely you’re doing it wrong.’
Beautiful Web Typography
Smartypants et al. are scripts that translate plain
ASCII characters into “smart” typographic (x)HTML
entities (not just for punctuation).
Smartypants et al.‘Doing something repetitive? Likely you’re doing it wrong.’
Beautiful Web Typography
Smartypants (PHP, Perl, & Movable Type);•
Smartypants et al. are scripts that translate plain
ASCII characters into “smart” typographic (x)HTML
entities (not just for punctuation).
Smartypants et al.‘Doing something repetitive? Likely you’re doing it wrong.’
Beautiful Web Typography
Smartypants (PHP, Perl, & Movable Type);•
Typogrify (Python/Django);•
Smartypants et al. are scripts that translate plain
ASCII characters into “smart” typographic (x)HTML
entities (not just for punctuation).
Smartypants et al.‘Doing something repetitive? Likely you’re doing it wrong.’
Beautiful Web Typography
Smartypants (PHP, Perl, & Movable Type);•
Typogrify (Python/Django);•
wp-typogrify (WordPress);•
Smartypants et al. are scripts that translate plain
ASCII characters into “smart” typographic (x)HTML
entities (not just for punctuation).
Smartypants et al.‘Doing something repetitive? Likely you’re doing it wrong.’
Beautiful Web Typography
Smartypants (PHP, Perl, & Movable Type);•
Typogrify (Python/Django);•
wp-typogrify (WordPress);•
Markdown et al., …•
Beautiful Web Typography
Give ampersands love
Beautiful Web Typography
Give ampersands love
Beautiful Web Typography
Italic ampersand variants are often much prettier
than their common roman counterparts:
Give ampersands love
& & & & &
Beautiful Web Typography
Italic ampersand variants are often much prettier
than their common roman counterparts:
Give ampersands love
& & & & &
Beautiful Web Typography
& & & & &
Italic ampersand variants are often much prettier
than their common roman counterparts:
Marking paragraphs
Beautiful Web Typography
Don’t be afraid to mark new paragraphs with
indents, outdents, a plain white-line, a pilcrow (¶)
or other ornament, versal and/or headers…
Marking paragraphs
Beautiful Web Typography
Don’t be afraid to mark new paragraphs with
indents, outdents, a plain white-line, a pilcrow (¶)
or other ornament, versal and/or headers…
Marking paragraphs
Beautiful Web Typography
…or a combination thereof.
Don’t be afraid to mark new paragraphs with
indents, outdents, a plain white-line, a pilcrow (¶)
or other ornament, versal and/or headers…
Marking paragraphs
Beautiful Web Typography
…or a combination thereof.
See: http://tinyurl.com/para-typography.
Beautiful Web Typography
MeasuresThe measure is the length of a single line. It is important to select a good measure for running text. Do this with the width property.
Beautiful Web Typography
MeasuresThe measure is the length of a single line. It is important to select a good measure for running text. Do this with the width property.
Ideally these should be relative to the font size, such that the type scales proportionately to the measure; use ems or percentages.
Beautiful Web Typography
Measures (cont’d)
Beautiful Web Typography
Measures (cont’d)
Web type generally benefits from smaller measures than those in print. A good ballpark is 10–15 words/75–100 characters per line for body copy, single column.
Beautiful Web Typography
Measures (cont’d)
Web type generally benefits from smaller measures than those in print. A good ballpark is 10–15 words/75–100 characters per line for body copy, single column.
Generally use flush-left (text-align: left;) for
running text, particularly when set in a narrow
measure. Justification can work at ample
measures and better with serif typefaces.
Beautiful Web Typography
Leading (line-height)
Beautiful Web Typography
Leading (line-height)Don’t forget to set an ample leading for running text! Done using the line-height property and
you can use a unit-less number (e.g. 1.5 which acts as a multiplier of the font size);
Beautiful Web Typography
Leading (line-height)Don’t forget to set an ample leading for running text! Done using the line-height property and
you can use a unit-less number (e.g. 1.5 which acts as a multiplier of the font size);
Leading spans from baseline to baseline… and I
need some more text to illustrate the point. :)
Beautiful Web Typography
Hanging punctuationTraditionally punctuation marks, bullets, lists, hyphens, and brackets all hang in the margin.
Beautiful Web Typography
Hanging punctuationTraditionally punctuation marks, bullets, lists, hyphens, and brackets all hang in the margin.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer a odio. Vivamus placerat felis id risus. Cras mollis est. Suspendisse molestie et imperdiet libero. Etiam mollis libero vulputate lorem nullam ut leo. Etiam at turpis non massa rhoncus sodales.)”
“
(
Beautiful Web Typography
Hanging punctuation (cont’d)
Simply with lists by setting their margins to zero.
Beautiful Web Typography
Hanging punctuation (cont’d)
Simply with lists by setting their margins to zero.
Possible for opening punctuation marks using background-image or a negative text-indent.
CSS3 will hopefully support hanging punctuation with a proposed hanging-punctuation property.
Beautiful Web Typography
Hanging punctuation (cont’d)
Simply with lists by setting their margins to zero.
Possible for opening punctuation marks using background-image or a negative text-indent.
CSS3 will hopefully support hanging punctuation with a proposed hanging-punctuation property.
See: http://tinyurl.com/w3c-hanging-punct.
Beautiful Web Typography
Web: text = UI
Distinguish content elements from application controls (e.g. a user’s username and description from a logout link or text-field title).
Beautiful Web Typography
Web: text = UI
Distinguish content elements from application controls (e.g. a user’s username and description from a logout link or text-field title).
Often done with colour (e.g. setting controls gray), size (making them smaller) and typefaces.
Beautiful Web Typography
Beautiful Web Typography
Beautiful Web Typography
Page (grid).
Beautiful Web Typography
Page (grid).
Beautiful Web Typography
Grids bring order to your page and help specify
where things should go.
Page (grid).
Beautiful Web Typography
Grids bring order to your page and help specify
where things should go.
Remember to put in apt “gutters” (margins
between columns) to separate your columns.
Page (grid).
Beautiful Web Typography
Grids bring order to your page and help specify
where things should go.
Remember to put in apt “gutters” (margins
between columns) to separate your columns.
Ruler guides help enormously: use the Web
Developer extension for Firefox or ruler
background images (also see the YUI library).
Beautiful Web Typography
Beautiful Web Typography
Beautiful Web Typography
Addendum
Beautiful Web Typography
Addendum
Beautiful Web Typography
Please don’t use Comic Sans unless you have a
very, very good reason.
: ---
Inspirational typophiles
Beautiful Web Typography
• Cameron Moll: cameronmoll.com
• Jeff Croft: jeffcroft.com
• Mark Boulton: markboulton.co.uk
• Jeffrey Zeldman: zeldman.com
• Richard Rutter clagnut.com
• Jon Tan: jontangerine.com
Beautiful Web Typography
• http://webtypography.net
• http://alistapart.com/topics/design/typography
• http://ilovetypography.com
• http://usabletype.org
• http://www.papress.com/other/thinkingwithtype/
Resources & reading
@klepas
klepas.org
Licensed CC BY-NC-ND
http://creativecommons.org/licenses/by-nc-nd/2.5/au/