Achieving Beautiful Typography in eBooks

88
Hello. Amanda Gomm @agomm [email protected] www.digitalbindery.com

description

Presentation from O'Reilly's 2013 Tools of Change conference. We know how to typeset print books, and by now, we know how to crank out EPUBs. It’s time to create some typographical standards for the eBooks we publish. Be prepared to be blown away at some of the best examples of typographically-beautiful eBooks currently in the marketplace, and then “peek under the covers” to see what kind of HTML and CSS mark-up were used to create it. She’ll present a checklist of common challenges and how those are met by the top eBook designers in our field. You’ll be able to bring back techniques you can use today to vault your eBooks to the top ranks of beautiful typography. Thanks to Anne Marie Concepcion of Seneca Design & Training, Colleen Cunningham of F&W Publications, Dan O. Williams of Storey Publishing, Rick Gordon of Shelter Publications,and Tom McCluskey of Digital Bindery for their insights and examples.

Transcript of Achieving Beautiful Typography in eBooks

Page 1: Achieving Beautiful Typography in eBooks

Hello.

Amanda Gomm@agomm

[email protected]

Page 2: Achieving Beautiful Typography in eBooks

Anne-Marie ConcepciónPresident, Seneca Design & Training @amariesenecadesign.com

Thank you!

Page 3: Achieving Beautiful Typography in eBooks

Thank you!

Colleen CunninghamF&W [email protected]

Page 4: Achieving Beautiful Typography in eBooks

Thank you!

Dan O. WilliamsDigital Projects Manager, Storey [email protected]

Page 5: Achieving Beautiful Typography in eBooks

Thank you!

Dan O. WilliamsDigital Projects Manager, Storey [email protected]

Page 6: Achieving Beautiful Typography in eBooks

Thank you!

Rick GordonShelter [email protected]

Page 7: Achieving Beautiful Typography in eBooks

Thank you!

Tom McCluskeyDigital Bindery @TomMcCluskeywww.digitalbindery.com

Page 8: Achieving Beautiful Typography in eBooks

Beautiful Typography

Show and Tell

Page 9: Achieving Beautiful Typography in eBooks

Walden by Henry David ThoreauDesigned by Dan O. Williams

Page 10: Achieving Beautiful Typography in eBooks

Walden by Henry David ThoreauDesigned by Dan O. Williams

Page 11: Achieving Beautiful Typography in eBooks

Walden by Henry David ThoreauDesigned by Dan O. Williams

Page 12: Achieving Beautiful Typography in eBooks

Walden by Henry David ThoreauDesigned by Dan O. Williams

Page 13: Achieving Beautiful Typography in eBooks

Homegrown Honey Bees Alethea MorrisonDesigned by Dan O. Williams

Page 14: Achieving Beautiful Typography in eBooks

Homegrown Honey Bees Alethea MorrisonDesigned by Dan O. Williams

Page 15: Achieving Beautiful Typography in eBooks

Homegrown Honey Bees Alethea MorrisonDesigned by Dan O. Williams

Page 16: Achieving Beautiful Typography in eBooks

Homegrown Honey Bees Alethea MorrisonDesigned by Dan O. Williams

Page 17: Achieving Beautiful Typography in eBooks

Stretching by Bob AndersonDesigned by Rick Gordon

Page 18: Achieving Beautiful Typography in eBooks

Stretching by Bob AndersonDesigned by Rick Gordon

Page 19: Achieving Beautiful Typography in eBooks

Stretching by Bob AndersonDesigned by Rick Gordon

Page 20: Achieving Beautiful Typography in eBooks

Stretching by Bob AndersonDesigned by Rick Gordon

Page 21: Achieving Beautiful Typography in eBooks

Controlling Typeface

Page 22: Achieving Beautiful Typography in eBooks

Controlling Typeface

• The digital typography tool chest• The Why, How, & Which of

embedding fonts.• “But will I go to jail?”

Page 23: Achieving Beautiful Typography in eBooks

Typography Plans

