Dominating the
Web Typography
Eduardo Shiota Yasuda — @shiota Conferência CSS Brasil
Hello!
twitter.com/shiota
github.com/eshiota
slideshare.net/eshiota
contato@eshiota.com
I Typography
Typography is everywhere.
We gotta remember the
roots of what we do.
15.000 BC – 12.500 BC
Altamira & Lascaux
3.000 BC – 1.500 BC
Pictographs
1.500 BC
Phoenician alphabet
750 BC
Greek alphabet
146 BC
Roman alphabet, “Capitalis quadrata”
0
Better materials, “Capitalis rustica”
4th – 5th centuries
Uncials and semi-uncials
8th century
Carolingian minuscules
12th century
Apex of goth art and Middle Ages
15th – 16th centuries
Renaissance, Gutenberg press, “Cursiva humanista”, type foundries
19th century
Industrial Revolution, linotype, Art Nouveau, display types
20th century
Modern Design, Avant-garde, Bauhaus, sans-serif types, digital typography
21th century
Web typography and CSS
The basics
Basics
Classification
Most of the classification
systems agree with these
type categories:
Serif types
Museo
The quick brown fox jumps
over the lazy dog.
Meta Serif
The quick brown fox jumps
over the lazy dog.
Times New Roman
The quick brown fox jumps
over the lazy dog.
Sans serif types
Futura
The quick brown fox jumps
over the lazy dog.
Museo Sans
The quick brown fox jumps
over the lazy dog.
Helvetica
The quick brown fox jumps
over the lazy dog.
Gothic types
Fette Fraktur
The quick brown fox jumps
over the lazy dog.
Goudy Text
The quick brown fox jumps
over the lazy dog.
Wilhelm Klingspor Gotisch
The quick brown fox jumps
over the lazy dog.
Cursive types
Lucida Calligraphy
The quick brown fox jumps
over the lazy dog.
Mistral
The quick brown fox jumps over
the lazy dog.
Apple Chancery
The quick brown fox jumps
over the lazy dog.
Display types
Comic Sans
The quick brown fox jumps
over the lazy dog.
Sketch Rockwell
The quick brown fox
jumps over the lazy dog.
GodOfWar
The quick brown fox jumps
over the lazy dog.
Dingbats
Bodoni Ornaments
The quick brown fox jumps
over the lazy dog.
Travel Icons
The quick brown fox jumps
over the lazy dog.
Wingdings
The quick brown fox jumps
over the lazy dog.
On the CSS, you may
choose generic families
as fallbacks.
.my-serif-text {
font-family: "Meta Serif", Times, serif;
}
.my-sans-serif-text {
font-family: "Proxima Nova", Arial, sans-serif;
}
.my-monospace-text {
font-family: Monaco, "Courier New", monospace;
}
.my-cursive-text {
font-family: "Zapf Chancery", "Brush Script", cursive;
}
.my-fantasy-text {
font-family: "Sketch Rockwell", Papyrus, fantasy;
}
Basics
Anatomy of a type
baseline
font size
Typography
baseline
descender height
x-height
cap height
ascender height
Typography
T
y
p
o
g
r
a
p
h
y
Basics
Units
Physical units
To deal with physical units,
you can’t rely on a screen.
pt picas millimetres inches
12 1 4.22 1/6
A4 (29.7cm × 21.0cm)
Pixel (px)
To deal with screens, you must
understand what are physical
and reference pixels.
A physical pixel is a physical
point on the display.
A reference pixel depends
on the device, software and
user settings.
A 16px font on a
smartphone screen won’t
have as many millimetres as
on a desktop screen.
Change, test, use media
queries, test again.
em unit (em)
“em” is a relative unit used
since the movable types.
It represents a type’s
full body size.
1 em
16px
1 em
margin-right: 1em;
16px
It’s always relative to its
context’s font size.
.wrapper {
font-size: 16px;
}
.parent {
font-size: 1.5em;
}
.child {
font-size: .5em;
}
Root em unit (rem)
“rem” is like “em” but always
relative to the root (html).
html {
font-size: 16px;
}
.wrapper {
font-size: 12px;
}
.parent {
font-size: 1.5rem;
}
.child {
font-size: 0.5rem;
}
For most of browsers and
cases, the default root
font size is 16px.
html {
font-size: 16px;
}
.wrapper {
font-size: 12px;
}
.parent {
font-size: 1.5rem;
}
.child {
font-size: 0.5rem;
}
html {
font-size: 100%;
}
.wrapper {
font-size: 12px;
}
.parent {
font-size: 1.5rem;
}
.child {
font-size: 0.5rem;
}
Rhythm
The way you space your
characters and text dictates
how a person will read it.
Rhythm
Line height
Line height is the distance
between each line of types.
The quick fox jumps
over the dog 0 pixels
Meta Serif 102px/102px
The quick fox jumps
over the dog
Meta Serif 102px/144px
42 pixels
A low line height makes the
text too difficult to read.
Helvetica 32px/32px
“The Guide says that the best drink in existence is the Pan
Galactic Gargle Blaster. It says that the effect of a Pan Galactic
Gargle Blaster is like having your brains smashed out by a slice
of lemon wrapped round a large gold brick.”
A large line height makes the
paragraph loose cohesion.
Helvetica 32px/96px
“The Guide says that the best drink in existence is the Pan
Galactic Gargle Blaster. It says that the effect of a Pan Galactic
Gargle Blaster is like having your brains smashed out by a slice
of lemon wrapped round a large gold brick.”
Find a comfortable proportion
through trial-and-error.
Helvetica 32px/48px
“The Guide says that the best drink in existence is the Pan
Galactic Gargle Blaster. It says that the effect of a Pan Galactic
Gargle Blaster is like having your brains smashed out by a slice
of lemon wrapped round a large gold brick.”
Each typeface might require a
different line height setting.
Bembo 32px/48px
“The Guide says that the best drink in existence is the Pan Galactic
Gargle Blaster. It says that the effect of a Pan Galactic Gargle Blaster is
like having your brains smashed out by a slice of lemon wrapped
round a large gold brick.”
Caslon 32px/48px
“The Guide says that the best drink in existence is the Pan
Galactic Gargle Blaster. It says that the effect of a Pan
Galactic Gargle Blaster is like having your brains smashed
out by a slice of lemon wrapped round a large gold brick.”
Rhythm
Baseline
Use a consistent vertical
proportion by following
a baseline.
9 reasons why cats will conquer the world. The number 5
will surprise you!
“More importantly, a towel has immense psychological value.
For some reason, if a strag (strag: nonhitchhiker) discovers that a hitchhiker has his towel with him, he will
automatically assume that he is also in possession of a toothbrush, washcloth, soap, tin of biscuits, flask, compass,
map, ball of string, gnat spray, wet-weather gear, space suit etc., etc.
Furthermore, the strag will then happily lend the hitchhiker any of these or a dozen other items that the hitchhiker
might have accidentally "lost.". What the strag will think is that any man that can hitch the length and breadth of the
Galaxy, rough it, slum it, struggle against terrible odds, win through and still know where his towel is, is clearly a
man to be reckoned with.”
9 reasons why cats will conquer the world. The number 5
will surprise you!
“More importantly, a towel has immense psychological value.
For some reason, if a strag (strag: nonhitchhiker) discovers that a hitchhiker has his towel with him, he will
automatically assume that he is also in possession of a toothbrush, washcloth, soap, tin of biscuits, flask, compass,
map, ball of string, gnat spray, wet-weather gear, space suit etc., etc.
Furthermore, the strag will then happily lend the hitchhiker any of these or a dozen other items that the hitchhiker
might have accidentally "lost.". What the strag will think is that any man that can hitch the length and breadth of the
Galaxy, rough it, slum it, struggle against terrible odds, win through and still know where his towel is, is clearly a
man to be reckoned with.”
Choose a line height for a
baseline, and make all
vertical values derive from it.
/* baseline = 24px */
body {
font-size: 16px;
line-height: 24px; /* baseline */
}
.article-title {
font-size: 32px;
line-height: 48px; /* 2 × baseline */
}
.article-excerpt {
font-size: 18px;
line-height: 24px; /* baseline */
}
img {
max-height: 312px; /* 13 × baseline */
}
p {
margin-bottom: 12px; /* 0.5 × baseline */
}
If you pre-process your CSS,
you ensure a consistent
typography using variables.
// _variables.scss
$base-font-size: 16px;
$baseline: 24px;
// On your project:
body {
font-size: $base-font-size;
line-height: ($baseline/$base-font-size); // 1.5
}
.article-title {
font-size: 2*$base-font-size;
line-height: 2*$baseline;
}
.article-excerpt {
font-size: 18px;
line-height: $baseline;
}
img {
max-height: 13*$baseline;
}
p {
margin-bottom: 0.5*$baseline;
}
Be aware that each browser
has its own baseline.
Rhythm
Letter spacing/tracking
Letter spacing is the
whitespace between
each single type.
Typography
Typography
letter-spacing: 10px;
Typography
letter-spacing: -10px;
The use of letter-spacing is
recommended for titles only.
Epic Movie Title
Epic Movie Title
Rhythm
Kerning
Kerning is a fine-tuning
between specific pairs
of characters.
Task
The browser default is
automatically
enabling/disabling it.
.kerning {
font-kerning: normal;
}
32+ 34+ 7+ 10+
Rhythm
Text indentation
You can manipulate the
text’s indentation, which
applies to its first line.
More importantly, a towel has immense psychological value.
For some reason, if a strag (strag: nonhitchhiker) discovers that a hitchhiker has his
towel with him, he will automatically assume that he is also in possession of a
toothbrush, washcloth, soap, tin of biscuits, flask, compass, map, ball of string, gnat
spray, wet-weather gear, space suit etc., etc.
Furthermore, the strag will then happily lend the hitchhiker any of these or a dozen
other items that the hitchhiker might have accidentally "lost.". What the strag will think
is that any man that can hitch the length and breadth of the Galaxy, rough it, slum it,
struggle against terrible odds, win through and still know where his towel is, is clearly a
man to be reckoned with.
More importantly, a towel has immense psychological value.
For some reason, if a strag (strag: nonhitchhiker) discovers that a hitchhiker has
his towel with him, he will automatically assume that he is also in possession of a
toothbrush, washcloth, soap, tin of biscuits, flask, compass, map, ball of string, gnat
spray, wet-weather gear, space suit etc., etc.
Furthermore, the strag will then happily lend the hitchhiker any of these or a dozen
other items that the hitchhiker might have accidentally "lost.". What the strag will think
is that any man that can hitch the length and breadth of the Galaxy, rough it, slum it,
struggle against terrible odds, win through and still know where his towel is, is clearly a
man to be reckoned with.
.post p {
text-indent: 2em;
}
For long texts, you can
skip the indentation on
the first paragraph.
More importantly, a towel has immense psychological value.
For some reason, if a strag (strag: nonhitchhiker) discovers that a hitchhiker has
his towel with him, he will automatically assume that he is also in possession of a
toothbrush, washcloth, soap, tin of biscuits, flask, compass, map, ball of string, gnat
spray, wet-weather gear, space suit etc., etc.
Furthermore, the strag will then happily lend the hitchhiker any of these or a dozen
other items that the hitchhiker might have accidentally "lost.". What the strag will think
is that any man that can hitch the length and breadth of the Galaxy, rough it, slum it,
struggle against terrible odds, win through and still know where his towel is, is clearly a
man to be reckoned with.
.post p {
text-indent: 2em;
}
.post p:first-of-type {
text-indent: 0;
}
More importantly, a towel has immense psychological value.
For some reason, if a strag (strag: nonhitchhiker) discovers that a hitchhiker has
his towel with him, he will automatically assume that he is also in possession of a
toothbrush, washcloth, soap, tin of biscuits, flask, compass, map, ball of string, gnat
spray, wet-weather gear, space suit etc., etc.
Furthermore, the strag will then happily lend the hitchhiker any of these or a dozen
other items that the hitchhiker might have accidentally "lost.". What the strag will think
is that any man that can hitch the length and breadth of the Galaxy, rough it, slum it,
struggle against terrible odds, win through and still know where his towel is, is clearly a
man to be reckoned with.
.post p + p {
text-indent: 2em;
}
Text styling
You can use CSS rules to
properly style your content,
like a well-authored book.
Styling
Titles & subtitles
Keep a clear hierarchy by
using different font sizes,
type faces and variants.
Styling
Quotes
A quote block can be
highlighted with margins
and pseudo-elements.
blockquote {
margin: 2em 6em;
font-size: 24px;
line-height: 1.5;
font-style: italic;
position: relative;
}
blockquote:before {
content: "“";
position: absolute;
left: -.75em;
top: 0;
font-size: 2.66em;
line-height: 1;
}
blockquote .author {
font-size: .75em;
line-height: 1.77;
}
Styling
Elevated caps
Explore CSS selectors to style
specific parts of the text.
.post p:first-of-type:first-letter {
font-size: 4.5em;
}
Styling
OpenType
OpenType fonts provide
features to control and tweak
the styles of your text.
.my-class {
font-variant-caps: small-caps;
-moz-font-feature-settings: "smcp";
-ms-font-feature-settings: "smcp";
-webkit-font-feature-settings: "smcp";
font-feature-settings: "smcp";
}
33+ 4+ 10+
Composition
Composition
Grids and column sizes
The text should have
an ideal line length.
A line should have between
60 and 70 characters.
.post {
width: 744px;
margin: 0 auto;
}
The column size should
respond to font size changes.
The use of em-based column
width might solve the problem.
.post {
width: 31em;
margin: 0 auto;
}
Rendering
Rendering
Anti-aliasing and hinting
Font shapes are vectors
that are rasterised to be
displayed on pixels.
Hinting is a manual work
of tweaking sub-pixels to
maintain a font’s identity
and legibility on screen.
Anti-aliasing is an algorithm
used to smooth edges.
Each OS and browsers have a
different anti-aliasing and
hinting setting.
OS + Browser Hinting and AA
Win XP — IE6–8 GDI Grayscale
Win XP — IE6–8 ClearType GCI ClearType
IE9+ DirectWrite
Win XP Chrome GDI ClearType
Win XP Firefox GDI ClearType
Win 7+ Chrome 37+ DirectWrite
Win 7+ Firefox Depends?
OS X CoreText, ignores hinting
* Based on a lot of Google searches, might not be accurate
Test. On. Every. Browser.
Choosing
Choosing
Sources
Choose a reliable source
for your font.
The font must have a
proper unicode table,
kerning, hinting etc.
Also check for language
support, webfont license,
OpenType features.
Fonts are expensive
for a reason.
Choosing
Personalities
Each typeface has a story
and a personality, choose
one that match yours.
The quick brown fox
jumps over the lazy dog.
Bembo — based in engravings from 1495, renaissance style,
readable in small font sizes.
The quick brown fox
jumps over the lazy dog.
Helvetica — Symbol of the Modern Design, is readable,
international and neutral.
The quick brown fox
jumps over the lazy dog.
Museo — The modern, geometric shapes and the rounded, slab
serifs give a strong personality to this type.
Serifs have a refined look,
need less line height values,
and help maintaining a
cohesive text.
Sans serifs have a modern
look, and increased
legibility on screens.
Start simple, with a
readable body typeface.
Then format titles and
subtitles using different
weights and styles.
Choose a second typeface
for titles if needed. Avoid
going further than that.
Choosing
Performance
Each font size is extra data
that must be downloaded.
Measure the impact of
each added typeface.
You’ll have to choose between
speed and non-FOUC.
Avoid loading custom typefaces
on mobile devices.
I Typography
We’ve only scratched
the surface.
We are the craftspeople
of the web.
We should keep our
roots in place.
Further reading:
The Elements of Typographic Style
Robert Bringhurst
EN: http://www.amazon.com/Elements-Typographic-Style-Robert-Bringhurst/dp/0881791326
PT-BR: http://editora.cosacnaify.com.br/ObraSinopse/11584/Elementos-do-estilo-tipogr%C3%A1fico---vers%C3%A3o-30.aspx
Thinking with Type
Ellen Lupton
EN: http://www.amazon.com/Thinking-Type-2nd-revised-expanded/dp/1568989695
PT-BR: http://editora.cosacnaify.com.br/ObraSinopse/1875/Pensar-com-tipos---2%C2%BA-edi%C3%A7%C3%A3o-%28Previs%C3%A3o-de-envio-a-
partir-de-200415%29.aspx
Type on Screen
Ellen Lupton
EN: http://www.amazon.com/Type-Screen-Critical-Designers-Developers/dp/161689170X
On Web Typography
Jason Santa Maria
EN: http://abookapart.com/products/on-web-typography
Type and Typography
Baines & Haslam
EN: http://www.amazon.co.uk/Type-Typography-Portfolio-Phil-Baines/dp/1856694372
Thanks!
twitter.com/shiota
github.com/eshiota
slideshare.net/eshiota
contato@eshiota.com

