Presented at WriteTheDocs Europe, 31st Mar 2014. Presented at Djangocon EU, 14th May 2014
typographyand thewebthe state of the art#writethedocs eu 2014
View Slide
Idan GazitHello there! I’m@idangazitPlease,Sit back.Relax.Enjoy yourself!!All of the slides will be online.
core designer forvisualizing data ata lovely web frameworkthe popular platform-as-a-service
commons.wikimedia.org/wiki/File:Lateral_head_angiogram.jpg
Daniel KahnemanThe general principle is that anything you can do toreduce cognitive strain will help you [be persuasive],so you should first maximize legibility.
typographySET AtypefacesSET
Presenting Textual InformationTheArt&Scienceof
vstypefacekerningmacromicromeasure (aka “width”)leading (aka “spacing”)flow of type on pageelupton.com/2009/10/science-of-typography/
223
http://retinart.net/graphic-design/secret-law-of-page-harmony/
LIKE, NEW INFORMATIONHAS COME TO LIGHT, MAN
control
nonenilnadazerozipzilchnothingnaughtnonocontrol
@idangazitHI THERE, I’Mflic.kr/p/6iLEF
@idangazitHI THERE, I’Mflic.kr/p/89Utsr
printwebMarch of ProgressIN WEB TYPOGRAPHYTHE
Sometimes hard to use.Pays dividends.
Sizing Type
?ABSOLUTE?RELATIVE
16pxABSOLUTE1em or 100%RELATIVE
16pxABSOLUTE1em or 100%RELATIVE=
The quick brown fox jumps over a lazy dog.The quick brown fox jumps over a lazy dog.TIMESGEORGIAM“1 EM”
∅ defaults to 1em 1.2em 3em 1.5em5.4em (1 × 1.2 × 3 × 1.5)or 86.4px (5.4em × 16px/1em)=
That wasn’t too badRIGHT?
pop quiz!OK, DOCUMENTARIANS
body { font-size: 1em; }header { font-size: 1.5em; }article { font-size: 1em; }??h1 { font-size: 2em; }
body { font-size: 1em; }header { font-size: 1.5em; }article { font-size: 1em; }1em × 1.5em × 2em = 3em?h1 { font-size: 2em; }
body { font-size: 1em; }header { font-size: 1.5em; }article { font-size: 1em; }1em × 1.5em × 2em = 3em1em × 1em × 2em = 2emh1 { font-size: 2em; }
Root Ems“REMS”(to the rescue!)
EMS1em1em2em2em1.5em1.5em1.5em1.5remREMS
REMS9+github.com/chuckcarpenter/REM-unit-polyfill
Sometimes you want the cascade.Sometimes you don’t.
Foo & Bar.amp { font-family: SomeFancyFont, sans; }BarFoo&
font-family: Helvetica, Arial, sans-serif;La la la A’BC םולש abc123 ⊗≄∭∑ὐ
DATABASEaofFONTS
@font-face {family-namesrcunicode-rangefont-variantfont-feature-settingsfont-stretchfont-weightfont-style}!“FooBar”local(…), url(…)U+41-5A, U+C0-FF!!same as font-* rules!!
@font-face {font-family: Alef;src: url(AlefNormal.woff);font-weight: normal;unicode-range: U+590-5FF; /* Hebrew! */}!/* Use Alef font only for Hebrew */p { font-face: Alef, Times, serif;}Unicoderanges
@font-face {font-family: MathFont;src: url(MathFont.woff);font-weight: normal;unicode-range: U+1D6B0-1D71B; /* math */}!/* Consistent math symbols */p { font-face: MathFont, Times, serif;}Unicoderanges
COOL, HUH?
CAREFUL.
@font-face {font-family: FooBar;src: url(FooBarNormal.woff);font-weight: normal;}!p {font-face: FooBar;font-weight: bold}Faux-Boldalistapart.com/article/say-no-to-faux-boldFaux-Italic
FOUTthe dreadedFlashOfUnstyledText
FOUTthe dreadedFlashOfUnstyledTextFONTthe somewhat-betterFlashOfNoText
2s FOUT 2s FONT
3s FONT, 1s FOUT 4s FONTSoon (~v35ish) Now (v33)>3 seconds
Adobe Blankblogs.adobe.com/typblography/2013/03/introducing-adobe-blank.htmlfont-family: “My Custom Font”, “Adobe Blank”, sans-serif;
IE9 Data-URIfettblog.eu/blog/2012/11/16/preventing-fout-on-ie9/@font-face {font-family: somefont;src: url(“data:application/x-font-woff;base64,AS8796ADS…”)}
Cache aggressivelyDon’t make users download the font more than once
CSS3 Font Loadinghttp://dev.w3.org/csswg/css-font-loading/
flic.kr/p/auuCWk
Type Rendering
RASTERIZERS
OSX WINDOWS GDI WIN DIRECTWRITECLEARTYPEGRAYSCALE
FONT OUTLINESPOSTSCRIPT, TRUETYPE
POSTSCRIPT TRUETYPEIE 6-8IE 6-8on Windows XPIE 9+FIREFOXCHROMEOPERAnope.nope.DirectWriteDirectWriteGDI GrayscaleGDI GrayscaleGDI GrayscaleGDI ClearTypeDirectWriteDirectWriteGDI ClearTypeGDI ClearTypeHTTP://WWW.SMASHINGMAGAZINE.COM/2012/04/24/A-CLOSER-LOOK-AT-FONT-RENDERING/
TEST YOUR INTENDED TYPEFACES.TEST THEM EVERYWHERE TO BE SAFE.
ENOUGH OF THIS DOOM AND GLOOM.TELL ME ABOUT MORE AWESOME STUFF.
LigaturesLigat
The Four Numerals
in 1956 I bought…in 1956 I bought…OLDSTYLELININGFIGURES
PROPORTIONALTABULAR$131.96$589.22$131.96$589.22FIGURES
.ligatures {font-feature-settings: “liga”;}!.lining-numerals {font-feature-settings: “lnum”;}!.tabular-numerals {font-feature-settings: “tnum”;}Featuretag-value
font-feature-settings10+docs.webplatform.org/wiki/css/properties/font-feature-settings
whew.NOW YOU KNOW KUNG FU
IS OUR FUTURE BETTER?
CANIUSE.COMCAN I USE … ?
GO MAKE STUFF.BETTER.
@IDANGAZITDon’t be shy.Thank you!