account for • user intervention• reading system fail• backwards compatibility

Page 24: Achieving Beautiful Typography in eBooks

Typography Tool Chest

• Semantic Markup• Responsive Measurements• Graceful Degradation• Progressive Enhancement• Font Stacks

Page 25: Achieving Beautiful Typography in eBooks

Font Manipulation

• Font Basics– Font-family– Font-size– Font-style– Font-variant– Font-weight– Text-transform

• Advanced Font Manipulation– Font-size-adjust– Font-stretch– Word-spacing– Hanging-punctuation– Punctuation-trim

Page 26: Achieving Beautiful Typography in eBooks

Embedding Fonts: Why?

• Because the option is the “Whatever Approach” to font selection.

• Because we can.• Because life in Caecilia all the time is

not a life worth living.• If you really don’t know why, I am

going to go to your house and remove all your fonts except Papyrus. Then the rest of us will go have a whiskey.

Page 27: Achieving Beautiful Typography in eBooks

Embedding Fonts: Which?

• What’s your budget for fonts?• That’s what I thought.• Try something free to distribute.

“Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software…” —Font License for Adobe’s Source Sans Pro

Resources: Font Squirrel, Google Web Fonts

Page 28: Achieving Beautiful Typography in eBooks

Will I go to jail?*

• Yes. Obviously. • For more about the legal issues of

embedding fonts in ebooks, go see Charles Nix tomorrow.

*Amanda Gomm is in no way qualified to give legal advice.

Page 29: Achieving Beautiful Typography in eBooks

Embedding Fonts: How?

• Put the font (and any necessary licenses) into the OEBPS file

• Declare it in your OPF file• Link to it in the CSS with @font-face• Specify the font using font-family

What could possibly go wrong?Hint: Epubcheck will get cranky if you’ve got your CSS encoded incorrectly

Page 30: Achieving Beautiful Typography in eBooks

Stretching by Bob AndersonDesigned by Rick Gordon

Page 31: Achieving Beautiful Typography in eBooks

Stretching by Bob AndersonDesigned by Rick Gordon

Page 32: Achieving Beautiful Typography in eBooks

Flowable Ebook Typography by Chris Jennings

Page 33: Achieving Beautiful Typography in eBooks

Back to Basics

Just because we’re doing things digitally doesn’t mean we get to lose

our minds.

Page 34: Achieving Beautiful Typography in eBooks

Back to basics

• Character Size• Baseline Grid• Line Length

Page 35: Achieving Beautiful Typography in eBooks

Character Size

• Typical font sizes for print will be too small for reading devices

• Setting explicit sizes can anger some readers and retailers

• Font-size: medium and font-size: 1.00em will size the font to default

• We can scale from there

Page 36: Achieving Beautiful Typography in eBooks

The Baseline Grid

• Line-height is not leading• Make it relative (1.50em for example)• Remember to add bottom margins to

headers, images, etc.• Remember that line-height and margin

relative sizes are inherited from the parent element

Resource: 24ways.org/2006/compose-to-a-vertical-rhythm/

Page 37: Achieving Beautiful Typography in eBooks

Line Length

• Be mindful of how your typeface and font-size affects line length

• In normal scenarios, lines that are too long are rarely a problem

• Just in case: p { max-width: 66em; }• Lines are likely to be too short for

larger fonts if relative margins are used

Page 38: Achieving Beautiful Typography in eBooks

Hyphenation Control

No more ladders, no more rivers…

a girl can dream. Can’t she?

Page 39: Achieving Beautiful Typography in eBooks

Hyphens for all:

• hyphens: none | auto | manual• -webkit-hyphens: none | auto |

manual• -moz-hyphens: none | auto | manual• adobe-hyphenate: none | auto |

explicit

Page 40: Achieving Beautiful Typography in eBooks

Manual/Explicit Hyphens

• Set hyphens via ­ (soft hyphen)

Page 41: Achieving Beautiful Typography in eBooks

Better Control

