Setting standards-friendly web type

Pascal Klein
Pascal KleinGraphic, web and interface designer, front-end developer and ramp­ant typ­ophile at the Australian National University as a student and otherwise as a self-employed contract designer.
Setting standards-friendly web type
Setting standards-
  friendly web type
❦ The art of technological typography
   Simon Pascal Klein — @klepas
Setting standards-friendly web type




               I’m…
Setting standards-friendly web type




               I’m…
          1. one ‘of those’ BA students;
Setting standards-friendly web type




               I’m…
          1. one ‘of those’ BA students;
         2. a graphic & web designer;
Setting standards-friendly web type




               I’m…
          1. one ‘of those’ BA students;
         2. a graphic & web designer;
         3. and, incurably, a rampant ‘typophile’.
Setting standards-friendly web type




                 ‘Typophiles’ are über gεεks who
                                      typography.
Setting standards-friendly web type




                 ‘Typophiles’ are über gεεks who
                                      typography.

                          Hands up and make yourselves known.
Setting standards-friendly web type




               ty•pog•ra•phy | tīˈpägrəfē | •n
Setting standards-friendly web type




               ty•pog•ra•phy | tīˈpägrəfē | •n
               Typography is the art of creating and setting type
               with the purpose of honouring the text it sets.
Setting standards-friendly web type




                            1 2
Setting standards-friendly web type




                            1 2
                Getting a typeface
                       on the web.
Setting standards-friendly web type




                            1 2
                Getting a typeface
                       on the web.
                                      Setting that type
                                         all pretty.
Setting standards-friendly web type




                                      1
Setting standards-friendly web type
Setting standards-friendly web type




                                      Q: Why?
Setting standards-friendly web type
Setting standards-friendly web type




                                      premise:
Setting standards-friendly web type




                                           premise:


                           The internet is saturated;
                                      it’s info-heavy.
Setting standards-friendly web type




                                             premise:


                           The internet is saturated;
                                      it’s info-heavy.

                                      Much of it is textual.
Setting standards-friendly web type




                                                premise:


                           The internet is saturated;
                                        it’s info-heavy.

                                         Much of it is textual.
                                      Much of it is a pain to read.
Setting standards-friendly web type
Setting standards-friendly web type




               Typography can bring aesthetic order to
               information, helping users read & navigate.
Setting standards-friendly web type
Setting standards-friendly web type




               Renewed interest in Typography
Setting standards-friendly web type




               Renewed interest in Typography
           • central to aesthetics;
Setting standards-friendly web type




               Renewed interest in Typography
           • central to aesthetics;
           • central to accessibility, legibility, …;
Setting standards-friendly web type




               Renewed interest in Typography
           • central to aesthetics;
           • central to accessibility, legibility, …;
           • many finer typesetting techniques are ‘new’ and
               admired for their ingenuity;
Setting standards-friendly web type




               Renewed interest in Typography
           • central to aesthetics;
           • central to accessibility, legibility, …;
           • many finer typesetting techniques are ‘new’ and
               admired for their ingenuity;
           • growing availability of web fonts.
Setting standards-friendly web type
Setting standards-friendly web type




                i.e.    make textual stuff look pretty.

                                      ☻
Setting standards-friendly web type
Setting standards-friendly web type




               Web experiences that feature good typography
               are easier and more pleasurable to use.
Setting standards-friendly web type
Setting standards-friendly web type




               Assumptions?
Setting standards-friendly web type




               Assumptions?
               It sucks? It’s boring?
Setting standards-friendly web type




               Assumptions?
               It sucks? It’s boring?
          1. Limited to sans-serif only for readability?
Setting standards-friendly web type




               Assumptions?
               It sucks? It’s boring?
          1. Limited to sans-serif only for readability?
         2. Only ‘web-safe’ fonts?
Setting standards-friendly web type




               Assumptions?
               It sucks? It’s boring?
          1. Limited to sans-serif only for readability?
         2. Only ‘web-safe’ fonts?
         3. Limited control—gotta resort to Flash and other
               non-standard technologies?
Setting standards-friendly web type




               Assumptions?
               It sucks? It’s boring?
          1. Limited to sans-serif only for readability?
         2. Only ‘web-safe’ fonts?
         3. Limited control—gotta resort to Flash and other
               non-standard technologies?
         4. So many options; how do I do it?
Setting standards-friendly web type
Setting standards-friendly web type




                                      Not quite.
Setting standards-friendly web type




                                      Not quite.

                                        (Yay!)
Setting standards-friendly web type
Setting standards-friendly web type




               Possible problems & pitfalls
Setting standards-friendly web type




               Possible problems & pitfalls
           • more fonts ≠ instant good typography;
Setting standards-friendly web type




               Possible problems & pitfalls
           • more fonts ≠ instant good typography;
           • many of the new web fonts aren’t optimised or
               even designed for web use;
Setting standards-friendly web type




               Possible problems & pitfalls
           • more fonts ≠ instant good typography;
           • many of the new web fonts aren’t optimised or
               even designed for web use;
           • growing availability of web fonts;
Setting standards-friendly web type




               Possible problems & pitfalls
           • more fonts ≠ instant good typography;
           • many of the new web fonts aren’t optimised or
               even designed for web use;
           • growing availability of web fonts;
           • differences in implementation;
Setting standards-friendly web type




               Possible problems & pitfalls
           • more fonts ≠ instant good typography;
           • many of the new web fonts aren’t optimised or
               even designed for web use;
           • growing availability of web fonts;
           • differences in implementation;
           • closed vs. open implementation struggle;
Setting standards-friendly web type




               Possible problems & pitfalls
           • more fonts ≠ instant good typography;
           • many of the new web fonts aren’t optimised or
               even designed for web use;
           • growing availability of web fonts;
           • differences in implementation;
           • closed vs. open implementation struggle;
           • sub-setting and compression becomes your
               responsibility if not using a hosting service.
Setting standards-friendly web type
Setting standards-friendly web type




                                      Q: How?
Setting standards-friendly web type




        A: There are a range of typesetting options for the
               web that vary in technical complexity and stylistic
               versatility.
Setting standards-friendly web type




        A: There are a range of typesetting options for the
               web that vary in technical complexity and stylistic
               versatility.

               They’re standards-based + you can use them now.
Setting standards-friendly web type




               Options for setting fonts:
Setting standards-friendly web type




               Options for setting fonts:
          1. Installed fonts (mostly web-safe)
Setting standards-friendly web type




               Options for setting fonts:
          1. Installed fonts (mostly web-safe)
         2. SIFR or other JS and Flash replacement