Dominating the Web Typography

  • 1.
    Dominating the Web Typography EduardoShiota Yasuda — @shiota Conferência CSS Brasil
  • 2.
  • 4.
  • 5.
  • 13.
    We gotta rememberthe roots of what we do.
  • 14.
    15.000 BC –12.500 BC Altamira & Lascaux
  • 15.
    3.000 BC –1.500 BC Pictographs
  • 16.
  • 17.
  • 18.
    146 BC Roman alphabet,“Capitalis quadrata”
  • 19.
  • 20.
  • 21.
  • 22.
    12th century Apex ofgoth art and Middle Ages
  • 23.
    15th – 16th centuries Renaissance,Gutenberg press, “Cursiva humanista”, type foundries
  • 24.
    19th century Industrial Revolution,linotype, Art Nouveau, display types
  • 25.
    20th century Modern Design,Avant-garde, Bauhaus, sans-serif types, digital typography
  • 26.
  • 27.
  • 28.
  • 29.
    Most of theclassification systems agree with these type categories:
  • 30.
  • 31.
    Museo The quick brownfox jumps over the lazy dog. Meta Serif The quick brown fox jumps over the lazy dog. Times New Roman The quick brown fox jumps over the lazy dog.
  • 32.
  • 33.
    Futura The quick brownfox jumps over the lazy dog. Museo Sans The quick brown fox jumps over the lazy dog. Helvetica The quick brown fox jumps over the lazy dog.
  • 34.
  • 35.
    Fette Fraktur The quickbrown fox jumps over the lazy dog. Goudy Text The quick brown fox jumps over the lazy dog. Wilhelm Klingspor Gotisch The quick brown fox jumps over the lazy dog.
  • 36.
  • 37.
    Lucida Calligraphy The quickbrown fox jumps over the lazy dog. Mistral The quick brown fox jumps over the lazy dog. Apple Chancery The quick brown fox jumps over the lazy dog.
  • 38.
  • 39.
    Comic Sans The quickbrown fox jumps over the lazy dog. Sketch Rockwell The quick brown fox jumps over the lazy dog. GodOfWar The quick brown fox jumps over the lazy dog.
  • 40.
  • 41.
    Bodoni Ornaments The quickbrown fox jumps over the lazy dog. Travel Icons The quick brown fox jumps over the lazy dog. Wingdings The quick brown fox jumps over the lazy dog.
  • 42.
    On the CSS,you may choose generic families as fallbacks.
  • 43.
    .my-serif-text { font-family: "MetaSerif", Times, serif; } .my-sans-serif-text { font-family: "Proxima Nova", Arial, sans-serif; } .my-monospace-text { font-family: Monaco, "Courier New", monospace; } .my-cursive-text { font-family: "Zapf Chancery", "Brush Script", cursive; } .my-fantasy-text { font-family: "Sketch Rockwell", Papyrus, fantasy; }
  • 44.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
    To deal withphysical units, you can’t rely on a screen.
  • 53.
    pt picas millimetresinches 12 1 4.22 1/6
  • 54.
  • 55.
  • 56.
    To deal withscreens, you must understand what are physical and reference pixels.
  • 57.
    A physical pixelis a physical point on the display.
  • 59.
    A reference pixeldepends on the device, software and user settings.
  • 61.
    A 16px fonton a smartphone screen won’t have as many millimetres as on a desktop screen.
  • 63.
    Change, test, usemedia queries, test again.
  • 64.
  • 65.
    “em” is arelative unit used since the movable types.
  • 66.
    It represents atype’s full body size.
  • 67.
  • 68.
  • 69.
    It’s always relativeto its context’s font size.
  • 70.
    .wrapper { font-size: 16px; } .parent{ font-size: 1.5em; } .child { font-size: .5em; }
  • 71.
  • 72.
    “rem” is like“em” but always relative to the root (html).
  • 73.
    html { font-size: 16px; } .wrapper{ font-size: 12px; } .parent { font-size: 1.5rem; } .child { font-size: 0.5rem; }
  • 74.
    For most ofbrowsers and cases, the default root font size is 16px.
  • 75.
    html { font-size: 16px; } .wrapper{ font-size: 12px; } .parent { font-size: 1.5rem; } .child { font-size: 0.5rem; }
  • 76.
    html { font-size: 100%; } .wrapper{ font-size: 12px; } .parent { font-size: 1.5rem; } .child { font-size: 0.5rem; }
  • 77.
  • 78.
    The way youspace your characters and text dictates how a person will read it.
  • 79.
  • 80.
    Line height isthe distance between each line of types.
  • 81.
    The quick foxjumps over the dog 0 pixels Meta Serif 102px/102px
  • 82.
    The quick foxjumps over the dog Meta Serif 102px/144px 42 pixels
  • 83.
    A low lineheight makes the text too difficult to read.
  • 84.
    Helvetica 32px/32px “The Guidesays that the best drink in existence is the Pan Galactic Gargle Blaster. It says that the effect of a Pan Galactic Gargle Blaster is like having your brains smashed out by a slice of lemon wrapped round a large gold brick.”
  • 85.
    A large lineheight makes the paragraph loose cohesion.
  • 86.
    Helvetica 32px/96px “The Guidesays that the best drink in existence is the Pan Galactic Gargle Blaster. It says that the effect of a Pan Galactic Gargle Blaster is like having your brains smashed out by a slice of lemon wrapped round a large gold brick.”
  • 87.
    Find a comfortableproportion through trial-and-error.
  • 88.
    Helvetica 32px/48px “The Guidesays that the best drink in existence is the Pan Galactic Gargle Blaster. It says that the effect of a Pan Galactic Gargle Blaster is like having your brains smashed out by a slice of lemon wrapped round a large gold brick.”
  • 89.
    Each typeface mightrequire a different line height setting.
  • 90.
    Bembo 32px/48px “The Guidesays that the best drink in existence is the Pan Galactic Gargle Blaster. It says that the effect of a Pan Galactic Gargle Blaster is like having your brains smashed out by a slice of lemon wrapped round a large gold brick.”
  • 91.
    Caslon 32px/48px “The Guidesays that the best drink in existence is the Pan Galactic Gargle Blaster. It says that the effect of a Pan Galactic Gargle Blaster is like having your brains smashed out by a slice of lemon wrapped round a large gold brick.”
  • 92.
  • 93.
    Use a consistentvertical proportion by following a baseline.
  • 94.
    9 reasons whycats will conquer the world. The number 5 will surprise you! “More importantly, a towel has immense psychological value. For some reason, if a strag (strag: nonhitchhiker) discovers that a hitchhiker has his towel with him, he will automatically assume that he is also in possession of a toothbrush, washcloth, soap, tin of biscuits, flask, compass, map, ball of string, gnat spray, wet-weather gear, space suit etc., etc. Furthermore, the strag will then happily lend the hitchhiker any of these or a dozen other items that the hitchhiker might have accidentally "lost.". What the strag will think is that any man that can hitch the length and breadth of the Galaxy, rough it, slum it, struggle against terrible odds, win through and still know where his towel is, is clearly a man to be reckoned with.”
  • 95.
    9 reasons whycats will conquer the world. The number 5 will surprise you! “More importantly, a towel has immense psychological value. For some reason, if a strag (strag: nonhitchhiker) discovers that a hitchhiker has his towel with him, he will automatically assume that he is also in possession of a toothbrush, washcloth, soap, tin of biscuits, flask, compass, map, ball of string, gnat spray, wet-weather gear, space suit etc., etc. Furthermore, the strag will then happily lend the hitchhiker any of these or a dozen other items that the hitchhiker might have accidentally "lost.". What the strag will think is that any man that can hitch the length and breadth of the Galaxy, rough it, slum it, struggle against terrible odds, win through and still know where his towel is, is clearly a man to be reckoned with.”
  • 96.
    Choose a lineheight for a baseline, and make all vertical values derive from it.
  • 97.
    /* baseline =24px */ body { font-size: 16px; line-height: 24px; /* baseline */ } .article-title { font-size: 32px; line-height: 48px; /* 2 × baseline */ } .article-excerpt { font-size: 18px; line-height: 24px; /* baseline */ } img { max-height: 312px; /* 13 × baseline */ } p { margin-bottom: 12px; /* 0.5 × baseline */ }
  • 98.
    If you pre-processyour CSS, you ensure a consistent typography using variables.
  • 99.
    // _variables.scss $base-font-size: 16px; $baseline:24px; // On your project: body { font-size: $base-font-size; line-height: ($baseline/$base-font-size); // 1.5 } .article-title { font-size: 2*$base-font-size; line-height: 2*$baseline; } .article-excerpt { font-size: 18px; line-height: $baseline; } img { max-height: 13*$baseline; } p { margin-bottom: 0.5*$baseline; }
  • 100.
    Be aware thateach browser has its own baseline.
  • 101.
  • 102.
    Letter spacing isthe whitespace between each single type.
  • 103.
  • 104.
  • 105.
  • 106.
    The use ofletter-spacing is recommended for titles only.
  • 107.
  • 108.
  • 109.
  • 110.
    Kerning is afine-tuning between specific pairs of characters.
  • 112.
  • 113.
    The browser defaultis automatically enabling/disabling it.
  • 115.
  • 116.
  • 117.
    You can manipulatethe text’s indentation, which applies to its first line.
  • 118.
    More importantly, atowel has immense psychological value. For some reason, if a strag (strag: nonhitchhiker) discovers that a hitchhiker has his towel with him, he will automatically assume that he is also in possession of a toothbrush, washcloth, soap, tin of biscuits, flask, compass, map, ball of string, gnat spray, wet-weather gear, space suit etc., etc. Furthermore, the strag will then happily lend the hitchhiker any of these or a dozen other items that the hitchhiker might have accidentally "lost.". What the strag will think is that any man that can hitch the length and breadth of the Galaxy, rough it, slum it, struggle against terrible odds, win through and still know where his towel is, is clearly a man to be reckoned with.
  • 119.
    More importantly, atowel has immense psychological value. For some reason, if a strag (strag: nonhitchhiker) discovers that a hitchhiker has his towel with him, he will automatically assume that he is also in possession of a toothbrush, washcloth, soap, tin of biscuits, flask, compass, map, ball of string, gnat spray, wet-weather gear, space suit etc., etc. Furthermore, the strag will then happily lend the hitchhiker any of these or a dozen other items that the hitchhiker might have accidentally "lost.". What the strag will think is that any man that can hitch the length and breadth of the Galaxy, rough it, slum it, struggle against terrible odds, win through and still know where his towel is, is clearly a man to be reckoned with. .post p { text-indent: 2em; }
  • 120.
    For long texts,you can skip the indentation on the first paragraph.
  • 121.
    More importantly, atowel has immense psychological value. For some reason, if a strag (strag: nonhitchhiker) discovers that a hitchhiker has his towel with him, he will automatically assume that he is also in possession of a toothbrush, washcloth, soap, tin of biscuits, flask, compass, map, ball of string, gnat spray, wet-weather gear, space suit etc., etc. Furthermore, the strag will then happily lend the hitchhiker any of these or a dozen other items that the hitchhiker might have accidentally "lost.". What the strag will think is that any man that can hitch the length and breadth of the Galaxy, rough it, slum it, struggle against terrible odds, win through and still know where his towel is, is clearly a man to be reckoned with. .post p { text-indent: 2em; } .post p:first-of-type { text-indent: 0; }
  • 122.
    More importantly, atowel has immense psychological value. For some reason, if a strag (strag: nonhitchhiker) discovers that a hitchhiker has his towel with him, he will automatically assume that he is also in possession of a toothbrush, washcloth, soap, tin of biscuits, flask, compass, map, ball of string, gnat spray, wet-weather gear, space suit etc., etc. Furthermore, the strag will then happily lend the hitchhiker any of these or a dozen other items that the hitchhiker might have accidentally "lost.". What the strag will think is that any man that can hitch the length and breadth of the Galaxy, rough it, slum it, struggle against terrible odds, win through and still know where his towel is, is clearly a man to be reckoned with. .post p + p { text-indent: 2em; }
  • 123.
  • 124.
    You can useCSS rules to properly style your content, like a well-authored book.
  • 125.
  • 126.
    Keep a clearhierarchy by using different font sizes, type faces and variants.
  • 128.
  • 129.
    A quote blockcan be highlighted with margins and pseudo-elements.
  • 131.
    blockquote { margin: 2em6em; font-size: 24px; line-height: 1.5; font-style: italic; position: relative; } blockquote:before { content: "“"; position: absolute; left: -.75em; top: 0; font-size: 2.66em; line-height: 1; } blockquote .author { font-size: .75em; line-height: 1.77; }
  • 132.
  • 133.
    Explore CSS selectorsto style specific parts of the text.
  • 134.
  • 135.
  • 136.
    OpenType fonts provide featuresto control and tweak the styles of your text.
  • 138.
    .my-class { font-variant-caps: small-caps; -moz-font-feature-settings:"smcp"; -ms-font-feature-settings: "smcp"; -webkit-font-feature-settings: "smcp"; font-feature-settings: "smcp"; } 33+ 4+ 10+
  • 141.
  • 142.
  • 143.
    The text shouldhave an ideal line length.
  • 145.
    A line shouldhave between 60 and 70 characters.
  • 147.
  • 149.
    The column sizeshould respond to font size changes.
  • 151.
    The use ofem-based column width might solve the problem.
  • 154.
  • 155.
  • 156.
  • 157.
    Font shapes arevectors that are rasterised to be displayed on pixels.
  • 158.
    Hinting is amanual work of tweaking sub-pixels to maintain a font’s identity and legibility on screen.
  • 161.
    Anti-aliasing is analgorithm used to smooth edges.
  • 162.
    Each OS andbrowsers have a different anti-aliasing and hinting setting.
  • 163.
    OS + BrowserHinting and AA Win XP — IE6–8 GDI Grayscale Win XP — IE6–8 ClearType GCI ClearType IE9+ DirectWrite Win XP Chrome GDI ClearType Win XP Firefox GDI ClearType Win 7+ Chrome 37+ DirectWrite Win 7+ Firefox Depends? OS X CoreText, ignores hinting * Based on a lot of Google searches, might not be accurate
  • 164.
  • 166.
  • 167.
  • 168.
    Choose a reliablesource for your font.
  • 170.
    The font musthave a proper unicode table, kerning, hinting etc.
  • 171.
    Also check forlanguage support, webfont license, OpenType features.
  • 177.
  • 178.
  • 179.
    Each typeface hasa story and a personality, choose one that match yours.
  • 180.
    The quick brownfox jumps over the lazy dog. Bembo — based in engravings from 1495, renaissance style, readable in small font sizes.
  • 181.
    The quick brownfox jumps over the lazy dog. Helvetica — Symbol of the Modern Design, is readable, international and neutral.
  • 182.
    The quick brownfox jumps over the lazy dog. Museo — The modern, geometric shapes and the rounded, slab serifs give a strong personality to this type.
  • 183.
    Serifs have arefined look, need less line height values, and help maintaining a cohesive text.
  • 185.
    Sans serifs havea modern look, and increased legibility on screens.
  • 187.
    Start simple, witha readable body typeface.
  • 188.
    Then format titlesand subtitles using different weights and styles.
  • 189.
    Choose a secondtypeface for titles if needed. Avoid going further than that.
  • 191.
  • 192.
    Each font sizeis extra data that must be downloaded.
  • 194.
    Measure the impactof each added typeface.
  • 196.
    You’ll have tochoose between speed and non-FOUC.
  • 197.
    Avoid loading customtypefaces on mobile devices.
  • 198.
  • 199.
  • 200.
    We are thecraftspeople of the web.
  • 202.
    We should keepour roots in place.
  • 205.
    Further reading: The Elementsof Typographic Style Robert Bringhurst EN: http://www.amazon.com/Elements-Typographic-Style-Robert-Bringhurst/dp/0881791326 PT-BR: http://editora.cosacnaify.com.br/ObraSinopse/11584/Elementos-do-estilo-tipogr%C3%A1fico---vers%C3%A3o-30.aspx Thinking with Type Ellen Lupton EN: http://www.amazon.com/Thinking-Type-2nd-revised-expanded/dp/1568989695 PT-BR: http://editora.cosacnaify.com.br/ObraSinopse/1875/Pensar-com-tipos---2%C2%BA-edi%C3%A7%C3%A3o-%28Previs%C3%A3o-de-envio-a- partir-de-200415%29.aspx Type on Screen Ellen Lupton EN: http://www.amazon.com/Type-Screen-Critical-Designers-Developers/dp/161689170X On Web Typography Jason Santa Maria EN: http://abookapart.com/products/on-web-typography Type and Typography Baines & Haslam EN: http://www.amazon.co.uk/Type-Typography-Portfolio-Phil-Baines/dp/1856694372
  • 206.