• hyphenate-after: auto | integer• hyphenate-before: auto | integer• hyphenate-character: auto | string (e.g. "\

2112”)• hyphenate-lines: auto | integer

Page 42: Achieving Beautiful Typography in eBooks

Things to remember

• Tip from Rick Gordon: bold and italic spans don’t always inherit the hyphenation rules.

em {font-style:italic; font-weight:inherit; -webkit-hyphens:inherit; hyphens:inherit;

}

Page 43: Achieving Beautiful Typography in eBooks

Don’t give up.

Be creative and persistent. Raise the bar.

Page 44: Achieving Beautiful Typography in eBooks

Don’t give up.

• Rick Gordon’s Solution for thin spaces around em dashes:

<style>.thin {letter-spacing: -.2em;}</style>

<span class=“thin”> </span>—<span class=“thin”> </span>

Page 45: Achieving Beautiful Typography in eBooks

Don’t give up.• Rick Gordon’s Solution for thin spaces around em dashes + Tom

McCluskey’s solution for keeping em dashes with their predecessor

<style>.thin {letter-spacing: -.2em;}.nobreak {white-space: nowrap;}</style>

<span class=“nobreak”>word<span class=“thin”> </span>—</span><span class=“thin”> </span>

Page 46: Achieving Beautiful Typography in eBooks

Controlling Space & Breaks

All your space are belong to us.

Page 47: Achieving Beautiful Typography in eBooks

Page Breaks

• Page-break-before: auto | always | avoid | right | left

• Page-break-after: auto | always | avoid | right | left

• Page-break-inside: auto | avoid

Page 48: Achieving Beautiful Typography in eBooks

Implications: Widows and Orphans

• Orphans: integer• Widows: integer

p {orphans: 2;widows: 2;

}

Page 49: Achieving Beautiful Typography in eBooks

Use Cases

Header (page-break-after: avoid: page-break-inside: avoid;)Body Text (h1 + p page-break-before: avoid)

Figure (page-break-after: avoid)Caption (page-break-before: avoid; page-break-inside: avoid;)

Tables (page-break-inside: avoid)

Page 50: Achieving Beautiful Typography in eBooks

An Example of Pull Quotes & Sidebars

Page 51: Achieving Beautiful Typography in eBooks

Discover Colorado by Mathew Downey and Ty BlissDesigned by Tom McCluskey

Page 52: Achieving Beautiful Typography in eBooks

Discover Colorado by Mathew Downey and Ty BlissDesigned by Tom McCluskey

Page 53: Achieving Beautiful Typography in eBooks

Discover Colorado by Mathew Downey and Ty BlissDesigned by Tom McCluskey

Page 54: Achieving Beautiful Typography in eBooks

Discover Colorado by Mathew Downey and Ty BlissDesigned by Tom McCluskey

Page 55: Achieving Beautiful Typography in eBooks

Discover Colorado by Mathew Downey and Ty BlissDesigned by Tom McCluskey

Page 56: Achieving Beautiful Typography in eBooks

An Example of Great Captions

Show and Tell

Page 57: Achieving Beautiful Typography in eBooks

From Stretching by Bob AndersonDesigned by Rick Gordon

Page 58: Achieving Beautiful Typography in eBooks

From Stretching by Bob AndersonDesigned by Rick Gordon

Page 59: Achieving Beautiful Typography in eBooks

Stretching by Bob AndersonDesigned by Rick Gordon

Page 60: Achieving Beautiful Typography in eBooks

Stretching by Bob AndersonDesigned by Rick Gordon

Page 61: Achieving Beautiful Typography in eBooks

Stretching by Bob AndersonDesigned by Rick Gordon

Page 62: Achieving Beautiful Typography in eBooks

Stretching by Bob AndersonDesigned by Rick Gordon

Page 63: Achieving Beautiful Typography in eBooks

Tables

(that look great)

Page 64: Achieving Beautiful Typography in eBooks

Images vs HTML

• Images Pros– Perfect representation– Readers can’t mess it up– All of the data will fit nicely all the time