Setting standards-friendly web type




               Options for setting fonts:
          1. Installed fonts (mostly web-safe)
         2. SIFR or other JS and Flash replacement
         3. Cufón et al. (http://tinyurl.com/git-cufon)
Setting standards-friendly web type




               Options for setting fonts:
          1. Installed fonts (mostly web-safe)
         2. SIFR or other JS and Flash replacement
         3. Cufón et al. (http://tinyurl.com/git-cufon)
         4. webfonts: EOT/EOT Lite via @font-face
Setting standards-friendly web type




               Options for setting fonts:
          1. Installed fonts (mostly web-safe)
         2. SIFR or other JS and Flash replacement
         3. Cufón et al. (http://tinyurl.com/git-cufon)
         4. webfonts: EOT/EOT Lite via @font-face
         5. webfonts: OT/TTF via @font-face
Setting standards-friendly web type




               Options for setting fonts:
          1. Installed fonts (mostly web-safe)
         2. SIFR or other JS and Flash replacement
         3. Cufón et al. (http://tinyurl.com/git-cufon)
         4. webfonts: EOT/EOT Lite via @font-face
         5. webfonts: OT/TTF via @font-face
         6. webfonts: WOFF via @font-face
Setting standards-friendly web type




               Options for setting fonts:
          1. Installed fonts (mostly web-safe)
         2. SIFR or other JS and Flash replacement
         3. Cufón et al. (http://tinyurl.com/git-cufon)
         4. webfonts: EOT/EOT Lite via @font-face
         5. webfonts: OT/TTF via @font-face
         6. webfonts: WOFF via @font-face
         7. webfonts: SVG via @font-face
Setting standards-friendly web type




               Options for setting fonts:
          1. Installed fonts (mostly web-safe)
         2. SIFR or other JS and Flash replacement
         3. Cufón et al. (http://tinyurl.com/git-cufon)
         4. webfonts: EOT/EOT Lite via @font-face
         5. webfonts: OT/TTF via @font-face
         6. webfonts: WOFF via @font-face
         7. webfonts: SVG via @font-face
         8. webfonts: hosting & licensing services
Setting standards-friendly web type




        1. Installed or web-safe fonts
Setting standards-friendly web type




        1. Installed or web-safe fonts
               Simply call upon them directly in your font stack
               declarations, e.g.:
Setting standards-friendly web type




        1. 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;
Setting standards-friendly web type




        1. 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;

               font-family: 'Helvetica Neue',
                                      Helvetica,
                                      'Arial',
                                      sans-serif;
Setting standards-friendly web type
Setting standards-friendly web type




               Font stacks:
Setting standards-friendly web type




               Font stacks:
           • desired
Setting standards-friendly web type




               Font stacks:
           • desired
           • fallback
Setting standards-friendly web type




               Font stacks:
           • desired
           • fallback
           • generic (e.g. serif, sans-serif, monospace)
Setting standards-friendly web type




        2. sifr et al.
               Flash text replacement that in unison with JS
               replaces type using type from a Flash file.
Setting standards-friendly web type




        2. sifr et al.
               Flash text replacement that in unison with JS
               replaces type using type from a Flash file.

               Not a feasible solution long-term (i.e. don’t use):
Setting standards-friendly web type




        2. sifr et al.
               Flash text replacement that in unison with JS
               replaces type using type from a Flash file.

               Not a feasible solution long-term (i.e. don’t use):
          1. does subsetting;
Setting standards-friendly web type




        2. sifr et al.
               Flash text replacement that in unison with JS
               replaces type using type from a Flash file.

               Not a feasible solution long-term (i.e. don’t use):
          1. does subsetting;
         2. non-standard: relies on both Flash and JS;
Setting standards-friendly web type




        2. sifr et al.
               Flash text replacement that in unison with JS
               replaces type using type from a Flash file.

               Not a feasible solution long-term (i.e. don’t use):
          1. does subsetting;
         2. non-standard: relies on both Flash and JS;
         3. performance: high page load time—not feasible
               for body copy.
Setting standards-friendly web type




        3. Cufón & js 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.
Setting standards-friendly web type




        3. Cufón & js 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.

               Thoughts and concerns:
Setting standards-friendly web type




        3. Cufón & js 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.

               Thoughts and concerns:
          1. not accessible but works in most browsers;
Setting standards-friendly web type




        3. Cufón & js 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.

               Thoughts and concerns:
          1. not accessible but works in most browsers;
         2. type foundries are sceptical—not a ‘service’;
               limited palette of typefaces;
Setting standards-friendly web type




        3. Cufón & js 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.

               Thoughts and concerns:
          1. not accessible but works in most browsers;
         2. type foundries are sceptical—not a ‘service’;
               limited palette of typefaces;
         3. converter is often proprietary.
Setting standards-friendly web type




        4. webfonts: eot/eot 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’.
Setting standards-friendly web type




        4. webfonts: eot/eot 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’.

               Not feasible as-is currently:
Setting standards-friendly web type




        4. webfonts: eot/eot 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’.

               Not feasible as-is currently:
          1. non-standard, proprietary solution;
Setting standards-friendly web type




        4. webfonts: eot/eot 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’.

               Not feasible as-is currently:
          1. non-standard, proprietary solution;
         2. requires a proprietary converter (WEFT) to use;
Setting standards-friendly web type




        4. webfonts: eot/eot 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’.

               Not feasible as-is currently:
          1. non-standard, proprietary solution;
         2. requires a proprietary converter (WEFT) to use;
         3. proposal rejected by W 3C & only supported by IE.
Setting standards-friendly web type




        5. webfonts: ot/ttf
               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.
Setting standards-friendly web type




        5. webfonts: ot/ttf
               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.

               Feasible…:
Setting standards-friendly web type




        5. webfonts: ot/ttf
               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.

               Feasible…:
          1. OT/TTF files can easily be downloaded;
Setting standards-friendly web type




        5. webfonts: ot/ttf
               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.

               Feasible…:
          1. OT/TTF files can easily be downloaded;
         2. support: Safari 3.1+, Firefox 3.5+, Opera 10+,
               Chrome 4+; IE9 dev, Android 2.2+;
Setting standards-friendly web type




        5. webfonts: ot/ttf
               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.

               Feasible…:
          1. OT/TTF files can easily be downloaded;
         2. support: Safari 3.1+, Firefox 3.5+, Opera 10+,
               Chrome 4+; IE9 dev, Android 2.2+;
         3. subsetting & compression comes down to author.
Setting standards-friendly web type
Setting standards-friendly web type




         6. webfonts: woff
               Works just as OT/TTF, linking directly via the src:
               declaration to a WOFF file (compressed font data +
               XML     meta-data bundle, built using sfnt2woff).
Setting standards-friendly web type




         6. webfonts: woff
               Works just as OT/TTF, linking directly via the src:
               declaration to a WOFF file (compressed font data +
               XML     meta-data bundle, built using sfnt2woff).

               Thoughts (besides being awesome):
Setting standards-friendly web type




         6. webfonts: woff
               Works just as OT/TTF, linking directly via the src:
               declaration to a WOFF file (compressed font data +
               XML     meta-data bundle, built using sfnt2woff).

               Thoughts (besides being awesome):
          1. CORS available via HTTP response headers;
Setting standards-friendly web type




         6. webfonts: woff
               Works just as OT/TTF, linking directly via the src:
               declaration to a WOFF file (compressed font data +
               XML     meta-data bundle, built using sfnt2woff).

               Thoughts (besides being awesome):
          1. CORS available via HTTP response headers;
         2. the sfnt-font data can be extracted… effort?;
Setting standards-friendly web type




         6. webfonts: woff
               Works just as OT/TTF, linking directly via the src:
               declaration to a WOFF file (compressed font data +
               XML     meta-data bundle, built using sfnt2woff).

               Thoughts (besides being awesome):
          1. CORS available via HTTP response headers;
         2. the sfnt-font data can be extracted… effort?;
         3. support: Firefox 3.6+, WebKit, Chrome 5+, IE9 dev;
Setting standards-friendly web type




         6. webfonts: woff
               Works just as OT/TTF, linking directly via the src:
               declaration to a WOFF file (compressed font data +
               XML     meta-data bundle, built using sfnt2woff).

               Thoughts (besides being awesome):
          1. CORS available via HTTP response headers;
         2. the sfnt-font data can be extracted… effort?;
         3. support: Firefox 3.6+, WebKit, Chrome 5+, IE9 dev;
         4. subsetting & compression comes down to author.
Setting standards-friendly web type




         7. webfonts: svg
               Works just as EOT and OT/TTF , instead linking
               directly via the src: declaration to an SVG file
               which is downloaded and used to render the type.
Setting standards-friendly web type




         7. webfonts: svg
               Works just as EOT and OT/TTF , instead linking
               directly via the src: declaration to an SVG file
               which is downloaded and used to render the type.

               Thoughts:
Setting standards-friendly web type




         7. webfonts: svg
               Works just as EOT and OT/TTF , instead linking
               directly via the src: declaration to an SVG file
               which is downloaded and used to render the type.

               Thoughts:
          1. again, SVG files can easily be downloaded;
Setting standards-friendly web type




         7. webfonts: svg
               Works just as EOT and OT/TTF , instead linking
               directly via the src: declaration to an SVG file
               which is downloaded and used to render the type.

               Thoughts:
          1. again, SVG files can easily be downloaded;
         2. support: Firefox 3.5+ Chrome 0.3+, Opera 9+, iOS 1+,
               Safari 3.1+;
Setting standards-friendly web type




         7. webfonts: svg
               Works just as EOT and OT/TTF , instead linking
               directly via the src: declaration to an SVG file
               which is downloaded and used to render the type.

               Thoughts:
          1. again, SVG files can easily be downloaded;
         2. support: Firefox 3.5+ Chrome 0.3+, Opera 9+, iOS 1+,
               Safari 3.1+;
         3. subsetting & compression comes down to author.
Setting standards-friendly web type
Setting standards-friendly web type




               Web hosting & licensing services have sprung up
               offering a library of fonts at a variety of free and
               commercial plans (e.g. Typekit, Kernest, et al.).
Setting standards-friendly web type




         8. Hosting & licensing services
               Generally foundry initiatives that are JS-based
               (though not exclusively) and hosted, paid
               subscription models: select, pay, inject; done.
Setting standards-friendly web type




         8. Hosting & licensing services
               Generally foundry initiatives that are JS-based
               (though not exclusively) and hosted, paid
               subscription models: select, pay, inject; done.

               Thoughts:
Setting standards-friendly web type




         8. Hosting & licensing services
               Generally foundry initiatives that are JS-based
               (though not exclusively) and hosted, paid
               subscription models: select, pay, inject; done.

               Thoughts:
          1. deemed ‘the solution’ and becoming such;
Setting standards-friendly web type




         8. Hosting & licensing services
               Generally foundry initiatives that are JS-based
               (though not exclusively) and hosted, paid
               subscription models: select, pay, inject; done.

               Thoughts:
          1. deemed ‘the solution’ and becoming such;
         2. standards-based, good browser support, and easy;
Setting standards-friendly web type




         8. Hosting & licensing services
               Generally foundry initiatives that are JS-based
               (though not exclusively) and hosted, paid
               subscription models: select, pay, inject; done.

               Thoughts:
          1. deemed ‘the solution’ and becoming such;
         2. standards-based, good browser support, and easy;
         3. subsetting and/or compression service-side.
Setting standards-friendly web type
Setting standards-friendly web type
Setting standards-friendly web type
Setting standards-friendly web type
Setting standards-friendly web type
Setting standards-friendly web type
Setting standards-friendly web type
Setting standards-friendly web type
Setting standards-friendly web type
Setting standards-friendly web type
Setting standards-friendly web type
Setting standards-friendly web type
Setting standards-friendly web type
Setting standards-friendly web type
Setting standards-friendly web type
Setting standards-friendly web type




              Using @font-face
Setting standards-friendly web type




              Using @font-face
         0. Reset
Setting standards-friendly web type




              Using @font-face
         0. Reset
               All the browsers have their own default styling for
               various (x)HTML elements. This makes it a pain for
               cross-browser consistency.
Setting standards-friendly web type




               body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,in
               put,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.
Setting standards-friendly web type




               ‘bullet-proof’ @font-face declarations
Setting standards-friendly web type




               ‘bullet-proof’ @font-face declarations

                @font-face {
Setting standards-friendly web type




               ‘bullet-proof’ @font-face declarations

                @font-face {
                    font-family: "Your typeface";
Setting standards-friendly web type




               ‘bullet-proof’ @font-face declarations

                @font-face {
                    font-family: "Your typeface";
                    src: url("type/filename.eot");
Setting standards-friendly web type




               ‘bullet-proof’ @font-face declarations

                @font-face {
                    font-family: "Your typeface";
                    src: url("type/filename.eot");
                    src: local("Alt name"), local("Alt-name"),
Setting standards-friendly web type




               ‘bullet-proof’ @font-face declarations

                @font-face {
                    font-family: "Your typeface";
                    src: url("type/filename.eot");
                    src: local("Alt name"), local("Alt-name"),
                        url("type/filename.woff") format("woff"),
Setting standards-friendly web type




               ‘bullet-proof’ @font-face declarations

                @font-face {
                    font-family: "Your typeface";
                    src: url("type/filename.eot");
                    src: local("Alt name"), local("Alt-name"),
                        url("type/filename.woff") format("woff"),
                        url("type/filename.otf") format("opentype"),
Setting standards-friendly web type




               ‘bullet-proof’ @font-face declarations

                @font-face {
                    font-family: "Your typeface";
                    src: url("type/filename.eot");
                    src: local("Alt name"), local("Alt-name"),
                        url("type/filename.woff") format("woff"),
                        url("type/filename.otf") format("opentype"),
                        url("type/filename.svg#id") format("svg");
                    }
Setting standards-friendly web type




               When using @font-face, we’re essentially dealing
               with separate font files of the same family for the
               various font styles, e.g., foobar-regular.otf, foobar-
               italic.otf, foobar-bold.otf, foobar-smallcaps.otf &c.
Setting standards-friendly web type




               When using @font-face, we’re essentially dealing
               with separate font files of the same family for the
               various font styles, e.g., foobar-regular.otf, foobar-
               italic.otf, foobar-bold.otf, foobar-smallcaps.otf &c.
               This can become an issue—consider elements
               such as strong and em which are styled with
               setting the face in a bold and italic respectively.
Setting standards-friendly web type




               When using @font-face, we’re essentially dealing
               with separate font files of the same family for the
               various font styles, e.g., foobar-regular.otf, foobar-
               italic.otf, foobar-bold.otf, foobar-smallcaps.otf &c.
               This can become an issue—consider elements
               such as strong and em which are styled with
               setting the face in a bold and italic respectively.
               If we declare the italic via @font-face (as we
               would to get the style into our design) what will
               happen is that the italic is digitally italicised (fake
               italics) by the font rendering engine. Result?
Setting standards-friendly web type
Setting standards-friendly web type




               If we avoid or overwrite the various declarations
               (e.g. em { font-style: normal;}) and for
               whatever reason our desired @font-face font
               isn’t available, we rob other fonts in the font-
               stack of their styling.
Setting standards-friendly web type




               We overcome both these issues by setting the
               font styles within the @font-face declaration:

                @font-face {
                   font-family: "Your italic typeface";
                   src: url("type/filename.eot");
                   src: local("Alt italic name"), local("Alt-italic-name"),
                       url("type/filename-italic.woff") format("woff"),
                       url("type/filename-italic.otf") format("opentype"),
                       url("type/filename-italic.svg#id") format("svg");
                   }
Setting standards-friendly web type




               We overcome both these issues by setting the
               font styles within the @font-face declaration:

                @font-face {
                   font-family: "Your italic typeface";


                   src: url("type/filename.eot");
                   src: local("Alt italic name"), local("Alt-italic-name"),
                       url("type/filename-italic.woff") format("woff"),
                       url("type/filename-italic.otf") format("opentype"),
                       url("type/filename-italic.svg#id") format("svg");
                   }
Setting standards-friendly web type




               We overcome both these issues by setting the
               font styles within the @font-face declaration:

                @font-face {
                   font-family: "Your italic typeface";
                   font-style: italic;
                   src: url("type/filename.eot");
                   src: local("Alt italic name"), local("Alt-italic-name"),
                       url("type/filename-italic.woff") format("woff"),
                       url("type/filename-italic.otf") format("opentype"),
                       url("type/filename-italic.svg#id") format("svg");
                   }
Setting standards-friendly web type




               Why are they two entries for local in src?
               src: local("Alt italic name"), local("Alt-italic-name"),


               Some browsers refer to the fonts using their
               PostScript names.
Setting standards-friendly web type




            Finding it in Font Book under Mac OS X:
Setting standards-friendly web type




               There is a free downloadable Font properties
               extension for Windows. Once installed right-click
               → Properties on a font file and click on the Names
               tab to see the name details.
Setting standards-friendly web type




               There is a free downloadable Font properties
               extension for Windows. Once installed right-click
               → Properties on a font file and click on the Names
               tab to see the name details.
               See: http://bit.ly/ms-font-prop.
Setting standards-friendly web type




               There is a free downloadable Font properties
               extension for Windows. Once installed right-click
               → Properties on a font file and click on the Names
               tab to see the name details.
               See: http://bit.ly/ms-font-prop.


               There are similar tools on the free desktops.
Setting standards-friendly web type
Setting standards-friendly web type




               When using @font-face for self-hosted fonts, we
               need to subset and compress ourselves.
Setting standards-friendly web type




               When using @font-face for self-hosted fonts, we
               need to subset and compress ourselves.
               Subsetting allows us to remove knowingly unused
               glyphs from the font file, thus cutting down file
               size. E.g. if we know we won’t ever need Greek
               characters we can remove them reducing the font
               file’s size, thus lowering page size.
Setting standards-friendly web type




               When using @font-face for self-hosted fonts, we
               need to subset and compress ourselves.
               Subsetting allows us to remove knowingly unused
               glyphs from the font file, thus cutting down file
               size. E.g. if we know we won’t ever need Greek
               characters we can remove them reducing the font
               file’s size, thus lowering page size.
               Subsetting is can be done in a font editor—I
               suggest FontForge (FOSS)—open your font, select
               unused character blocks and delete them; save.
Setting standards-friendly web type
Setting standards-friendly web type




               Save yourself a headache—skip using the WEFT
               converter and instead use ttf2eot. Why?
Setting standards-friendly web type




               Save yourself a headache—skip using the WEFT
               converter and instead use ttf2eot. Why?

          1. WEFT will use Monotype’s proprietary
               compression algorithm and gzip is better;
Setting standards-friendly web type




               Save yourself a headache—skip using the WEFT
               converter and instead use ttf2eot. Why?

          1. WEFT will use Monotype’s proprietary
               compression algorithm and gzip is better;
         2. WEFT only works on Windows XP(?);
Setting standards-friendly web type




               Save yourself a headache—skip using the WEFT
               converter and instead use ttf2eot. Why?

          1. WEFT will use Monotype’s proprietary
               compression algorithm and gzip is better;
         2. WEFT only works on Windows XP(?);
         3. tff2eot doesn’t compress—use gzip server-side.
Setting standards-friendly web type




               Save yourself a headache—skip using the WEFT
               converter and instead use ttf2eot. Why?

          1. WEFT will use Monotype’s proprietary
               compression algorithm and gzip is better;
         2. WEFT only works on Windows XP(?);
         3. tff2eot doesn’t compress—use gzip server-side.

               There are online front ends to ttf2eot/sfnt2woff:
Setting standards-friendly web type




               Save yourself a headache—skip using the WEFT
               converter and instead use ttf2eot. Why?

          1. WEFT will use Monotype’s proprietary
               compression algorithm and gzip is better;
         2. WEFT only works on Windows XP(?);
         3. tff2eot doesn’t compress—use gzip server-side.

               There are online front ends to ttf2eot/sfnt2woff:
           • http://ttf2eot.sebastiankippe.com/
Setting standards-friendly web type




               Save yourself a headache—skip using the WEFT
               converter and instead use ttf2eot. Why?

          1. WEFT will use Monotype’s proprietary
               compression algorithm and gzip is better;
         2. WEFT only works on Windows XP(?);
         3. tff2eot doesn’t compress—use gzip server-side.

               There are online front ends to ttf2eot/sfnt2woff:
           • http://ttf2eot.sebastiankippe.com/
           • http://fontsquirrel.com/fontface/generator
Setting standards-friendly web type
Setting standards-friendly web type




               For compression, let’s gzip (via .htaccess):
Setting standards-friendly web type




               For compression, let’s gzip (via .htaccess):

               # gzips content if possible
               <IfModule mod_gzip.c>
                   mod_gzip_on         Yes
                   mod_gzip_dechunk    Yes
                   mod_gzip_item_include file      .(html?|css|js|...|otf|eot)$
                   mod_gzip_item_include handler   ^cgi-script$
                   ...
                   mod_gzip_item_include mime      ^application/vnd.ms-fontobject$
               </IfModule>
Setting standards-friendly web type




               For compression, let’s gzip (via .htaccess):

               # gzips content if possible
               <IfModule mod_gzip.c>
                   mod_gzip_on         Yes
                   mod_gzip_dechunk    Yes
                   mod_gzip_item_include file      .(html?|css|js|...|otf|eot)$
                   mod_gzip_item_include handler   ^cgi-script$
                   ...
                   mod_gzip_item_include mime      ^application/vnd.ms-fontobject$
               </IfModule>
Setting standards-friendly web type




               For compression, let’s gzip (via .htaccess):

               # gzips content if possible
               <IfModule mod_gzip.c>
                   mod_gzip_on         Yes
                   mod_gzip_dechunk    Yes
                   mod_gzip_item_include file      .(html?|css|js|...|otf|eot)$
                   mod_gzip_item_include handler   ^cgi-script$
                   ...
                   mod_gzip_item_include mime      ^application/vnd.ms-fontobject$
               </IfModule>
Setting standards-friendly web type




               For compression, let’s gzip (via .htaccess):

               # gzips content if possible
               <IfModule mod_gzip.c>
                   mod_gzip_on         Yes
                   mod_gzip_dechunk    Yes
                   mod_gzip_item_include file      .(html?|css|js|...|otf|eot)$
                   mod_gzip_item_include handler   ^cgi-script$
                   ...
                   mod_gzip_item_include mime      ^application/vnd.ms-fontobject$
               </IfModule>
Setting standards-friendly web type




               For compression, let’s gzip (via .htaccess):

               # gzips content if possible
               <IfModule mod_gzip.c>
                   mod_gzip_on         Yes
                   mod_gzip_dechunk    Yes
                   mod_gzip_item_include file      .(html?|css|js|...|otf|eot)$
                   mod_gzip_item_include handler   ^cgi-script$
                   ...
                   mod_gzip_item_include mime      ^application/vnd.ms-fontobject$
               </IfModule>




               Don’t be surprised to see reductions of 40–50%.
Setting standards-friendly web type




               While we’re at it, let’s cache the font assets too:
Setting standards-friendly web type




               While we’re at it, let’s cache the font assets too:

               # Cache following file types for one month
               <FilesMatch ".(js|jpeg|jpg|...|otf|eot)$">
                     Header set Cache-Control "max-age=2592000"
               </FilesMatch>
Setting standards-friendly web type




               While we’re at it, let’s cache the font assets too:

               # Cache following file types for one month
               <FilesMatch ".(js|jpeg|jpg|...|otf|eot)$">
                     Header set Cache-Control "max-age=2592000"
               </FilesMatch>
Setting standards-friendly web type




              Finding fonts…?
Setting standards-friendly web type




              Finding fonts…?
           • http://openfontlibrary.org/
Setting standards-friendly web type




              Finding fonts…?
           • http://openfontlibrary.org/
           • http://www.theleagueofmoveabletype.com/
Setting standards-friendly web type




              Finding fonts…?
           • http://openfontlibrary.org/
           • http://www.theleagueofmoveabletype.com/
           • http://www.fontsquirrel.com/fontface
Setting standards-friendly web type




              Finding fonts…?
           • http://openfontlibrary.org/
           • http://www.theleagueofmoveabletype.com/
           • http://www.fontsquirrel.com/fontface
           • list on webfonts.info: http://bit.ly/16Qid4
Setting standards-friendly web type




                                      2
Setting standards-friendly web type
Setting standards-friendly web type




                                      Meanwhile:
Setting standards-friendly web type




                                        Meanwhile:

                       Webfonts aren’t the holy grail of web
                                      typography problems…
Setting standards-friendly web type




                                        Meanwhile:

                       Webfonts aren’t the holy grail of web
                                      typography problems…


          “Typography is not picking a ‘cool’ font.”
                                                     – Jeff Croft
Setting standards-friendly web type




               Also remember, most fonts available from
               type foundries are not optimised for screen
               usage; they’re for print.
Setting standards-friendly web type




                                      …
Setting standards-friendly web type




               So… now having selected our desired
               typeface (via webfonts or otherwise), let’s
               make it pretty.
Setting standards-friendly web type
Setting standards-friendly web type




               serif
Setting standards-friendly web type




               serif
               sans serif
Setting standards-friendly web type




               serif
               sans serif
               script
Setting standards-friendly web type




               serif
               sans serif
               script
               blackletter
Setting standards-friendly web type




               serif
               sans serif
               script
               blackletter
               monospace
Setting standards-friendly web type
Setting standards-friendly web type




               Arial
               Verdana
               Courier New
               Times New Roman
               Georgia
               Trebuchet MS
Setting standards-friendly web type
Setting standards-friendly web type




               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.:
Setting standards-friendly web type




               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.:
          1. one sets the body, the other the headings;
Setting standards-friendly web type




               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.:
          1. one sets the body, the other the headings;
         2. one sets primary content, the other UI controls.
Setting standards-friendly web type




               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.:
          1. one sets the body, the other the headings;
         2. one sets primary content, the other UI controls.

               We do this with the font-family property.
Setting standards-friendly web type
Setting standards-friendly web type




               Use a combination of families, styles, and weights
               to breath some fresh air into your web type.
Setting standards-friendly web type




               Use a combination of families, styles, and weights
               to breath some fresh air into your web type.

           • font-weight controls weight and accepts
               numerical and descriptive (e.g. normal) values.
Setting standards-friendly web type




               Use a combination of families, styles, and weights
               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).
Setting standards-friendly web type




               Use a combination of families, styles, and weights
               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.
Setting standards-friendly web type
Setting standards-friendly web type




               roman (‘normal’)
Setting standards-friendly web type




               roman (‘normal’)
Setting standards-friendly web type




               roman (‘normal’)
               italic
Setting standards-friendly web type




               roman (‘normal’)
               italic ≠ oblique
Setting standards-friendly web type




               roman (‘normal’)
               italic ≠ oblique
Setting standards-friendly web type




               roman (‘normal’)
               italic ≠ oblique
Setting standards-friendly web type




               roman (‘normal’)
               italic ≠ oblique
               ultralight regular bold
Setting standards-friendly web type




               roman (‘normal’)
               italic ≠ oblique
               ultralight regular bold
Setting standards-friendly web type




               roman (‘normal’)
               italic ≠ oblique
               ultralight regular bold
               & bold italic condensed
Setting standards-friendly web type




               roman (‘normal’)
               italic ≠ oblique
               ultralight regular bold
               & bold italic condensed
Setting standards-friendly web type




               roman (‘normal’)
               italic ≠ oblique
               ultralight regular bold
               & bold italic condensed
               S MALL - CAPITALS
Setting standards-friendly web type




               roman (‘normal’)
               italic ≠ oblique
               ultralight regular bold
               & bold italic condensed
               S MALL - CAPITALS
Setting standards-friendly web type
Setting standards-friendly web type




               Tracking
Setting standards-friendly web type




               Tracking
               Tracking
Setting standards-friendly web type




               Tracking
               Tracking
               Letter-spacing
Setting standards-friendly web type




               Tracking
               Tracking
               Letter-spacing
               Letter-spacing
Setting standards-friendly web type
Setting standards-friendly web type




               Letʼs see some loose word-
               spacing in action…
Setting standards-friendly web type




               Letʼs see some loose word-
               spacing in action…

               And now both loose word-spacing
               and tracking featured together.
Setting standards-friendly web type
Setting standards-friendly web type




               And finally, the recently popular
               trend of negative tracking.
Setting standards-friendly web type
Setting standards-friendly web type




               Tracking and word-spacing can help differentiate,
               aiding readability by removing disruption.
Setting standards-friendly web type




               Tracking and word-spacing can help differentiate,
               aiding readability by removing disruption.

               E.g. setting acronyms or numerical tabular data.
Setting standards-friendly web type
Setting standards-friendly web type




               Full-capital acronyms, along with other full-cap-
               sized glyphs can disturb the flow of the text:
Setting standards-friendly web type




               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; ac habitant orci tristique
               senectus et 4,962 malesuada fames egestas HTML sit lectus.
Setting standards-friendly web type




               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; ac habitant orci tristique
               senectus et 4,962 malesuada fames egestas HTML sit lectus.
Setting standards-friendly web type




               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; ac habitant orci tristique
               senectus et 4,962 malesuada fames egestas HTML sit lectus.

               Lorem ipsum dolor sit amet, nasa consectetur adipiscing
               et. Vestibulum elit pellentesque; ac habitant orci tristique
               senectus et 4,962 malesuada fames egestas html sit lectus.
Setting standards-friendly web type




               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; ac habitant orci tristique
               senectus et 4,962 malesuada fames egestas HTML sit lectus.

               Lorem ipsum dolor sit amet, nasa consectetur adipiscing
               et. Vestibulum elit pellentesque; ac habitant orci tristique
               senectus et 4,962 malesuada fames egestas html sit lectus.
Setting standards-friendly web type
Setting standards-friendly web type




           • letter-spacing and word-spacing controls
               tracking and word-spacing respectively. Both take
               numerical values and normal.
Setting standards-friendly web type




           • 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.
Setting standards-friendly web type
Setting standards-friendly web type




           • font-size controls… font sizes. Takes numerical
               and descriptive values. Most user agents (e.g.
               browsers) set default value at 16px.
Setting standards-friendly web type




           • font-size controls… font sizes. Takes numerical
               and descriptive values. Most user agents (e.g.
               browsers) set default value at 16px.

               Size font sizes relatively using ems or %.
Setting standards-friendly web type




           • font-size controls… font sizes. Takes numerical
               and descriptive values. Most user agents (e.g.
               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).
Setting standards-friendly web type




               Why?
Setting standards-friendly web type




               Why?
           • Some UAs don’t support font-resizing (Ctrl + +/-) or
               page scaling when measurements are defined in
               absolute terms.
Setting standards-friendly web type




               Why?
           • 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.
Setting standards-friendly web type




               Why?
           • 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.
Setting standards-friendly web type
Setting standards-friendly web type




               Key: remember font sizes are inherited:
               parents → children.
Setting standards-friendly web type




               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):
Setting standards-friendly web type




               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):

                 1 ÷ parent font-size × required pixel value
                                      = em value
Setting standards-friendly web type




               62.5% trick
Setting standards-friendly web type




               62.5% trick
               Simplify your calculations. Consider:

               p { font-size: 80%; }
               blockquote { font-size: 80%; }
Setting standards-friendly web type




               62.5% trick
               Simplify your calculations. Consider:

               p { font-size: 80%; }
               blockquote { font-size: 80%; }


               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.
Setting standards-friendly web type




               62.5% trick (cont’d)
               In 2004 Richard Rutter wrote an article outlining a
               trick he used to make these calculations simpler:
Setting standards-friendly web type




               62.5% trick (cont’d)
               In 2004 Richard Rutter wrote an article outlining a
               trick he used to make these calculations simpler:
           • browsers have common default size of 16px; thus:
Setting standards-friendly web type




               62.5% trick (cont’d)
               In 2004 Richard Rutter wrote an article outlining a
               trick he used to make these calculations simpler:
           • browsers have common default size of 16px; thus:
           • set body to 62.5% and reset all to 10px; thus:
Setting standards-friendly web type




               62.5% trick (cont’d)
               In 2004 Richard Rutter wrote an article outlining a
               trick he used to make these calculations simpler:
           • 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.
Setting standards-friendly web type
Setting standards-friendly web type




               To find an element’s font size in absolute terms
               (e.g. pixels) you can use the Firefox ‘Web
               Developer’ plugin: Information → Display Element
               Information.
Setting standards-friendly web type




               Mixing typefaces requires special attention. Try to
               align x-heights and sizes. X-heights?


               x-height x-height
               Helvetica Regular 96pt & Dolly Regular 96pt.
Setting standards-friendly web type




               Mixing typefaces requires special attention. Try to
               align x-heights and sizes. X-heights?


               x-height x-height
               Helvetica Regular 96pt & Dolly Regular 96pt.



               x-height x-height
               Helvetica Regular 96pt & Dolly Regular 108pt.
Setting standards-friendly web type




               Stick it to a scale
               Don’t just arbitrarily set type; use a scale:
Setting standards-friendly web type




               Stick it to a scale
               Don’t just arbitrarily set type; use 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,



                another scale
                                       14, 18,     24, 36,        48, 64, 72,    96.
                8,   13,   21,      34,           55,
                scale based on the Fibonacci sequence
                                                              89.
Setting standards-friendly web type
Setting standards-friendly web type




               At small sizes font-decoration: underline;
               can render descender glyphs (g, j, p, q, y) difficult
               to read: use border-bottom: 1px solid;
Setting standards-friendly web type




               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…
Setting standards-friendly web type




               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…
Setting standards-friendly web type




               Correct glyphs
               Consider:




                                      ' "
Setting standards-friendly web type




               Correct glyphs
               Consider:




                                      1'61"
                                       ' "
Setting standards-friendly web type




                           "This is a group of words
                            surrounded by a bunch
                                of tick marks."
Setting standards-friendly web type




                        “This is a quotation!”
                                        - Jeff Croft
Setting standards-friendly web type




                                      ‘’ “”
                                         ’
Setting standards-friendly web type
Setting standards-friendly web type




                      - hyphen        Mary-Anne, Walter-Strauss


                     – en dash        April–May, ages 3–5, pp. 37–38


                 — em dash            Phrase marker—(generally) not spaced—like so.


                       – minus        5–4=1
Setting standards-friendly web type




                   “       opening double quote   &ldquo;
                   ”       closing double quote   &rdquo;
                   ‘       opening single quote   &lsquo;
                   ’       closing single quote   &rsquo;
                   –       en dash                &ndash;
                  —        em dash                &mdash;
                  − minus                         &minus;
                   ×       multiplication         &times;
                  …        ellipsis               &hellip;
Setting standards-friendly web type




               Smartypants et al.
Setting standards-friendly web type




               Smartypants et al.
              ‘Doing something repetitively? Likely you’re doing it wrong.’
Setting standards-friendly web type




               Smartypants et al.
              ‘Doing something repetitively? Likely you’re doing it wrong.’

               Smartypants et al. are parsers that translate plain
               ASCII     characters into “smart” typographic (x)HTML
               entities (and beyond just punctuation).
Setting standards-friendly web type




               Smartypants et al.
              ‘Doing something repetitively? Likely you’re doing it wrong.’

               Smartypants et al. are parsers that translate plain
               ASCII     characters into “smart” typographic (x)HTML
               entities (and beyond just punctuation).

           • Smartypants (PHP, Perl, & Movable Type);
Setting standards-friendly web type




               Smartypants et al.
              ‘Doing something repetitively? Likely you’re doing it wrong.’

               Smartypants et al. are parsers that translate plain
               ASCII     characters into “smart” typographic (x)HTML
               entities (and beyond just punctuation).

           • Smartypants (PHP, Perl, & Movable Type);
           • Typogrify (Python/Django);
Setting standards-friendly web type




               Smartypants et al.
              ‘Doing something repetitively? Likely you’re doing it wrong.’

               Smartypants et al. are parsers that translate plain
               ASCII     characters into “smart” typographic (x)HTML
               entities (and beyond just punctuation).

           • Smartypants (PHP, Perl, & Movable Type);
           • Typogrify (Python/Django);
           • wp-Typography (WordPress);
Setting standards-friendly web type




               Smartypants et al.
              ‘Doing something repetitively? Likely you’re doing it wrong.’

               Smartypants et al. are parsers that translate plain
               ASCII     characters into “smart” typographic (x)HTML
               entities (and beyond just punctuation).

           • Smartypants (PHP, Perl, & Movable Type);
           • Typogrify (Python/Django);
           • wp-Typography (WordPress);
           • Markdown, Textile et al., …
Setting standards-friendly web type
Setting standards-friendly web type




               Give ampersands love
Setting standards-friendly web type




               Give ampersands love
               Italic ampersand variants are often much prettier
               than their common roman counterparts:
Setting standards-friendly web type




               Give ampersands love
               Italic ampersand variants are often much prettier
               than their common roman counterparts:



                   &&&&&&
Setting standards-friendly web type




               Give ampersands love
               Italic ampersand variants are often much prettier
               than their common roman counterparts:



               &&&&&&
               &&&&&&
Setting standards-friendly web type




               Marking paragraphs (and more)
Setting standards-friendly web type




               Marking paragraphs (and more)
               Don’t be afraid to mark new paragraphs with
               indents, outdents, white-lines, a pilcrow (¶) or
               other ornament (e.g. ❦), versals, headers &c.
Setting standards-friendly web type




               Marking paragraphs (and more)
               Don’t be afraid to mark new paragraphs with
               indents, outdents, white-lines, a pilcrow (¶) or
               other ornament (e.g. ❦), versals, headers &c.

               …or a combination thereof.
Setting standards-friendly web type




               Marking paragraphs (and more)
               Don’t be afraid to mark new paragraphs with
               indents, outdents, white-lines, a pilcrow (¶) or
               other ornament (e.g. ❦), versals, headers &c.

               …or a combination thereof.

               See: http://tinyurl.com/para-typography.
Setting standards-friendly web type




               Measures
               The 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.
Setting standards-friendly web type




               Measures
               The 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.
Setting standards-friendly web type




               Measures (cont’d)
Setting standards-friendly web type




               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.
Setting standards-friendly web type




               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.
Setting standards-friendly web type




               Leading (line-height)
Setting standards-friendly web type




               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);
Setting standards-friendly web type




               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. ☺
Setting standards-friendly web type




               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. ☺
Setting standards-friendly web type




               Hanging punctuation
               Traditionally punctuation marks, bullets, lists,
               hyphens, and brackets all hang in the margin.
Setting standards-friendly web type




               Hanging punctuation
               Traditionally 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. Etiam mollis vulputate
             ( lorem nullam turpis non massa rhoncus sodales.)”
Setting standards-friendly web type




               Hanging punctuation
               Traditionally 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. Etiam mollis vulputate
             ( lorem nullam turpis non massa rhoncus sodales.)”
Setting standards-friendly web type




               Hanging punctuation (cont’d)
               Simply with lists by setting their margins to zero.
Setting standards-friendly web type




               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.
               CSS 3
                   will hopefully support hanging punctuation
               with a proposed hanging-punctuation property.
Setting standards-friendly web type




               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.
               CSS 3
                   will hopefully support hanging punctuation
               with a proposed hanging-punctuation property.

               See: http://tinyurl.com/w3c-hanging-punct.
Setting standards-friendly web type




               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).
Setting standards-friendly web type




               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 a tad smaller) and with
               different typefaces or font styles.
Setting standards-friendly web type
Setting standards-friendly web type
Setting standards-friendly web type
Setting standards-friendly web type




               Page (grid)
Setting standards-friendly web type




               Page (grid)
               Grids bring order to your page and help specify
               where things should go.
Setting standards-friendly web type




               Page (grid)
               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.
Setting standards-friendly web type




               Page (grid)
               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).
Setting standards-friendly web type
Setting standards-friendly web type
Setting standards-friendly web type




               Btw: http://gridulator.com.
Setting standards-friendly web type
Setting standards-friendly web type




               Addendum
Setting standards-friendly web type




               Addendum
               Please don’t use Comic Sans unless you have a
               very, very good reason.
isbn: 0-88179-206-3
Setting standards-friendly web type




               Inspirational typophiles
            • Cameron Moll: cameronmoll.com

            • Jeff Croft: jeffcroft.com

            • Jeffrey Zeldman: zeldman.com

            • Mark Boulton: markboulton.co.uk

            • Richard Rutter: clagnut.com

            • Jon Tan: jontangerine.com
Setting standards-friendly web type




               Resources & reading
            • http://webtypography.net

            • http://alistapart.com/topics/design/typography

            • http://usabletype.org

            • http://ilovetypography.com

            • http://www.papress.com/other/thinkingwithtype/
Thanks!
            klepas@klepas.org

            klepas.org

            @klepas



Licensed CC BY -NC-ND
http://creativecommons.org/licenses/by-nc-nd/2.5/au/
1 of 327

Recommended

The Needs Of Computation by
The  Needs Of  ComputationThe  Needs Of  Computation
The Needs Of ComputationNasir Jumani
392 views18 slides
World war ii by
World war iiWorld war ii
World war iiNorth Gwinnett Middle School
1.2K views42 slides
Infobrokering And Searching The Deep Web by
Infobrokering And Searching The Deep WebInfobrokering And Searching The Deep Web
Infobrokering And Searching The Deep WebWitold Kozakiewicz
760 views23 slides
A brief history of home computer technology by
A brief history of home computer technologyA brief history of home computer technology
A brief history of home computer technologyvenusanderson225
484 views7 slides
Chapter2 computer by
Chapter2 computerChapter2 computer
Chapter2 computermerihan90
3.2K views66 slides
A4. What about other religions? by
A4. What about other religions?A4. What about other religions?
A4. What about other religions?Tony Watkins
482 views40 slides

More Related Content

Viewers also liked

E-COMMERCE: The Dark Web by
E-COMMERCE: The Dark Web E-COMMERCE: The Dark Web
E-COMMERCE: The Dark Web rardthebeast
632 views5 slides
Power Point Lesson 09 Part 2 by
Power Point Lesson 09 Part 2Power Point Lesson 09 Part 2
Power Point Lesson 09 Part 2Nasir Jumani
504 views13 slides
ICANN 51: DNS Risk Framework by
ICANN 51: DNS Risk FrameworkICANN 51: DNS Risk Framework
ICANN 51: DNS Risk FrameworkICANN
638 views23 slides
ICANN 51: Thick WHOIS Implementation (working session) by
ICANN 51: Thick WHOIS Implementation (working session)ICANN 51: Thick WHOIS Implementation (working session)
ICANN 51: Thick WHOIS Implementation (working session)ICANN
849 views36 slides
History of Computer by
History of ComputerHistory of Computer
History of Computerjordonestrada25
1.1K views12 slides
ICANN Rules vs Privacy by
ICANN Rules vs PrivacyICANN Rules vs Privacy
ICANN Rules vs PrivacyBlacknight
1.3K views42 slides

Viewers also liked(17)

E-COMMERCE: The Dark Web by rardthebeast
E-COMMERCE: The Dark Web E-COMMERCE: The Dark Web
E-COMMERCE: The Dark Web
rardthebeast632 views
Power Point Lesson 09 Part 2 by Nasir Jumani
Power Point Lesson 09 Part 2Power Point Lesson 09 Part 2
Power Point Lesson 09 Part 2
Nasir Jumani504 views
ICANN 51: DNS Risk Framework by ICANN
ICANN 51: DNS Risk FrameworkICANN 51: DNS Risk Framework
ICANN 51: DNS Risk Framework
ICANN638 views
ICANN 51: Thick WHOIS Implementation (working session) by ICANN
ICANN 51: Thick WHOIS Implementation (working session)ICANN 51: Thick WHOIS Implementation (working session)
ICANN 51: Thick WHOIS Implementation (working session)
ICANN849 views
ICANN Rules vs Privacy by Blacknight
ICANN Rules vs PrivacyICANN Rules vs Privacy
ICANN Rules vs Privacy
Blacknight1.3K views
Power Point Lesson 08 P2 by Nasir Jumani
Power Point Lesson 08 P2Power Point Lesson 08 P2
Power Point Lesson 08 P2
Nasir Jumani777 views
World Geography: Sample PowerPoint by Julia Hemmings
World Geography: Sample PowerPointWorld Geography: Sample PowerPoint
World Geography: Sample PowerPoint
Julia Hemmings538 views
Hiroshima i Nagasaki. 4t ESO. Ies Josep Tapiró. by Jaime P
Hiroshima i Nagasaki. 4t ESO. Ies Josep Tapiró.Hiroshima i Nagasaki. 4t ESO. Ies Josep Tapiró.
Hiroshima i Nagasaki. 4t ESO. Ies Josep Tapiró.
Jaime P366 views
Left, right or middle by Brent Heard
Left, right or middleLeft, right or middle
Left, right or middle
Brent Heard2.7K views
Ghassan Shahrour, The 70th anniversary of the atomic bombings at Hiroshima an... by Ghassan Shahrour
Ghassan Shahrour, The 70th anniversary of the atomic bombings at Hiroshima an...Ghassan Shahrour, The 70th anniversary of the atomic bombings at Hiroshima an...
Ghassan Shahrour, The 70th anniversary of the atomic bombings at Hiroshima an...
Ghassan Shahrour502 views
Introduction to network ( Internet and its layer) Or how internet really works! by Mohammad kermani
Introduction to network ( Internet and its layer) Or how internet really works!Introduction to network ( Internet and its layer) Or how internet really works!
Introduction to network ( Internet and its layer) Or how internet really works!
Mohammad kermani373 views
Inside The Computer by Nasir Jumani
Inside The ComputerInside The Computer
Inside The Computer
Nasir Jumani1.9K views
Introduction of Computer Network by chouhanankit03
Introduction of Computer NetworkIntroduction of Computer Network
Introduction of Computer Network
chouhanankit03539 views
Digging into the Deep Web by Wendy DeGroat
Digging into the Deep WebDigging into the Deep Web
Digging into the Deep Web
Wendy DeGroat2.1K views
Power Point Lesson 06 by Nasir Jumani
Power Point Lesson 06Power Point Lesson 06
Power Point Lesson 06
Nasir Jumani542 views

Similar to Setting standards-friendly web type

Web Typography5 090725053013 Phpapp02 by
Web Typography5 090725053013 Phpapp02Web Typography5 090725053013 Phpapp02
Web Typography5 090725053013 Phpapp02F Blanco
826 views252 slides
Beautiful Web Typography (#5) by
Beautiful Web Typography (#5)Beautiful Web Typography (#5)
Beautiful Web Typography (#5)Pascal Klein
86K views252 slides
Webfonts: Demystified by
Webfonts: DemystifiedWebfonts: Demystified
Webfonts: DemystifiedMel Choyce
10.2K views30 slides
New Web Typography by
New Web TypographyNew Web Typography
New Web TypographyMonotype
1.8K views40 slides
Fonts on the Web - a guide to web fonts by
Fonts on the Web - a guide to web fontsFonts on the Web - a guide to web fonts
Fonts on the Web - a guide to web fontsPrototype Interactive
2.1K views13 slides
Project Tools in Web Development by
Project Tools in Web DevelopmentProject Tools in Web Development
Project Tools in Web Developmentkmloomis
471 views127 slides

Similar to Setting standards-friendly web type(20)

Web Typography5 090725053013 Phpapp02 by F Blanco
Web Typography5 090725053013 Phpapp02Web Typography5 090725053013 Phpapp02
Web Typography5 090725053013 Phpapp02
F Blanco826 views
Beautiful Web Typography (#5) by Pascal Klein
Beautiful Web Typography (#5)Beautiful Web Typography (#5)
Beautiful Web Typography (#5)
Pascal Klein86K views
Webfonts: Demystified by Mel Choyce
Webfonts: DemystifiedWebfonts: Demystified
Webfonts: Demystified
Mel Choyce10.2K views
New Web Typography by Monotype
New Web TypographyNew Web Typography
New Web Typography
Monotype1.8K views
Project Tools in Web Development by kmloomis
Project Tools in Web DevelopmentProject Tools in Web Development
Project Tools in Web Development
kmloomis471 views
Intro by tsans
IntroIntro
Intro
tsans267 views
Web Standards And Protocols by Steven Cahill
Web Standards And ProtocolsWeb Standards And Protocols
Web Standards And Protocols
Steven Cahill5.6K views
Principles Of Web Design Workshop by Gavin Elliott
Principles Of Web Design WorkshopPrinciples Of Web Design Workshop
Principles Of Web Design Workshop
Gavin Elliott1.3K views
Designing for mobile devices by Fahd Alhazmi
Designing for mobile devicesDesigning for mobile devices
Designing for mobile devices
Fahd Alhazmi809 views
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps by Pablo Godel
Symfony Live NYC 2014 -  Rock Solid Deployment of Symfony AppsSymfony Live NYC 2014 -  Rock Solid Deployment of Symfony Apps
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
Pablo Godel2.6K views
Principles of web design by MR Z
Principles of web designPrinciples of web design
Principles of web design
MR Z262 views
Web accessibility with Ametys CMS by Ametys
Web accessibility with Ametys CMSWeb accessibility with Ametys CMS
Web accessibility with Ametys CMS
Ametys918 views
Extensis Web Typography Workshop | WebVisions Portland by Extensis
Extensis Web Typography Workshop | WebVisions PortlandExtensis Web Typography Workshop | WebVisions Portland
Extensis Web Typography Workshop | WebVisions Portland
Extensis797 views
Content Management & Web Analytics Theatre; Davin kluttz classy clowny or c... by TFM&A
Content Management & Web Analytics Theatre; Davin kluttz   classy clowny or c...Content Management & Web Analytics Theatre; Davin kluttz   classy clowny or c...
Content Management & Web Analytics Theatre; Davin kluttz classy clowny or c...
TFM&A950 views
Voice Applications with Adhearsion by Mojo Lingo
Voice Applications with AdhearsionVoice Applications with Adhearsion
Voice Applications with Adhearsion
Mojo Lingo400 views
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps by Pablo Godel
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony AppsSymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
Pablo Godel4.9K views

Recently uploaded

Presentation (1).pdf by
Presentation (1).pdfPresentation (1).pdf
Presentation (1).pdfhjksa
17 views5 slides
Figma Prototype A to Z.pdf by
Figma Prototype A to Z.pdfFigma Prototype A to Z.pdf
Figma Prototype A to Z.pdfAtiqur Rahaman
16 views30 slides
Designing Effective AR Experiences by
Designing Effective AR ExperiencesDesigning Effective AR Experiences
Designing Effective AR ExperiencesKumar Ahir
5 views46 slides
Menu.pdf by
Menu.pdfMenu.pdf
Menu.pdfnyhapedraza
8 views7 slides
StratPlanning Manual 220713.pdf by
StratPlanning Manual 220713.pdfStratPlanning Manual 220713.pdf
StratPlanning Manual 220713.pdfLakewalk Media
15 views43 slides
Scopic UX Design Test Task.pdf by
Scopic UX Design Test Task.pdfScopic UX Design Test Task.pdf
Scopic UX Design Test Task.pdfAtiqur Rahaman
283 views36 slides

Recently uploaded(20)

Presentation (1).pdf by hjksa
Presentation (1).pdfPresentation (1).pdf
Presentation (1).pdf
hjksa17 views
Designing Effective AR Experiences by Kumar Ahir
Designing Effective AR ExperiencesDesigning Effective AR Experiences
Designing Effective AR Experiences
Kumar Ahir5 views
StratPlanning Manual 220713.pdf by Lakewalk Media
StratPlanning Manual 220713.pdfStratPlanning Manual 220713.pdf
StratPlanning Manual 220713.pdf
Lakewalk Media15 views
Scopic UX Design Test Task.pdf by Atiqur Rahaman
Scopic UX Design Test Task.pdfScopic UX Design Test Task.pdf
Scopic UX Design Test Task.pdf
Atiqur Rahaman283 views
Design System in Figma A to Z.pdf by Atiqur Rahaman
Design System in Figma A to Z.pdfDesign System in Figma A to Z.pdf
Design System in Figma A to Z.pdf
Atiqur Rahaman18 views
SS25 Fashion Key Items trend book by Peclers Paris
SS25 Fashion Key Items trend bookSS25 Fashion Key Items trend book
SS25 Fashion Key Items trend book
Peclers Paris123 views
IEC 600068-2-39 ENVIROMENT TESTING COMBINED TEMPERATURE LOW HUMIDTY.pdf by NirmalanGanapathy1
IEC 600068-2-39 ENVIROMENT TESTING COMBINED TEMPERATURE LOW HUMIDTY.pdfIEC 600068-2-39 ENVIROMENT TESTING COMBINED TEMPERATURE LOW HUMIDTY.pdf
IEC 600068-2-39 ENVIROMENT TESTING COMBINED TEMPERATURE LOW HUMIDTY.pdf
Oregon Ducks 4 Spencer Webb Hoodie by brandshop1
Oregon Ducks 4 Spencer Webb HoodieOregon Ducks 4 Spencer Webb Hoodie
Oregon Ducks 4 Spencer Webb Hoodie
brandshop112 views
217 Drive - All on upper.pptx by vidstor282
217 Drive - All on upper.pptx217 Drive - All on upper.pptx
217 Drive - All on upper.pptx
vidstor28214 views
Sudden Deafness Design Document by wyfangherman
Sudden Deafness Design DocumentSudden Deafness Design Document
Sudden Deafness Design Document
wyfangherman38 views

Setting standards-friendly web type

  • 2. Setting standards- friendly web type ❦ The art of technological typography Simon Pascal Klein — @klepas
  • 4. Setting standards-friendly web type I’m… 1. one ‘of those’ BA students;
  • 5. Setting standards-friendly web type I’m… 1. one ‘of those’ BA students; 2. a graphic & web designer;
  • 6. Setting standards-friendly web type I’m… 1. one ‘of those’ BA students; 2. a graphic & web designer; 3. and, incurably, a rampant ‘typophile’.
  • 7. Setting standards-friendly web type ‘Typophiles’ are über gεεks who typography.
  • 8. Setting standards-friendly web type ‘Typophiles’ are über gεεks who typography. Hands up and make yourselves known.
  • 9. Setting standards-friendly web type ty•pog•ra•phy | tīˈpägrəfē | •n
  • 10. Setting standards-friendly web type ty•pog•ra•phy | tīˈpägrəfē | •n Typography is the art of creating and setting type with the purpose of honouring the text it sets.
  • 12. Setting standards-friendly web type 1 2 Getting a typeface on the web.
  • 13. Setting standards-friendly web type 1 2 Getting a typeface on the web. Setting that type all pretty.
  • 19. Setting standards-friendly web type premise: The internet is saturated; it’s info-heavy.
  • 20. Setting standards-friendly web type premise: The internet is saturated; it’s info-heavy. Much of it is textual.
  • 21. Setting standards-friendly web type premise: The internet is saturated; it’s info-heavy. Much of it is textual. Much of it is a pain to read.
  • 23. Setting standards-friendly web type Typography can bring aesthetic order to information, helping users read & navigate.
  • 25. Setting standards-friendly web type Renewed interest in Typography
  • 26. Setting standards-friendly web type Renewed interest in Typography • central to aesthetics;
  • 27. Setting standards-friendly web type Renewed interest in Typography • central to aesthetics; • central to accessibility, legibility, …;
  • 28. Setting standards-friendly web type Renewed interest in Typography • central to aesthetics; • central to accessibility, legibility, …; • many finer typesetting techniques are ‘new’ and admired for their ingenuity;
  • 29. Setting standards-friendly web type Renewed interest in Typography • central to aesthetics; • central to accessibility, legibility, …; • many finer typesetting techniques are ‘new’ and admired for their ingenuity; • growing availability of web fonts.
  • 31. Setting standards-friendly web type i.e. make textual stuff look pretty. ☻
  • 33. Setting standards-friendly web type Web experiences that feature good typography are easier and more pleasurable to use.
  • 35. Setting standards-friendly web type Assumptions?
  • 36. Setting standards-friendly web type Assumptions? It sucks? It’s boring?
  • 37. Setting standards-friendly web type Assumptions? It sucks? It’s boring? 1. Limited to sans-serif only for readability?
  • 38. Setting standards-friendly web type Assumptions? It sucks? It’s boring? 1. Limited to sans-serif only for readability? 2. Only ‘web-safe’ fonts?
  • 39. Setting standards-friendly web type Assumptions? It sucks? It’s boring? 1. Limited to sans-serif only for readability? 2. Only ‘web-safe’ fonts? 3. Limited control—gotta resort to Flash and other non-standard technologies?
  • 40. Setting standards-friendly web type Assumptions? It sucks? It’s boring? 1. Limited to sans-serif only for readability? 2. Only ‘web-safe’ fonts? 3. Limited control—gotta resort to Flash and other non-standard technologies? 4. So many options; how do I do it?
  • 43. Setting standards-friendly web type Not quite. (Yay!)
  • 45. Setting standards-friendly web type Possible problems & pitfalls
  • 46. Setting standards-friendly web type Possible problems & pitfalls • more fonts ≠ instant good typography;
  • 47. Setting standards-friendly web type Possible problems & pitfalls • more fonts ≠ instant good typography; • many of the new web fonts aren’t optimised or even designed for web use;
  • 48. Setting standards-friendly web type Possible problems & pitfalls • more fonts ≠ instant good typography; • many of the new web fonts aren’t optimised or even designed for web use; • growing availability of web fonts;
  • 49. Setting standards-friendly web type Possible problems & pitfalls • more fonts ≠ instant good typography; • many of the new web fonts aren’t optimised or even designed for web use; • growing availability of web fonts; • differences in implementation;
  • 50. Setting standards-friendly web type Possible problems & pitfalls • more fonts ≠ instant good typography; • many of the new web fonts aren’t optimised or even designed for web use; • growing availability of web fonts; • differences in implementation; • closed vs. open implementation struggle;
  • 51. Setting standards-friendly web type Possible problems & pitfalls • more fonts ≠ instant good typography; • many of the new web fonts aren’t optimised or even designed for web use; • growing availability of web fonts; • differences in implementation; • closed vs. open implementation struggle; • sub-setting and compression becomes your responsibility if not using a hosting service.
  • 54. Setting standards-friendly web type A: There are a range of typesetting options for the web that vary in technical complexity and stylistic versatility.
  • 55. Setting standards-friendly web type A: There are a range of typesetting options for the web that vary in technical complexity and stylistic versatility. They’re standards-based + you can use them now.
  • 56. Setting standards-friendly web type Options for setting fonts:
  • 57. Setting standards-friendly web type Options for setting fonts: 1. Installed fonts (mostly web-safe)
  • 58. Setting standards-friendly web type Options for setting fonts: 1. Installed fonts (mostly web-safe) 2. SIFR or other JS and Flash replacement
  • 59. Setting standards-friendly web type Options for setting fonts: 1. Installed fonts (mostly web-safe) 2. SIFR or other JS and Flash replacement 3. Cufón et al. (http://tinyurl.com/git-cufon)
  • 60. Setting standards-friendly web type Options for setting fonts: 1. Installed fonts (mostly web-safe) 2. SIFR or other JS and Flash replacement 3. Cufón et al. (http://tinyurl.com/git-cufon) 4. webfonts: EOT/EOT Lite via @font-face
  • 61. Setting standards-friendly web type Options for setting fonts: 1. Installed fonts (mostly web-safe) 2. SIFR or other JS and Flash replacement 3. Cufón et al. (http://tinyurl.com/git-cufon) 4. webfonts: EOT/EOT Lite via @font-face 5. webfonts: OT/TTF via @font-face
  • 62. Setting standards-friendly web type Options for setting fonts: 1. Installed fonts (mostly web-safe) 2. SIFR or other JS and Flash replacement 3. Cufón et al. (http://tinyurl.com/git-cufon) 4. webfonts: EOT/EOT Lite via @font-face 5. webfonts: OT/TTF via @font-face 6. webfonts: WOFF via @font-face
  • 63. Setting standards-friendly web type Options for setting fonts: 1. Installed fonts (mostly web-safe) 2. SIFR or other JS and Flash replacement 3. Cufón et al. (http://tinyurl.com/git-cufon) 4. webfonts: EOT/EOT Lite via @font-face 5. webfonts: OT/TTF via @font-face 6. webfonts: WOFF via @font-face 7. webfonts: SVG via @font-face
  • 64. Setting standards-friendly web type Options for setting fonts: 1. Installed fonts (mostly web-safe) 2. SIFR or other JS and Flash replacement 3. Cufón et al. (http://tinyurl.com/git-cufon) 4. webfonts: EOT/EOT Lite via @font-face 5. webfonts: OT/TTF via @font-face 6. webfonts: WOFF via @font-face 7. webfonts: SVG via @font-face 8. webfonts: hosting & licensing services
  • 65. Setting standards-friendly web type 1. Installed or web-safe fonts
  • 66. Setting standards-friendly web type 1. Installed or web-safe fonts Simply call upon them directly in your font stack declarations, e.g.:
  • 67. Setting standards-friendly web type 1. 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;
  • 68. Setting standards-friendly web type 1. 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; font-family: 'Helvetica Neue', Helvetica, 'Arial', sans-serif;
  • 70. Setting standards-friendly web type Font stacks:
  • 71. Setting standards-friendly web type Font stacks: • desired
  • 72. Setting standards-friendly web type Font stacks: • desired • fallback
  • 73. Setting standards-friendly web type Font stacks: • desired • fallback • generic (e.g. serif, sans-serif, monospace)
  • 74. Setting standards-friendly web type 2. sifr et al. Flash text replacement that in unison with JS replaces type using type from a Flash file.
  • 75. Setting standards-friendly web type 2. sifr et al. Flash text replacement that in unison with JS replaces type using type from a Flash file. Not a feasible solution long-term (i.e. don’t use):
  • 76. Setting standards-friendly web type 2. sifr et al. Flash text replacement that in unison with JS replaces type using type from a Flash file. Not a feasible solution long-term (i.e. don’t use): 1. does subsetting;
  • 77. Setting standards-friendly web type 2. sifr et al. Flash text replacement that in unison with JS replaces type using type from a Flash file. Not a feasible solution long-term (i.e. don’t use): 1. does subsetting; 2. non-standard: relies on both Flash and JS;
  • 78. Setting standards-friendly web type 2. sifr et al. Flash text replacement that in unison with JS replaces type using type from a Flash file. Not a feasible solution long-term (i.e. don’t use): 1. does subsetting; 2. non-standard: relies on both Flash and JS; 3. performance: high page load time—not feasible for body copy.
  • 79. Setting standards-friendly web type 3. Cufón & js 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.
  • 80. Setting standards-friendly web type 3. Cufón & js 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. Thoughts and concerns:
  • 81. Setting standards-friendly web type 3. Cufón & js 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. Thoughts and concerns: 1. not accessible but works in most browsers;
  • 82. Setting standards-friendly web type 3. Cufón & js 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. Thoughts and concerns: 1. not accessible but works in most browsers; 2. type foundries are sceptical—not a ‘service’; limited palette of typefaces;
  • 83. Setting standards-friendly web type 3. Cufón & js 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. Thoughts and concerns: 1. not accessible but works in most browsers; 2. type foundries are sceptical—not a ‘service’; limited palette of typefaces; 3. converter is often proprietary.
  • 84. Setting standards-friendly web type 4. webfonts: eot/eot 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’.
  • 85. Setting standards-friendly web type 4. webfonts: eot/eot 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’. Not feasible as-is currently:
  • 86. Setting standards-friendly web type 4. webfonts: eot/eot 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’. Not feasible as-is currently: 1. non-standard, proprietary solution;
  • 87. Setting standards-friendly web type 4. webfonts: eot/eot 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’. Not feasible as-is currently: 1. non-standard, proprietary solution; 2. requires a proprietary converter (WEFT) to use;
  • 88. Setting standards-friendly web type 4. webfonts: eot/eot 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’. Not feasible as-is currently: 1. non-standard, proprietary solution; 2. requires a proprietary converter (WEFT) to use; 3. proposal rejected by W 3C & only supported by IE.
  • 89. Setting standards-friendly web type 5. webfonts: ot/ttf 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.
  • 90. Setting standards-friendly web type 5. webfonts: ot/ttf 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. Feasible…:
  • 91. Setting standards-friendly web type 5. webfonts: ot/ttf 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. Feasible…: 1. OT/TTF files can easily be downloaded;
  • 92. Setting standards-friendly web type 5. webfonts: ot/ttf 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. Feasible…: 1. OT/TTF files can easily be downloaded; 2. support: Safari 3.1+, Firefox 3.5+, Opera 10+, Chrome 4+; IE9 dev, Android 2.2+;
  • 93. Setting standards-friendly web type 5. webfonts: ot/ttf 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. Feasible…: 1. OT/TTF files can easily be downloaded; 2. support: Safari 3.1+, Firefox 3.5+, Opera 10+, Chrome 4+; IE9 dev, Android 2.2+; 3. subsetting & compression comes down to author.
  • 95. Setting standards-friendly web type 6. webfonts: woff Works just as OT/TTF, linking directly via the src: declaration to a WOFF file (compressed font data + XML meta-data bundle, built using sfnt2woff).
  • 96. Setting standards-friendly web type 6. webfonts: woff Works just as OT/TTF, linking directly via the src: declaration to a WOFF file (compressed font data + XML meta-data bundle, built using sfnt2woff). Thoughts (besides being awesome):
  • 97. Setting standards-friendly web type 6. webfonts: woff Works just as OT/TTF, linking directly via the src: declaration to a WOFF file (compressed font data + XML meta-data bundle, built using sfnt2woff). Thoughts (besides being awesome): 1. CORS available via HTTP response headers;
  • 98. Setting standards-friendly web type 6. webfonts: woff Works just as OT/TTF, linking directly via the src: declaration to a WOFF file (compressed font data + XML meta-data bundle, built using sfnt2woff). Thoughts (besides being awesome): 1. CORS available via HTTP response headers; 2. the sfnt-font data can be extracted… effort?;
  • 99. Setting standards-friendly web type 6. webfonts: woff Works just as OT/TTF, linking directly via the src: declaration to a WOFF file (compressed font data + XML meta-data bundle, built using sfnt2woff). Thoughts (besides being awesome): 1. CORS available via HTTP response headers; 2. the sfnt-font data can be extracted… effort?; 3. support: Firefox 3.6+, WebKit, Chrome 5+, IE9 dev;
  • 100. Setting standards-friendly web type 6. webfonts: woff Works just as OT/TTF, linking directly via the src: declaration to a WOFF file (compressed font data + XML meta-data bundle, built using sfnt2woff). Thoughts (besides being awesome): 1. CORS available via HTTP response headers; 2. the sfnt-font data can be extracted… effort?; 3. support: Firefox 3.6+, WebKit, Chrome 5+, IE9 dev; 4. subsetting & compression comes down to author.
  • 101. Setting standards-friendly web type 7. webfonts: svg Works just as EOT and OT/TTF , instead linking directly via the src: declaration to an SVG file which is downloaded and used to render the type.
  • 102. Setting standards-friendly web type 7. webfonts: svg Works just as EOT and OT/TTF , instead linking directly via the src: declaration to an SVG file which is downloaded and used to render the type. Thoughts:
  • 103. Setting standards-friendly web type 7. webfonts: svg Works just as EOT and OT/TTF , instead linking directly via the src: declaration to an SVG file which is downloaded and used to render the type. Thoughts: 1. again, SVG files can easily be downloaded;
  • 104. Setting standards-friendly web type 7. webfonts: svg Works just as EOT and OT/TTF , instead linking directly via the src: declaration to an SVG file which is downloaded and used to render the type. Thoughts: 1. again, SVG files can easily be downloaded; 2. support: Firefox 3.5+ Chrome 0.3+, Opera 9+, iOS 1+, Safari 3.1+;
  • 105. Setting standards-friendly web type 7. webfonts: svg Works just as EOT and OT/TTF , instead linking directly via the src: declaration to an SVG file which is downloaded and used to render the type. Thoughts: 1. again, SVG files can easily be downloaded; 2. support: Firefox 3.5+ Chrome 0.3+, Opera 9+, iOS 1+, Safari 3.1+; 3. subsetting & compression comes down to author.
  • 107. Setting standards-friendly web type Web hosting & licensing services have sprung up offering a library of fonts at a variety of free and commercial plans (e.g. Typekit, Kernest, et al.).
  • 108. Setting standards-friendly web type 8. Hosting & licensing services Generally foundry initiatives that are JS-based (though not exclusively) and hosted, paid subscription models: select, pay, inject; done.
  • 109. Setting standards-friendly web type 8. Hosting & licensing services Generally foundry initiatives that are JS-based (though not exclusively) and hosted, paid subscription models: select, pay, inject; done. Thoughts:
  • 110. Setting standards-friendly web type 8. Hosting & licensing services Generally foundry initiatives that are JS-based (though not exclusively) and hosted, paid subscription models: select, pay, inject; done. Thoughts: 1. deemed ‘the solution’ and becoming such;
  • 111. Setting standards-friendly web type 8. Hosting & licensing services Generally foundry initiatives that are JS-based (though not exclusively) and hosted, paid subscription models: select, pay, inject; done. Thoughts: 1. deemed ‘the solution’ and becoming such; 2. standards-based, good browser support, and easy;
  • 112. Setting standards-friendly web type 8. Hosting & licensing services Generally foundry initiatives that are JS-based (though not exclusively) and hosted, paid subscription models: select, pay, inject; done. Thoughts: 1. deemed ‘the solution’ and becoming such; 2. standards-based, good browser support, and easy; 3. subsetting and/or compression service-side.
  • 128. Setting standards-friendly web type Using @font-face
  • 129. Setting standards-friendly web type Using @font-face 0. Reset
  • 130. Setting standards-friendly web type Using @font-face 0. Reset All the browsers have their own default styling for various (x)HTML elements. This makes it a pain for cross-browser consistency.
  • 131. Setting standards-friendly web type body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,in put,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.
  • 132. Setting standards-friendly web type ‘bullet-proof’ @font-face declarations
  • 133. Setting standards-friendly web type ‘bullet-proof’ @font-face declarations @font-face {
  • 134. Setting standards-friendly web type ‘bullet-proof’ @font-face declarations @font-face { font-family: "Your typeface";
  • 135. Setting standards-friendly web type ‘bullet-proof’ @font-face declarations @font-face { font-family: "Your typeface"; src: url("type/filename.eot");
  • 136. Setting standards-friendly web type ‘bullet-proof’ @font-face declarations @font-face { font-family: "Your typeface"; src: url("type/filename.eot"); src: local("Alt name"), local("Alt-name"),
  • 137. Setting standards-friendly web type ‘bullet-proof’ @font-face declarations @font-face { font-family: "Your typeface"; src: url("type/filename.eot"); src: local("Alt name"), local("Alt-name"), url("type/filename.woff") format("woff"),
  • 138. Setting standards-friendly web type ‘bullet-proof’ @font-face declarations @font-face { font-family: "Your typeface"; src: url("type/filename.eot"); src: local("Alt name"), local("Alt-name"), url("type/filename.woff") format("woff"), url("type/filename.otf") format("opentype"),
  • 139. Setting standards-friendly web type ‘bullet-proof’ @font-face declarations @font-face { font-family: "Your typeface"; src: url("type/filename.eot"); src: local("Alt name"), local("Alt-name"), url("type/filename.woff") format("woff"), url("type/filename.otf") format("opentype"), url("type/filename.svg#id") format("svg"); }
  • 140. Setting standards-friendly web type When using @font-face, we’re essentially dealing with separate font files of the same family for the various font styles, e.g., foobar-regular.otf, foobar- italic.otf, foobar-bold.otf, foobar-smallcaps.otf &c.
  • 141. Setting standards-friendly web type When using @font-face, we’re essentially dealing with separate font files of the same family for the various font styles, e.g., foobar-regular.otf, foobar- italic.otf, foobar-bold.otf, foobar-smallcaps.otf &c. This can become an issue—consider elements such as strong and em which are styled with setting the face in a bold and italic respectively.
  • 142. Setting standards-friendly web type When using @font-face, we’re essentially dealing with separate font files of the same family for the various font styles, e.g., foobar-regular.otf, foobar- italic.otf, foobar-bold.otf, foobar-smallcaps.otf &c. This can become an issue—consider elements such as strong and em which are styled with setting the face in a bold and italic respectively. If we declare the italic via @font-face (as we would to get the style into our design) what will happen is that the italic is digitally italicised (fake italics) by the font rendering engine. Result?
  • 144. Setting standards-friendly web type If we avoid or overwrite the various declarations (e.g. em { font-style: normal;}) and for whatever reason our desired @font-face font isn’t available, we rob other fonts in the font- stack of their styling.
  • 145. Setting standards-friendly web type We overcome both these issues by setting the font styles within the @font-face declaration: @font-face { font-family: "Your italic typeface"; src: url("type/filename.eot"); src: local("Alt italic name"), local("Alt-italic-name"), url("type/filename-italic.woff") format("woff"), url("type/filename-italic.otf") format("opentype"), url("type/filename-italic.svg#id") format("svg"); }
  • 146. Setting standards-friendly web type We overcome both these issues by setting the font styles within the @font-face declaration: @font-face { font-family: "Your italic typeface"; src: url("type/filename.eot"); src: local("Alt italic name"), local("Alt-italic-name"), url("type/filename-italic.woff") format("woff"), url("type/filename-italic.otf") format("opentype"), url("type/filename-italic.svg#id") format("svg"); }
  • 147. Setting standards-friendly web type We overcome both these issues by setting the font styles within the @font-face declaration: @font-face { font-family: "Your italic typeface"; font-style: italic; src: url("type/filename.eot"); src: local("Alt italic name"), local("Alt-italic-name"), url("type/filename-italic.woff") format("woff"), url("type/filename-italic.otf") format("opentype"), url("type/filename-italic.svg#id") format("svg"); }
  • 148. Setting standards-friendly web type Why are they two entries for local in src? src: local("Alt italic name"), local("Alt-italic-name"), Some browsers refer to the fonts using their PostScript names.
  • 149. Setting standards-friendly web type Finding it in Font Book under Mac OS X:
  • 150. Setting standards-friendly web type There is a free downloadable Font properties extension for Windows. Once installed right-click → Properties on a font file and click on the Names tab to see the name details.
  • 151. Setting standards-friendly web type There is a free downloadable Font properties extension for Windows. Once installed right-click → Properties on a font file and click on the Names tab to see the name details. See: http://bit.ly/ms-font-prop.
  • 152. Setting standards-friendly web type There is a free downloadable Font properties extension for Windows. Once installed right-click → Properties on a font file and click on the Names tab to see the name details. See: http://bit.ly/ms-font-prop. There are similar tools on the free desktops.
  • 154. Setting standards-friendly web type When using @font-face for self-hosted fonts, we need to subset and compress ourselves.
  • 155. Setting standards-friendly web type When using @font-face for self-hosted fonts, we need to subset and compress ourselves. Subsetting allows us to remove knowingly unused glyphs from the font file, thus cutting down file size. E.g. if we know we won’t ever need Greek characters we can remove them reducing the font file’s size, thus lowering page size.
  • 156. Setting standards-friendly web type When using @font-face for self-hosted fonts, we need to subset and compress ourselves. Subsetting allows us to remove knowingly unused glyphs from the font file, thus cutting down file size. E.g. if we know we won’t ever need Greek characters we can remove them reducing the font file’s size, thus lowering page size. Subsetting is can be done in a font editor—I suggest FontForge (FOSS)—open your font, select unused character blocks and delete them; save.
  • 158. Setting standards-friendly web type Save yourself a headache—skip using the WEFT converter and instead use ttf2eot. Why?
  • 159. Setting standards-friendly web type Save yourself a headache—skip using the WEFT converter and instead use ttf2eot. Why? 1. WEFT will use Monotype’s proprietary compression algorithm and gzip is better;
  • 160. Setting standards-friendly web type Save yourself a headache—skip using the WEFT converter and instead use ttf2eot. Why? 1. WEFT will use Monotype’s proprietary compression algorithm and gzip is better; 2. WEFT only works on Windows XP(?);
  • 161. Setting standards-friendly web type Save yourself a headache—skip using the WEFT converter and instead use ttf2eot. Why? 1. WEFT will use Monotype’s proprietary compression algorithm and gzip is better; 2. WEFT only works on Windows XP(?); 3. tff2eot doesn’t compress—use gzip server-side.
  • 162. Setting standards-friendly web type Save yourself a headache—skip using the WEFT converter and instead use ttf2eot. Why? 1. WEFT will use Monotype’s proprietary compression algorithm and gzip is better; 2. WEFT only works on Windows XP(?); 3. tff2eot doesn’t compress—use gzip server-side. There are online front ends to ttf2eot/sfnt2woff:
  • 163. Setting standards-friendly web type Save yourself a headache—skip using the WEFT converter and instead use ttf2eot. Why? 1. WEFT will use Monotype’s proprietary compression algorithm and gzip is better; 2. WEFT only works on Windows XP(?); 3. tff2eot doesn’t compress—use gzip server-side. There are online front ends to ttf2eot/sfnt2woff: • http://ttf2eot.sebastiankippe.com/
  • 164. Setting standards-friendly web type Save yourself a headache—skip using the WEFT converter and instead use ttf2eot. Why? 1. WEFT will use Monotype’s proprietary compression algorithm and gzip is better; 2. WEFT only works on Windows XP(?); 3. tff2eot doesn’t compress—use gzip server-side. There are online front ends to ttf2eot/sfnt2woff: • http://ttf2eot.sebastiankippe.com/ • http://fontsquirrel.com/fontface/generator
  • 166. Setting standards-friendly web type For compression, let’s gzip (via .htaccess):
  • 167. Setting standards-friendly web type For compression, let’s gzip (via .htaccess): # gzips content if possible <IfModule mod_gzip.c> mod_gzip_on Yes mod_gzip_dechunk Yes mod_gzip_item_include file .(html?|css|js|...|otf|eot)$ mod_gzip_item_include handler ^cgi-script$ ... mod_gzip_item_include mime ^application/vnd.ms-fontobject$ </IfModule>
  • 168. Setting standards-friendly web type For compression, let’s gzip (via .htaccess): # gzips content if possible <IfModule mod_gzip.c> mod_gzip_on Yes mod_gzip_dechunk Yes mod_gzip_item_include file .(html?|css|js|...|otf|eot)$ mod_gzip_item_include handler ^cgi-script$ ... mod_gzip_item_include mime ^application/vnd.ms-fontobject$ </IfModule>
  • 169. Setting standards-friendly web type For compression, let’s gzip (via .htaccess): # gzips content if possible <IfModule mod_gzip.c> mod_gzip_on Yes mod_gzip_dechunk Yes mod_gzip_item_include file .(html?|css|js|...|otf|eot)$ mod_gzip_item_include handler ^cgi-script$ ... mod_gzip_item_include mime ^application/vnd.ms-fontobject$ </IfModule>
  • 170. Setting standards-friendly web type For compression, let’s gzip (via .htaccess): # gzips content if possible <IfModule mod_gzip.c> mod_gzip_on Yes mod_gzip_dechunk Yes mod_gzip_item_include file .(html?|css|js|...|otf|eot)$ mod_gzip_item_include handler ^cgi-script$ ... mod_gzip_item_include mime ^application/vnd.ms-fontobject$ </IfModule>
  • 171. Setting standards-friendly web type For compression, let’s gzip (via .htaccess): # gzips content if possible <IfModule mod_gzip.c> mod_gzip_on Yes mod_gzip_dechunk Yes mod_gzip_item_include file .(html?|css|js|...|otf|eot)$ mod_gzip_item_include handler ^cgi-script$ ... mod_gzip_item_include mime ^application/vnd.ms-fontobject$ </IfModule> Don’t be surprised to see reductions of 40–50%.
  • 172. Setting standards-friendly web type While we’re at it, let’s cache the font assets too:
  • 173. Setting standards-friendly web type While we’re at it, let’s cache the font assets too: # Cache following file types for one month <FilesMatch ".(js|jpeg|jpg|...|otf|eot)$"> Header set Cache-Control "max-age=2592000" </FilesMatch>
  • 174. Setting standards-friendly web type While we’re at it, let’s cache the font assets too: # Cache following file types for one month <FilesMatch ".(js|jpeg|jpg|...|otf|eot)$"> Header set Cache-Control "max-age=2592000" </FilesMatch>
  • 175. Setting standards-friendly web type Finding fonts…?
  • 176. Setting standards-friendly web type Finding fonts…? • http://openfontlibrary.org/
  • 177. Setting standards-friendly web type Finding fonts…? • http://openfontlibrary.org/ • http://www.theleagueofmoveabletype.com/
  • 178. Setting standards-friendly web type Finding fonts…? • http://openfontlibrary.org/ • http://www.theleagueofmoveabletype.com/ • http://www.fontsquirrel.com/fontface
  • 179. Setting standards-friendly web type Finding fonts…? • http://openfontlibrary.org/ • http://www.theleagueofmoveabletype.com/ • http://www.fontsquirrel.com/fontface • list on webfonts.info: http://bit.ly/16Qid4
  • 182. Setting standards-friendly web type Meanwhile:
  • 183. Setting standards-friendly web type Meanwhile: Webfonts aren’t the holy grail of web typography problems…
  • 184. Setting standards-friendly web type Meanwhile: Webfonts aren’t the holy grail of web typography problems… “Typography is not picking a ‘cool’ font.” – Jeff Croft
  • 185. Setting standards-friendly web type Also remember, most fonts available from type foundries are not optimised for screen usage; they’re for print.
  • 187. Setting standards-friendly web type So… now having selected our desired typeface (via webfonts or otherwise), let’s make it pretty.
  • 190. Setting standards-friendly web type serif sans serif
  • 191. Setting standards-friendly web type serif sans serif script
  • 192. Setting standards-friendly web type serif sans serif script blackletter
  • 193. Setting standards-friendly web type serif sans serif script blackletter monospace
  • 195. Setting standards-friendly web type Arial Verdana Courier New Times New Roman Georgia Trebuchet MS
  • 197. Setting standards-friendly web type 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.:
  • 198. Setting standards-friendly web type 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.: 1. one sets the body, the other the headings;
  • 199. Setting standards-friendly web type 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.: 1. one sets the body, the other the headings; 2. one sets primary content, the other UI controls.
  • 200. Setting standards-friendly web type 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.: 1. one sets the body, the other the headings; 2. one sets primary content, the other UI controls. We do this with the font-family property.
  • 202. Setting standards-friendly web type Use a combination of families, styles, and weights to breath some fresh air into your web type.
  • 203. Setting standards-friendly web type Use a combination of families, styles, and weights to breath some fresh air into your web type. • font-weight controls weight and accepts numerical and descriptive (e.g. normal) values.
  • 204. Setting standards-friendly web type Use a combination of families, styles, and weights 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).
  • 205. Setting standards-friendly web type Use a combination of families, styles, and weights 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.
  • 207. Setting standards-friendly web type roman (‘normal’)
  • 208. Setting standards-friendly web type roman (‘normal’)
  • 209. Setting standards-friendly web type roman (‘normal’) italic
  • 210. Setting standards-friendly web type roman (‘normal’) italic ≠ oblique
  • 211. Setting standards-friendly web type roman (‘normal’) italic ≠ oblique
  • 212. Setting standards-friendly web type roman (‘normal’) italic ≠ oblique
  • 213. Setting standards-friendly web type roman (‘normal’) italic ≠ oblique ultralight regular bold
  • 214. Setting standards-friendly web type roman (‘normal’) italic ≠ oblique ultralight regular bold
  • 215. Setting standards-friendly web type roman (‘normal’) italic ≠ oblique ultralight regular bold & bold italic condensed
  • 216. Setting standards-friendly web type roman (‘normal’) italic ≠ oblique ultralight regular bold & bold italic condensed
  • 217. Setting standards-friendly web type roman (‘normal’) italic ≠ oblique ultralight regular bold & bold italic condensed S MALL - CAPITALS
  • 218. Setting standards-friendly web type roman (‘normal’) italic ≠ oblique ultralight regular bold & bold italic condensed S MALL - CAPITALS
  • 221. Setting standards-friendly web type Tracking Tracking
  • 222. Setting standards-friendly web type Tracking Tracking Letter-spacing
  • 223. Setting standards-friendly web type Tracking Tracking Letter-spacing Letter-spacing
  • 225. Setting standards-friendly web type Letʼs see some loose word- spacing in action…
  • 226. Setting standards-friendly web type Letʼs see some loose word- spacing in action… And now both loose word-spacing and tracking featured together.
  • 228. Setting standards-friendly web type And finally, the recently popular trend of negative tracking.
  • 230. Setting standards-friendly web type Tracking and word-spacing can help differentiate, aiding readability by removing disruption.
  • 231. Setting standards-friendly web type Tracking and word-spacing can help differentiate, aiding readability by removing disruption. E.g. setting acronyms or numerical tabular data.
  • 233. Setting standards-friendly web type Full-capital acronyms, along with other full-cap- sized glyphs can disturb the flow of the text:
  • 234. Setting standards-friendly web type 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; ac habitant orci tristique senectus et 4,962 malesuada fames egestas HTML sit lectus.
  • 235. Setting standards-friendly web type 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; ac habitant orci tristique senectus et 4,962 malesuada fames egestas HTML sit lectus.
  • 236. Setting standards-friendly web type 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; ac habitant orci tristique senectus et 4,962 malesuada fames egestas HTML sit lectus. Lorem ipsum dolor sit amet, nasa consectetur adipiscing et. Vestibulum elit pellentesque; ac habitant orci tristique senectus et 4,962 malesuada fames egestas html sit lectus.
  • 237. Setting standards-friendly web type 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; ac habitant orci tristique senectus et 4,962 malesuada fames egestas HTML sit lectus. Lorem ipsum dolor sit amet, nasa consectetur adipiscing et. Vestibulum elit pellentesque; ac habitant orci tristique senectus et 4,962 malesuada fames egestas html sit lectus.
  • 239. Setting standards-friendly web type • letter-spacing and word-spacing controls tracking and word-spacing respectively. Both take numerical values and normal.
  • 240. Setting standards-friendly web type • 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.
  • 242. Setting standards-friendly web type • font-size controls… font sizes. Takes numerical and descriptive values. Most user agents (e.g. browsers) set default value at 16px.
  • 243. Setting standards-friendly web type • font-size controls… font sizes. Takes numerical and descriptive values. Most user agents (e.g. browsers) set default value at 16px. Size font sizes relatively using ems or %.
  • 244. Setting standards-friendly web type • font-size controls… font sizes. Takes numerical and descriptive values. Most user agents (e.g. 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).
  • 246. Setting standards-friendly web type Why? • Some UAs don’t support font-resizing (Ctrl + +/-) or page scaling when measurements are defined in absolute terms.
  • 247. Setting standards-friendly web type Why? • 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.
  • 248. Setting standards-friendly web type Why? • 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.
  • 250. Setting standards-friendly web type Key: remember font sizes are inherited: parents → children.
  • 251. Setting standards-friendly web type 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):
  • 252. Setting standards-friendly web type 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): 1 ÷ parent font-size × required pixel value = em value
  • 253. Setting standards-friendly web type 62.5% trick
  • 254. Setting standards-friendly web type 62.5% trick Simplify your calculations. Consider: p { font-size: 80%; } blockquote { font-size: 80%; }
  • 255. Setting standards-friendly web type 62.5% trick Simplify your calculations. Consider: p { font-size: 80%; } blockquote { font-size: 80%; } 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.
  • 256. Setting standards-friendly web type 62.5% trick (cont’d) In 2004 Richard Rutter wrote an article outlining a trick he used to make these calculations simpler:
  • 257. Setting standards-friendly web type 62.5% trick (cont’d) In 2004 Richard Rutter wrote an article outlining a trick he used to make these calculations simpler: • browsers have common default size of 16px; thus:
  • 258. Setting standards-friendly web type 62.5% trick (cont’d) In 2004 Richard Rutter wrote an article outlining a trick he used to make these calculations simpler: • browsers have common default size of 16px; thus: • set body to 62.5% and reset all to 10px; thus:
  • 259. Setting standards-friendly web type 62.5% trick (cont’d) In 2004 Richard Rutter wrote an article outlining a trick he used to make these calculations simpler: • 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.
  • 261. Setting standards-friendly web type To find an element’s font size in absolute terms (e.g. pixels) you can use the Firefox ‘Web Developer’ plugin: Information → Display Element Information.
  • 262. Setting standards-friendly web type Mixing typefaces requires special attention. Try to align x-heights and sizes. X-heights? x-height x-height Helvetica Regular 96pt & Dolly Regular 96pt.
  • 263. Setting standards-friendly web type Mixing typefaces requires special attention. Try to align x-heights and sizes. X-heights? x-height x-height Helvetica Regular 96pt & Dolly Regular 96pt. x-height x-height Helvetica Regular 96pt & Dolly Regular 108pt.
  • 264. Setting standards-friendly web type Stick it to a scale Don’t just arbitrarily set type; use a scale:
  • 265. Setting standards-friendly web type Stick it to a scale Don’t just arbitrarily set type; use 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, another scale 14, 18, 24, 36, 48, 64, 72, 96. 8, 13, 21, 34, 55, scale based on the Fibonacci sequence 89.
  • 267. Setting standards-friendly web type At small sizes font-decoration: underline; can render descender glyphs (g, j, p, q, y) difficult to read: use border-bottom: 1px solid;
  • 268. Setting standards-friendly web type 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…
  • 269. Setting standards-friendly web type 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…
  • 270. Setting standards-friendly web type Correct glyphs Consider: ' "
  • 271. Setting standards-friendly web type Correct glyphs Consider: 1'61" ' "
  • 272. Setting standards-friendly web type "This is a group of words surrounded by a bunch of tick marks."
  • 273. Setting standards-friendly web type “This is a quotation!” - Jeff Croft
  • 274. Setting standards-friendly web type ‘’ “” ’
  • 276. Setting standards-friendly web type - hyphen Mary-Anne, Walter-Strauss – en dash April–May, ages 3–5, pp. 37–38 — em dash Phrase marker—(generally) not spaced—like so. – minus 5–4=1
  • 277. Setting standards-friendly web type “ opening double quote &ldquo; ” closing double quote &rdquo; ‘ opening single quote &lsquo; ’ closing single quote &rsquo; – en dash &ndash; — em dash &mdash; − minus &minus; × multiplication &times; … ellipsis &hellip;
  • 278. Setting standards-friendly web type Smartypants et al.
  • 279. Setting standards-friendly web type Smartypants et al. ‘Doing something repetitively? Likely you’re doing it wrong.’
  • 280. Setting standards-friendly web type Smartypants et al. ‘Doing something repetitively? Likely you’re doing it wrong.’ Smartypants et al. are parsers that translate plain ASCII characters into “smart” typographic (x)HTML entities (and beyond just punctuation).
  • 281. Setting standards-friendly web type Smartypants et al. ‘Doing something repetitively? Likely you’re doing it wrong.’ Smartypants et al. are parsers that translate plain ASCII characters into “smart” typographic (x)HTML entities (and beyond just punctuation). • Smartypants (PHP, Perl, & Movable Type);
  • 282. Setting standards-friendly web type Smartypants et al. ‘Doing something repetitively? Likely you’re doing it wrong.’ Smartypants et al. are parsers that translate plain ASCII characters into “smart” typographic (x)HTML entities (and beyond just punctuation). • Smartypants (PHP, Perl, & Movable Type); • Typogrify (Python/Django);
  • 283. Setting standards-friendly web type Smartypants et al. ‘Doing something repetitively? Likely you’re doing it wrong.’ Smartypants et al. are parsers that translate plain ASCII characters into “smart” typographic (x)HTML entities (and beyond just punctuation). • Smartypants (PHP, Perl, & Movable Type); • Typogrify (Python/Django); • wp-Typography (WordPress);
  • 284. Setting standards-friendly web type Smartypants et al. ‘Doing something repetitively? Likely you’re doing it wrong.’ Smartypants et al. are parsers that translate plain ASCII characters into “smart” typographic (x)HTML entities (and beyond just punctuation). • Smartypants (PHP, Perl, & Movable Type); • Typogrify (Python/Django); • wp-Typography (WordPress); • Markdown, Textile et al., …
  • 286. Setting standards-friendly web type Give ampersands love
  • 287. Setting standards-friendly web type Give ampersands love Italic ampersand variants are often much prettier than their common roman counterparts:
  • 288. Setting standards-friendly web type Give ampersands love Italic ampersand variants are often much prettier than their common roman counterparts: &&&&&&
  • 289. Setting standards-friendly web type Give ampersands love Italic ampersand variants are often much prettier than their common roman counterparts: &&&&&& &&&&&&
  • 290. Setting standards-friendly web type Marking paragraphs (and more)
  • 291. Setting standards-friendly web type Marking paragraphs (and more) Don’t be afraid to mark new paragraphs with indents, outdents, white-lines, a pilcrow (¶) or other ornament (e.g. ❦), versals, headers &c.
  • 292. Setting standards-friendly web type Marking paragraphs (and more) Don’t be afraid to mark new paragraphs with indents, outdents, white-lines, a pilcrow (¶) or other ornament (e.g. ❦), versals, headers &c. …or a combination thereof.
  • 293. Setting standards-friendly web type Marking paragraphs (and more) Don’t be afraid to mark new paragraphs with indents, outdents, white-lines, a pilcrow (¶) or other ornament (e.g. ❦), versals, headers &c. …or a combination thereof. See: http://tinyurl.com/para-typography.
  • 294. Setting standards-friendly web type Measures The 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.
  • 295. Setting standards-friendly web type Measures The 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.
  • 296. Setting standards-friendly web type Measures (cont’d)
  • 297. Setting standards-friendly web type 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.
  • 298. Setting standards-friendly web type 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.
  • 299. Setting standards-friendly web type Leading (line-height)
  • 300. Setting standards-friendly web type 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);
  • 301. Setting standards-friendly web type 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. ☺
  • 302. Setting standards-friendly web type 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. ☺
  • 303. Setting standards-friendly web type Hanging punctuation Traditionally punctuation marks, bullets, lists, hyphens, and brackets all hang in the margin.
  • 304. Setting standards-friendly web type Hanging punctuation Traditionally 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. Etiam mollis vulputate ( lorem nullam turpis non massa rhoncus sodales.)”
  • 305. Setting standards-friendly web type Hanging punctuation Traditionally 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. Etiam mollis vulputate ( lorem nullam turpis non massa rhoncus sodales.)”
  • 306. Setting standards-friendly web type Hanging punctuation (cont’d) Simply with lists by setting their margins to zero.
  • 307. Setting standards-friendly web type 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. CSS 3 will hopefully support hanging punctuation with a proposed hanging-punctuation property.
  • 308. Setting standards-friendly web type 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. CSS 3 will hopefully support hanging punctuation with a proposed hanging-punctuation property. See: http://tinyurl.com/w3c-hanging-punct.
  • 309. Setting standards-friendly web type 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).
  • 310. Setting standards-friendly web type 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 a tad smaller) and with different typefaces or font styles.
  • 314. Setting standards-friendly web type Page (grid)
  • 315. Setting standards-friendly web type Page (grid) Grids bring order to your page and help specify where things should go.
  • 316. Setting standards-friendly web type Page (grid) 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.
  • 317. Setting standards-friendly web type Page (grid) 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).
  • 320. Setting standards-friendly web type Btw: http://gridulator.com.
  • 323. Setting standards-friendly web type Addendum Please don’t use Comic Sans unless you have a very, very good reason.
  • 325. Setting standards-friendly web type Inspirational typophiles • Cameron Moll: cameronmoll.com • Jeff Croft: jeffcroft.com • Jeffrey Zeldman: zeldman.com • Mark Boulton: markboulton.co.uk • Richard Rutter: clagnut.com • Jon Tan: jontangerine.com
  • 326. Setting standards-friendly web type Resources & reading • http://webtypography.net • http://alistapart.com/topics/design/typography • http://usabletype.org • http://ilovetypography.com • http://www.papress.com/other/thinkingwithtype/
  • 327. Thanks! klepas@klepas.org klepas.org @klepas Licensed CC BY -NC-ND http://creativecommons.org/licenses/by-nc-nd/2.5/au/