Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Web Typography

Bram Stein
December 03, 2012

Web Typography

Slides for my Web Typography talk given at the Kings of Code conference 2012.

Bram Stein

December 03, 2012
Tweet

More Decks by Bram Stein

Other Decks in Design

Transcript

  1. header h3 { font-weight: normal; font-style: italic; font-size: 20px; }

    p { margin: 0; } p + p { text-indent: 1.5em; } article { margin: 110px auto; width: 510px; } section { color: #444; font-size: 20px; } section + section { margin-bottom: 1.5em; } header { margin-bottom: 1.5em; }
  2. o p s w v x 3 0 ! Quadraat

    Web Fonts
  3. 6 15 19 4.0 12.0 2.2 4.2–4.3 7 16 20

    5.0 12.1 2.3 5.0–5.1 8 17 21 5.1 12.5 3.0 6.0 9 18 22 6.0 4.0 10 23 4.1 WOFF
  4. 6 15 19 4.0 12.0 2.2 4.2–4.3 7 16 20

    5.0 12.1 2.3 5.0–5.1 8 17 21 5.1 12.5 3.0 6.0 9 18 22 6.0 4.0 10 23 4.1 TrueType/OpenType
  5. Embedded OpenType 6 15 19 4.0 12.0 2.2 4.2–4.3 7

    16 20 5.0 12.1 2.3 5.0–5.1 8 17 21 5.1 12.5 3.0 6.0 9 18 22 6.0 4.0 10 23 4.1
  6. SVG 6 15 19 4.0 12.0 2.2 4.2–4.3 7 16

    20 5.0 12.1 2.3 5.0–5.1 8 17 21 5.1 12.5 3.0 6.0 9 18 22 6.0 4.0 10 23 4.1
  7. 6 15 19 4.0 12.0 2.2 4.2–4.3 7 16 20

    5.0 12.1 2.3 5.0–5.1 8 17 21 5.1 12.5 3.0 6.0 9 18 22 6.0 4.0 10 23 4.1 WOFF + TTF/OTF + EOT + SVG
  8. Bulletproof @font-face syntax @font-face { font-family: 'MyFont'; src: url('myfont.eot?#iefix') format('embedded-opentype'),

    url('myfont.woff') format('woff'), url('myfont.otf') format('opentype'), url('myfont.ttf') format('truetype'), url('myfont.svg#font') format('svg'); }
  9. @font-face { font-family: 'MyFont'; src: url('myfont.eot?#iefix') format('embedded-opentype'), url('myfont.woff') format('woff'), url('myfont.otf')

    format('opentype'), url('myfont.ttf') format('truetype'), url('myfont.svg#font') format('svg'); } Bulletproof @font-face syntax
  10. Bulletproof @font-face syntax @font-face { font-family: 'MyFont'; src: url('myfont.eot?#iefix') format('embedded-opentype'),

    url('myfont.woff') format('woff'), url('myfont.otf') format('opentype'), url('myfont.ttf') format('truetype'), url('myfont.svg#font') format('svg'); }
  11. fi ffi  ffi 1234567890 /, / ½, ¼ Good

    morning G  Font Features (Case) Case
  12.  ffi ½, ¼ G  Font Features Case font-feature-settings:

    "case" 1; font-feature-settings: "smcp" 1; font-feature-settings: "frac" 1; font-feature-settings: "onum" 1; font-feature-settings: "liga" 1;
  13. Font features 6 15 19 4.0 12.0 2.2 4.2–4.3 7

    16 20 5.0 12.1 2.3 5.0–5.1 8 17 21 5.1 12.5 3.0 6.0 9 18 22 6.0 4.0 10 23 4.1
  14. CSS Hyphenation p { hyphens: auto; -webkit-hyphens: auto; -moz-hyphens: auto;

    -ms-hyphens: auto; } <body lang="en"> ... </body>
  15. CSS Hyphenation 6 15 19 4.0 12.0 2.2 4.2–4.3 7

    16 20 5.0 12.1 2.3 5.0–5.1 8 17 21 5.1 12.5 3.0 6.0 9 18 22 6.0 4.0 10 23 4.1
  16. 6 15 19 4.0 12.0 2.2 4.2–4.3 7 16 20

    5.0 12.1 2.3 5.0–5.1 8 17 21 5.1 12.5 3.0 6.0 9 18 22 6.0 4.0 10 23 4.1 text-align: dir [char]?
  17. jQuery(function ($) { $('table td').textAlign('.'); }); jQuery Text Align plugin

    https://github.com/bramstein/text-align text-align: dir [char]?
  18. Line breaking In olden times when wishing still helped one,

    there lived a king whose daughters were all beautiful; and the youngest was so beautiful that the sun itself, which has seen so much, was astonished whenever it shone in her face. In olden times when wishing still helped
  19. In olden times when wishing still helped one, there lived

    a king whose Line breaking In olden times when wishing still helped one, there lived a king whose daughters were all beautiful; and the youngest was so beautiful that the sun itself, which has seen so much, was astonished whenever it shone in her face. daughters
  20. In olden times when wishing still helped one, there lived

    a king whose daughters were all beautiful; and the Line breaking In olden times when wishing still helped one, there lived a king whose daughters were all beautiful; and the youngest was so beautiful that the sun itself, which has seen so much, was astonished whenever it shone in her face. youngest
  21. In olden times when wishing still helped one, there lived

    a king whose daughters were all beautiful; and the youngest was so beautiful that the sun itself, which has seen so much, was astonished whenever it shone in her face. Line breaking In olden times when wishing still helped one, there lived a king whose daughters were all beautiful; and the youngest was so beautiful that the sun itself, which has seen so much, was astonished whenever it shone in her face.
  22. Line breaking In olden times when wishing still helped one,

    there lived a king whose daughters were all beautiful; and the youngest was so beautiful that the sun itself, which has seen so much, was astonished whenever it shone in her face.
  23. Use web fonts. Use font features. Use hyphenation. Do not

    create bad typography. It is really not necessary.