• HTML Pros– Accessibility– Reflowability– Readers can mess it up– The data can be dynamic

Page 65: Achieving Beautiful Typography in eBooks

An Example of a Great Table as Image

Show and Tell

Page 66: Achieving Beautiful Typography in eBooks

From Homegrown Honey Bees by Alethea Morrison

Design by Dan O. Williams

Page 67: Achieving Beautiful Typography in eBooks

An Example of a Great Table as HTML

Page 68: Achieving Beautiful Typography in eBooks

From Colleen Cunningham

Page 69: Achieving Beautiful Typography in eBooks

Combination of HTML & CSS Styles

Page 70: Achieving Beautiful Typography in eBooks

Combination of HTML & CSS Styles

Page 71: Achieving Beautiful Typography in eBooks

From Colleen Cunningham

Page 72: Achieving Beautiful Typography in eBooks

Combination of HTML & CSS Styles

Page 73: Achieving Beautiful Typography in eBooks

Dealing with Special Characters

and other Crazy Tricks

Page 74: Achieving Beautiful Typography in eBooks

Super and Suber Script

Will mess with line-height unless you do something about it!

Here’s something Rick Gordon does:

sup {line-height:0;

}

Page 75: Achieving Beautiful Typography in eBooks

Arrows

Dan Williams uses the following:

a:link:after { margin: 0 0.05em 0 0.3em; color: #555; content: "\002794"; font-style: normal; text- decoration: none; position: relative; top: .1em;

}

Page 76: Achieving Beautiful Typography in eBooks

Homegrown Honey Bees Alethea MorrisonDesigned by Dan O. Williams

Page 77: Achieving Beautiful Typography in eBooks

Limit User Control*

text-size-adjust/-webkit-text-size-adjust : 100%

Or

text-size-adjust/-webkit-text-size-adjust : none

*Tip from Rick Gordon

Page 78: Achieving Beautiful Typography in eBooks

before: & after:

Dan Williams uses before: to display the word ABOVE before each caption

figcaption:before { color: inherit; content: "above:"; font-style: normal; padding-right: .4em; text-transform: uppercase; letter-spacing: .1em; font-size: 0.65rem; font- family: "chivo", helvetica, arial, sans-serif;

}

Page 79: Achieving Beautiful Typography in eBooks

Homegrown Honey Bees Alethea MorrisonDesigned by Dan O. Williams

Page 80: Achieving Beautiful Typography in eBooks

Generation Fix by Elizabeth Ruschdesign by Digital Bindery

Page 81: Achieving Beautiful Typography in eBooks

Generation Fix by Elizabeth Ruschdesign by Digital Bindery

Page 82: Achieving Beautiful Typography in eBooks

Media Queries

Media Queries are Rad

Page 83: Achieving Beautiful Typography in eBooks

CSS 3 & Kindle Queries will break your Adobe-based ebooks

• The solution you ask?

Page 84: Achieving Beautiful Typography in eBooks

Here you go ;)

Page 85: Achieving Beautiful Typography in eBooks

For a closer look at what works across platforms come to

Open Standards in a Walled Garden

tomorrow

Page 86: Achieving Beautiful Typography in eBooks

Thank you again to

• Anne-Marie Concepción (@amarie)• Colleen Cunningham

(@BookDesignGirl)• Dan O. Williams

(@FoxgloveCommons)• Rick Gordon (@rcgordon)• Tom McCluskey (@TomMcCluskey

Page 87: Achieving Beautiful Typography in eBooks

Go Buy These Books:

Homegrown Honey Bees by Alethea Morrison

Stretching: Enhanced 30th Anniversary Edition by Bob Anderson

Discover Colorado by Mathew Downey and Ty Bliss

The Everything Learning French Book 2nd Edition published by F&W Media

Waldon (as designed by Dan O. Williams) by Henry David Thoreau

Killer Commodities published by F&W Media

eBook Typography by Chris Jennings

Page 88: Achieving Beautiful Typography in eBooks

cya.

Amanda Gomm@agomm

[email protected]