maruku 0.6.1 → 0.7.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (263) hide show
  1. checksums.yaml +7 -0
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/MIT-LICENSE.txt +20 -0
  5. data/bin/maruku +153 -152
  6. data/bin/marutex +2 -29
  7. data/data/entities.xml +261 -0
  8. data/docs/math.md +14 -18
  9. data/lib/maruku.rb +65 -77
  10. data/lib/maruku/attributes.rb +109 -214
  11. data/lib/maruku/defaults.rb +45 -67
  12. data/lib/maruku/document.rb +43 -0
  13. data/lib/maruku/element.rb +112 -0
  14. data/lib/maruku/errors.rb +71 -0
  15. data/lib/maruku/ext/div.rb +105 -113
  16. data/lib/maruku/ext/fenced_code.rb +97 -0
  17. data/lib/maruku/ext/math.rb +22 -26
  18. data/lib/maruku/ext/math/elements.rb +20 -26
  19. data/lib/maruku/ext/math/mathml_engines/blahtex.rb +92 -104
  20. data/lib/maruku/ext/math/mathml_engines/itex2mml.rb +33 -26
  21. data/lib/maruku/ext/math/mathml_engines/none.rb +11 -19
  22. data/lib/maruku/ext/math/mathml_engines/ritex.rb +2 -4
  23. data/lib/maruku/ext/math/parsing.rb +107 -113
  24. data/lib/maruku/ext/math/to_html.rb +184 -187
  25. data/lib/maruku/ext/math/to_latex.rb +30 -21
  26. data/lib/maruku/helpers.rb +158 -257
  27. data/lib/maruku/html.rb +254 -0
  28. data/lib/maruku/input/charsource.rb +272 -319
  29. data/lib/maruku/input/extensions.rb +62 -63
  30. data/lib/maruku/input/html_helper.rb +220 -189
  31. data/lib/maruku/input/linesource.rb +90 -110
  32. data/lib/maruku/input/mdline.rb +129 -0
  33. data/lib/maruku/input/parse_block.rb +618 -612
  34. data/lib/maruku/input/parse_doc.rb +145 -215
  35. data/lib/maruku/input/parse_span.rb +658 -0
  36. data/lib/maruku/input/rubypants.rb +200 -128
  37. data/lib/maruku/inspect_element.rb +60 -0
  38. data/lib/maruku/maruku.rb +10 -31
  39. data/lib/maruku/output/entity_table.rb +33 -0
  40. data/lib/maruku/output/s5/fancy.rb +462 -462
  41. data/lib/maruku/output/s5/to_s5.rb +115 -135
  42. data/lib/maruku/output/to_html.rb +898 -983
  43. data/lib/maruku/output/to_latex.rb +561 -560
  44. data/lib/maruku/output/to_markdown.rb +207 -162
  45. data/lib/maruku/output/to_s.rb +11 -52
  46. data/lib/maruku/string_utils.rb +129 -179
  47. data/lib/maruku/toc.rb +185 -196
  48. data/lib/maruku/version.rb +33 -38
  49. data/spec/block_docs/abbrev.md +776 -0
  50. data/{tests/unittest → spec/block_docs}/abbreviations.md +11 -20
  51. data/{tests/unittest → spec/block_docs}/alt.md +2 -14
  52. data/{tests/unittest/pending → spec/block_docs}/amps.md +1 -13
  53. data/{tests/unittest → spec/block_docs}/attributes/att2.md +0 -12
  54. data/{tests/unittest → spec/block_docs}/attributes/att3.md +2 -14
  55. data/{tests/unittest → spec/block_docs}/attributes/attributes.md +12 -16
  56. data/{tests/unittest → spec/block_docs}/attributes/circular.md +0 -12
  57. data/{tests/unittest → spec/block_docs}/attributes/default.md +1 -13
  58. data/{tests/unittest → spec/block_docs}/blank.md +0 -12
  59. data/{tests/unittest → spec/block_docs}/blanks_in_code.md +16 -15
  60. data/{tests/unittest/loss.md → spec/block_docs/bug_def.md} +6 -18
  61. data/{tests/unittest → spec/block_docs}/bug_table.md +3 -15
  62. data/{tests/unittest → spec/block_docs}/code.md +7 -14
  63. data/{tests/unittest → spec/block_docs}/code2.md +4 -14
  64. data/{tests/unittest → spec/block_docs}/code3.md +12 -16
  65. data/{tests/unittest → spec/block_docs}/data_loss.md +2 -14
  66. data/{tests/unittest → spec/block_docs}/divs/div1.md +0 -12
  67. data/{tests/unittest → spec/block_docs}/divs/div2.md +0 -12
  68. data/{tests/unittest → spec/block_docs}/divs/div3_nest.md +3 -15
  69. data/{tests/unittest → spec/block_docs}/easy.md +1 -13
  70. data/spec/block_docs/email.md +29 -0
  71. data/{tests/unittest/pending → spec/block_docs}/empty_cells.md +3 -15
  72. data/{tests/unittest → spec/block_docs}/encoding/iso-8859-1.md +1 -14
  73. data/{tests/unittest → spec/block_docs}/encoding/utf-8.md +0 -12
  74. data/{tests/unittest → spec/block_docs}/entities.md +27 -29
  75. data/{tests/unittest/notyet → spec/block_docs}/escape.md +2 -14
  76. data/{tests/unittest → spec/block_docs}/escaping.md +11 -22
  77. data/{tests/unittest → spec/block_docs}/extra_dl.md +2 -13
  78. data/{tests/unittest → spec/block_docs}/extra_header_id.md +14 -20
  79. data/{tests/unittest → spec/block_docs}/extra_table1.md +3 -15
  80. data/spec/block_docs/fenced_code_blocks.md +66 -0
  81. data/spec/block_docs/fenced_code_blocks_highlighted.md +18 -0
  82. data/{tests/unittest → spec/block_docs}/footnotes.md +12 -24
  83. data/spec/block_docs/footnotes2.md +78 -0
  84. data/spec/block_docs/hard.md +25 -0
  85. data/spec/block_docs/header_after_par.md +62 -0
  86. data/{tests/unittest → spec/block_docs}/headers.md +10 -18
  87. data/{tests/unittest → spec/block_docs}/hex_entities.md +7 -18
  88. data/{tests/unittest → spec/block_docs}/hrule.md +5 -12
  89. data/{tests/unittest → spec/block_docs}/html3.md +1 -13
  90. data/{tests/unittest → spec/block_docs}/html4.md +2 -14
  91. data/{tests/unittest → spec/block_docs}/html5.md +2 -14
  92. data/spec/block_docs/html_block_in_para.md +22 -0
  93. data/spec/block_docs/html_inline.md +25 -0
  94. data/spec/block_docs/html_trailing.md +31 -0
  95. data/spec/block_docs/ie.md +62 -0
  96. data/spec/block_docs/iframe.md +29 -0
  97. data/{tests/unittest → spec/block_docs}/images.md +22 -28
  98. data/{tests/unittest → spec/block_docs}/images2.md +7 -17
  99. data/{tests/unittest → spec/block_docs}/inline_html.md +37 -67
  100. data/{tests/unittest → spec/block_docs}/inline_html2.md +1 -13
  101. data/spec/block_docs/inline_html_beginning.md +10 -0
  102. data/spec/block_docs/issue20.md +9 -0
  103. data/spec/block_docs/issue26.md +22 -0
  104. data/spec/block_docs/issue29.md +9 -0
  105. data/spec/block_docs/issue30.md +30 -0
  106. data/spec/block_docs/issue31.md +25 -0
  107. data/spec/block_docs/issue40.md +40 -0
  108. data/spec/block_docs/issue64.md +55 -0
  109. data/spec/block_docs/issue67.md +19 -0
  110. data/spec/block_docs/issue70.md +11 -0
  111. data/spec/block_docs/issue72.md +17 -0
  112. data/spec/block_docs/issue74.md +38 -0
  113. data/spec/block_docs/issue79.md +15 -0
  114. data/spec/block_docs/issue83.md +13 -0
  115. data/spec/block_docs/issue85.md +25 -0
  116. data/spec/block_docs/issue88.md +19 -0
  117. data/spec/block_docs/issue89.md +12 -0
  118. data/spec/block_docs/issue90.md +38 -0
  119. data/{tests/unittest/pending → spec/block_docs}/link.md +21 -18
  120. data/{tests/unittest → spec/block_docs}/links.md +33 -32
  121. data/spec/block_docs/links2.md +21 -0
  122. data/{tests/unittest → spec/block_docs}/list1.md +0 -12
  123. data/{tests/unittest → spec/block_docs}/list12.md +2 -14
  124. data/{tests/unittest → spec/block_docs}/list2.md +2 -14
  125. data/spec/block_docs/list_multipara.md +42 -0
  126. data/{tests/unittest → spec/block_docs}/lists.md +28 -29
  127. data/{tests/unittest → spec/block_docs}/lists10.md +2 -14
  128. data/spec/block_docs/lists11.md +23 -0
  129. data/spec/block_docs/lists12.md +43 -0
  130. data/spec/block_docs/lists13.md +55 -0
  131. data/spec/block_docs/lists14.md +61 -0
  132. data/spec/block_docs/lists15.md +36 -0
  133. data/spec/block_docs/lists6.md +88 -0
  134. data/spec/block_docs/lists7b.md +58 -0
  135. data/spec/block_docs/lists9.md +53 -0
  136. data/{tests/unittest → spec/block_docs}/lists_after_paragraph.md +19 -25
  137. data/spec/block_docs/lists_blank.md +35 -0
  138. data/{tests/unittest/list3.md → spec/block_docs/lists_blockquote_code.md} +2 -14
  139. data/{tests/unittest/list4.md → spec/block_docs/lists_need_blank_line.md} +50 -21
  140. data/spec/block_docs/lists_nested.md +44 -0
  141. data/spec/block_docs/lists_nested_blankline.md +28 -0
  142. data/spec/block_docs/lists_nested_deep.md +43 -0
  143. data/{tests/unittest → spec/block_docs}/lists_ol.md +37 -54
  144. data/spec/block_docs/lists_paraindent.md +47 -0
  145. data/spec/block_docs/lists_tab.md +54 -0
  146. data/spec/block_docs/loss.md +17 -0
  147. data/spec/block_docs/math-blahtex/equations.md +30 -0
  148. data/spec/block_docs/math-blahtex/inline.md +48 -0
  149. data/spec/block_docs/math-blahtex/math2.md +45 -0
  150. data/spec/block_docs/math-blahtex/table.md +25 -0
  151. data/spec/block_docs/math/embedded_invalid_svg.md +79 -0
  152. data/spec/block_docs/math/embedded_svg.md +97 -0
  153. data/spec/block_docs/math/equations.md +44 -0
  154. data/{tests/unittest → spec/block_docs}/math/inline.md +7 -19
  155. data/spec/block_docs/math/math2.md +45 -0
  156. data/{tests/unittest → spec/block_docs}/math/notmath.md +0 -12
  157. data/spec/block_docs/math/raw_mathml.md +87 -0
  158. data/spec/block_docs/math/table.md +25 -0
  159. data/{tests/unittest → spec/block_docs}/math/table2.md +5 -17
  160. data/{tests/unittest → spec/block_docs}/misc_sw.md +181 -118
  161. data/{tests/unittest → spec/block_docs}/olist.md +6 -18
  162. data/{tests/unittest → spec/block_docs}/one.md +0 -12
  163. data/{tests/unittest → spec/block_docs}/paragraph.md +0 -12
  164. data/{tests/unittest → spec/block_docs}/paragraph_rules/dont_merge_ref.md +4 -12
  165. data/{tests/unittest → spec/block_docs}/paragraph_rules/tab_is_blank.md +0 -12
  166. data/{tests/unittest → spec/block_docs}/paragraphs.md +1 -13
  167. data/{tests/unittest → spec/block_docs}/recover/recover_links.md +4 -16
  168. data/{tests/unittest/pending/ref.md → spec/block_docs/ref_with_period.md} +7 -16
  169. data/spec/block_docs/ref_with_title.md +22 -0
  170. data/{tests/unittest → spec/block_docs}/references/long_example.md +16 -23
  171. data/{tests/unittest → spec/block_docs}/references/spaces_and_numbers.md +0 -12
  172. data/{tests/unittest → spec/block_docs}/smartypants.md +24 -31
  173. data/{tests/unittest → spec/block_docs}/syntax_hl.md +13 -17
  174. data/{tests/unittest → spec/block_docs}/table_attributes.md +2 -14
  175. data/spec/block_docs/tables.md +58 -0
  176. data/{tests/unittest → spec/block_docs}/test.md +1 -13
  177. data/{tests/unittest/notyet → spec/block_docs}/ticks.md +1 -13
  178. data/spec/block_docs/toc.md +87 -0
  179. data/{tests/unittest/notyet → spec/block_docs}/triggering.md +14 -25
  180. data/{tests/unittest → spec/block_docs}/underscore_in_words.md +0 -12
  181. data/{tests/unittest → spec/block_docs}/wrapping.md +4 -16
  182. data/spec/block_docs/xml.md +33 -0
  183. data/{tests/unittest → spec/block_docs}/xml2.md +0 -12
  184. data/spec/block_docs/xml3.md +24 -0
  185. data/{tests/unittest → spec/block_docs}/xml_instruction.md +9 -20
  186. data/spec/block_spec.rb +110 -0
  187. data/spec/cli_spec.rb +8 -0
  188. data/spec/span_spec.rb +256 -0
  189. data/spec/spec_helper.rb +2 -0
  190. data/spec/to_html_utf8_spec.rb +13 -0
  191. metadata +205 -243
  192. metadata.gz.sig +3 -0
  193. data/Rakefile +0 -48
  194. data/bin/marudown +0 -29
  195. data/bin/marutest +0 -345
  196. data/docs/changelog.md +0 -334
  197. data/lib/maruku/errors_management.rb +0 -92
  198. data/lib/maruku/ext/math/latex_fix.rb +0 -12
  199. data/lib/maruku/input/parse_span_better.rb +0 -746
  200. data/lib/maruku/input/type_detection.rb +0 -147
  201. data/lib/maruku/output/to_latex_entities.rb +0 -367
  202. data/lib/maruku/output/to_latex_strings.rb +0 -64
  203. data/lib/maruku/structures.rb +0 -167
  204. data/lib/maruku/structures_inspect.rb +0 -87
  205. data/lib/maruku/structures_iterators.rb +0 -61
  206. data/lib/maruku/tests/benchmark.rb +0 -82
  207. data/lib/maruku/tests/new_parser.rb +0 -373
  208. data/lib/maruku/tests/tests.rb +0 -136
  209. data/lib/maruku/usage/example1.rb +0 -33
  210. data/tests/bugs/code_in_links.md +0 -101
  211. data/tests/bugs/complex_escaping.md +0 -38
  212. data/tests/math/syntax.md +0 -46
  213. data/tests/math_usage/document.md +0 -13
  214. data/tests/others/abbreviations.md +0 -11
  215. data/tests/others/blank.md +0 -4
  216. data/tests/others/code.md +0 -5
  217. data/tests/others/code2.md +0 -8
  218. data/tests/others/code3.md +0 -16
  219. data/tests/others/email.md +0 -4
  220. data/tests/others/entities.md +0 -19
  221. data/tests/others/escaping.md +0 -16
  222. data/tests/others/extra_dl.md +0 -101
  223. data/tests/others/extra_header_id.md +0 -13
  224. data/tests/others/extra_table1.md +0 -40
  225. data/tests/others/footnotes.md +0 -17
  226. data/tests/others/headers.md +0 -10
  227. data/tests/others/hrule.md +0 -10
  228. data/tests/others/images.md +0 -20
  229. data/tests/others/inline_html.md +0 -42
  230. data/tests/others/links.md +0 -38
  231. data/tests/others/list1.md +0 -4
  232. data/tests/others/list2.md +0 -5
  233. data/tests/others/list3.md +0 -8
  234. data/tests/others/lists.md +0 -32
  235. data/tests/others/lists_after_paragraph.md +0 -44
  236. data/tests/others/lists_ol.md +0 -39
  237. data/tests/others/misc_sw.md +0 -105
  238. data/tests/others/one.md +0 -1
  239. data/tests/others/paragraphs.md +0 -13
  240. data/tests/others/sss06.md +0 -352
  241. data/tests/others/test.md +0 -4
  242. data/tests/s5/s5profiling.md +0 -48
  243. data/tests/unittest/bug_def.md +0 -28
  244. data/tests/unittest/email.md +0 -32
  245. data/tests/unittest/html2.md +0 -34
  246. data/tests/unittest/ie.md +0 -61
  247. data/tests/unittest/links2.md +0 -34
  248. data/tests/unittest/lists11.md +0 -28
  249. data/tests/unittest/lists6.md +0 -53
  250. data/tests/unittest/lists9.md +0 -76
  251. data/tests/unittest/math/equations.md +0 -86
  252. data/tests/unittest/math/math2.md +0 -57
  253. data/tests/unittest/math/table.md +0 -37
  254. data/tests/unittest/notyet/header_after_par.md +0 -70
  255. data/tests/unittest/red_tests/abbrev.md +0 -1388
  256. data/tests/unittest/red_tests/lists7.md +0 -68
  257. data/tests/unittest/red_tests/lists7b.md +0 -128
  258. data/tests/unittest/red_tests/lists8.md +0 -76
  259. data/tests/unittest/red_tests/xml.md +0 -70
  260. data/tests/unittest/xml3.md +0 -38
  261. data/tests/utf8-files/simple.md +0 -1
  262. data/unit_test_block.sh +0 -5
  263. data/unit_test_span.sh +0 -3
@@ -0,0 +1,776 @@
1
+ Write a comment here
2
+ *** Parameters: ***
3
+ {} # params
4
+ *** Markdown input: ***
5
+
6
+ WebKit (Safari 3.1) and the CSS @font-face declaration
7
+ ======================================================
8
+
9
+ I'm a big fan of typography in general. If you check out [my homepage](http://elliottcable.name) or my [contact elliottcable](http://elliottcable.name/contact.xhtml) page, and you're using Safari/WebKit or Opera/Kestrel, you'll notice the typefaces (fonts, as colloquialized) are *very* non-standard. (As of this writing, I'm using [Museo][] and [Diavlo][][^jos] heavily on both.)
10
+
11
+ The internet has not be a friendly place for typohiles like myself, up to this point, at least. One might even say it was a frightful, mentally scarring environment for those akin to yours truly. We've been restricted to reading page after page after page on day after day after day for year after year after year abominations of markup and design enslaved by the horrible overlords we know as Lucida, Verdana, Arial, Helvetica, Geneva, Georgia, Courier, and... dare I invoke ye, thou my terrible overlord? Times New Roman.
12
+
13
+ Wherefore art thou, my glorious Archer? And thee as well, my beautiful Garamond? The technical restrictions of that horrible monster we know as the Web Browser hath forced us all too long to use those most banal, those most common, and those most abused, out of all of the typefaces of the world.
14
+
15
+ All hyperbole aside, I'm extremely happy to see the advent of a standard `@font-face` declaration in CSS. Internet Explorer first implemented a crutched, basic version of this way back in version 4, but nothing ever really came of it - their decision to create the proprietary .EOT[^eot] format to appease overly restrictive type foundries' worries about intellectual property (aka. the cold, hard dominatrix that we know only as Ms. Profit) truly and completely killed that initial attempt at bringing astute typography and it's advocates to the web. This new run at `@font-face` by an established, trusted, and open group (the [W3C][] itself, responsible for helping to make much of what we use as designers on the web standard and cross-system compatible) has a much better chance, in my humble opinion - and I am quite looking forward to the consequences if it succeeds.
16
+
17
+ Now, onwards to the topic of my post as declared in the header (yes, I know, a slow start - but it's an interesting topic with an interesting history!). WebKit, the open source rendering engine behind the wonderfulness that is Safari, and how it handles the 'new' `@font-face` declaration. No, it's not really 'new', but yes, it feels like it is.
18
+
19
+ To put it simply, and to be very blunt, it's broken.
20
+
21
+ The [CSS spec section][spec] for `@font-face` is very specific - typefaces are to be selected based on a wide array of criteria placed in the `@font-face` declaration block itself. Various textual CSS attributes may be defined within the `@font-face` declaration, and then they will be checked when the typeface is referred to later in the CSS. For instance, if I have two `@font-face` declarations for the Diavlo family - one for regular text, and one for a heavier weighted version of the typeface - then I later utilize Diavlo in a `font-family:` attribute, it should refer to the basic Diavlo font defined in the first `@font-face`. However, if I were to do the same, but also specify a heavy `font-weight:`, then it should use the heavier version of Diavlo. To place this example in code:
22
+
23
+ @font-face {
24
+ font-family: 'Diavlo';
25
+ src: url(./Diavlo/Diavlo_Book.otf) format("opentype");
26
+ }
27
+
28
+ @font-face {
29
+ font-family: 'Diavlo';
30
+ font-weight: 900;
31
+ src: url(./Diavlo/Diavlo_Black.otf) format("opentype");
32
+ }
33
+
34
+ h1, h2, h3, h4, h5, h6 {
35
+ font-family: 'Diavlo';
36
+ font-weight: 900;
37
+ }
38
+
39
+ div#content {
40
+ font-family: 'Diavlo';
41
+ }
42
+
43
+ As you can see, my headings should use the typeface defined in `Diavlo_Black.otf`, while my body content should use `Diavlo_Book.otf`. However, in WebKit, this doesn't work - it completely ignores any attribute except `font-family:` and `src:` in a `@font-face` declaration! Completely ignores them! Not only that - not *only* that - it disregards all but the last `@font-face` for a given `font-family:` attribute string!
44
+
45
+ The implication here is that, to make `@font-face` work as it is currently implemented in WebKit (and thus, Safari 3.1), I have to declare *completely imaginary, non-existent type families* to satisfy WebKit alone. Here's the method I have used in the places I current implement `@font-face`:
46
+
47
+ @font-face {
48
+ font-family: 'Diavlo Book';
49
+ src: url(./Diavlo/Diavlo_Book.otf) format("opentype");
50
+ }
51
+
52
+ @font-face {
53
+ font-family: 'Diavlo Black';
54
+ src: url(./Diavlo/Diavlo_Black.otf) format("opentype");
55
+ }
56
+
57
+ h1, h2, h3, h4, h5, h6 {
58
+ font-family: 'Diavlo Black';
59
+ }
60
+
61
+ div#content {
62
+ font-family: 'Diavlo Book';
63
+ }
64
+
65
+ Isn't it horrible? Seriously, my eyes, they bleed. There's lots of problems with this far beyond the lack of semanticity when it comes to the typeface names... let me see how many ways this breaks the purpose of `@font-face`:
66
+
67
+ - You remove a large element our control over the display of the page.
68
+
69
+ As soon as we begin to use `@font-face` in our page, we can no longer make any use of any other textual control attribute - `font-weight:`, `font-style:`, and `font-variant:` are no longer available to us, because they no longer correctly map to technical typeface variant/features.
70
+
71
+ Also, many default elements are destroyed, unusable, without 'fixing' - for instance, `<b>` would have no effect in a page styled for WebKit as above; We would have to specify something like `b {font-family: 'Diavlo Black';}` - how broken is that? Unless we caught all such default elements and re-styled them to use the bastardized names instead of the correct attributes, lots of basic HTML formatting would be broken. I myself may never use in-document formatting (separation of design and content!), but what about comments forms? Forum posts? Direct HTML-literal quotes?
72
+
73
+ If we want to use Javascript to modify the display of the content, we can't simply adjust the mentioned textual control attributes - we have to know and change the entire `font-family:` array of strings.
74
+
75
+ - You make us very wet.
76
+
77
+ And by wet, I mean 'not DRY'. What if we decide to change one of the bastardized font names? Or use a different font entirely? We have to go through all of our CSS, all of our Javascript, and make sure we update every occurrence of the typeface's bastardized name.
78
+
79
+ - You remove our user's user choice, and waste bandwidth.
80
+
81
+ Since the names refer to families that don't, in fact, exist, the browser can't override the declaration with a user's installed version of the typeface. This means that, regardless of whether the user already has the typeface installed on their own computer, the browser won't use that - it doesn't know to use 'Diavlo', which the user has installed, because it was told to use 'Diavlo Black', which no user in the entire world has installed on their computer.
82
+
83
+ This whole thing is rather worrying - I've heard Opera has `@font-face` support, though I haven't had time to test this myself, so I don't know if it actually does - or, for that matter, if it does it 'correctly', or has the same problems as WebKit. But either way, WebKit is one of the first two implementations to ever attempt to support `@font-face` (Microsoft's unrelated `@font-face` declaration notwithstanding) - I really don't want to see it's early mistakes carried on to FireFox in a few years, and then Internet Explorer a few decades after that. That will leave us stuck with this broken system forever, as it has been demonstrated time and time again that if nobody else supports an old standard correctly, a newcomer to the standard will not do it correctly either. I for one would really, really, hate that.
84
+
85
+ In summary... come on, WebKit team, this isn't like you - you're always the ones with the closest-to-standard implementation, and the cleanest code, and... hell, overall? Webkit is the most secure/fastest browser available. But this is making me lose my faith in you, guys, please get it right. You're pioneering a leap into the future when it comes to the Web - this is as important, or _more_ important, than Mosiac's allowing of images was.
86
+
87
+ To put it succinctly - don't fuck this up, y'all.
88
+
89
+ [Museo]: <http://www.josbuivenga.demon.nl/museo.html> (Jos Buivenga's Museo free typeface)
90
+ [Diavlo]: <http://www.josbuivenga.demon.nl/diavlo.html> (Jos Buivenga's free Diavlo typeface)
91
+ [^jos]: These are fonts by [Jos Buivenga][jos], quite the amazing person. His (free) fonts are, uniquely, released for use on the web in `@font-face` declarations - unlike the vast majority of other (even free to download) typefaces, which have ridiculously restricting licenses and terms of use statements. Props, Jos - you're a pioneer, and deserve recognition as such.
92
+ *[CSS]: Cascading Style Sheets
93
+ *[.EOT]: Embedded OpenType
94
+ [^eot]: To give Microsoft a little credit, something I rarely do... Yes, I'm aware Microsoft submitted EOT to the W3C as a proposal - the problem isn't with their attempts to make it non-proprietary, but with the basic concept of making typefaces on the web DRMed. Look what such attempts have done to the music and video industry - simply decimated it. Do we really want to see the same thing happen to our beloved medium as typography moves into the 21st century?
95
+ *[W3C]: World Wide Web Consortium
96
+ [W3C]: <http://w3c.org> (World Wide Web Consortium)
97
+ [spec]: <http://?> ()
98
+ *[DRY]: Don't Repeat Yourself
99
+ [jos]: jos
100
+
101
+ *** Output of inspect ***
102
+ md_el(:document,[
103
+ md_el(:header,[
104
+ "WebKit (Safari 3.1) and the ",
105
+ md_el(:abbr,["CSS"],{:title=>"Cascading Style Sheets"},[]),
106
+ " @font-face declaration"
107
+ ],{:level=>1},[]),
108
+ md_par([
109
+ "I",
110
+ md_entity("rsquo"),
111
+ "m a big fan of typography in general. If you check out ",
112
+ md_im_link(["my homepage"], "http://elliottcable.name", nil),
113
+ " or my ",
114
+ md_im_link(["contact elliottcable"], "http://elliottcable.name/contact.xhtml", nil),
115
+ " page, and you",
116
+ md_entity("rsquo"),
117
+ "re using Safari/WebKit or Opera/Kestrel, you",
118
+ md_entity("rsquo"),
119
+ "ll notice the typefaces (fonts, as colloquialized) are ",
120
+ md_em(["very"]),
121
+ " non-standard. (As of this writing, I",
122
+ md_entity("rsquo"),
123
+ "m using ",
124
+ md_link(["Museo"],""),
125
+ " and ",
126
+ md_link(["Diavlo"],""),
127
+ md_foot_ref("^jos"),
128
+ " heavily on both.)"
129
+ ]),
130
+ md_par([
131
+ "The internet has not be a friendly place for typohiles like myself, up to this point, at least. One might even say it was a frightful, mentally scarring environment for those akin to yours truly. We",
132
+ md_entity("rsquo"),
133
+ "ve been restricted to reading page after page after page on day after day after day for year after year after year abominations of markup and design enslaved by the horrible overlords we know as Lucida, Verdana, Arial, Helvetica, Geneva, Georgia, Courier, and",
134
+ md_entity("hellip"),
135
+ " dare I invoke ye, thou my terrible overlord? Times New Roman."
136
+ ]),
137
+ md_par([
138
+ "Wherefore art thou, my glorious Archer? And thee as well, my beautiful Garamond? The technical restrictions of that horrible monster we know as the Web Browser hath forced us all too long to use those most banal, those most common, and those most abused, out of all of the typefaces of the world."
139
+ ]),
140
+ md_par([
141
+ "All hyperbole aside, I",
142
+ md_entity("rsquo"),
143
+ "m extremely happy to see the advent of a standard ",
144
+ md_code("@font-face"),
145
+ " declaration in ",
146
+ md_el(:abbr,["CSS"],{:title=>"Cascading Style Sheets"},[]),
147
+ ". Internet Explorer first implemented a crutched, basic version of this way back in version 4, but nothing ever really came of it - their decision to create the proprietary ",
148
+ md_el(:abbr,[".EOT"],{:title=>"Embedded OpenType"},[]),
149
+ md_foot_ref("^eot"),
150
+ " format to appease overly restrictive type foundries",
151
+ md_entity("rsquo"),
152
+ " worries about intellectual property (aka. the cold, hard dominatrix that we know only as Ms. Profit) truly and completely killed that initial attempt at bringing astute typography and it",
153
+ md_entity("rsquo"),
154
+ "s advocates to the web. This new run at ",
155
+ md_code("@font-face"),
156
+ " by an established, trusted, and open group (the ",
157
+ md_link([md_el(:abbr,["W3C"],{:title=>"World Wide Web Consortium"},[])], ""),
158
+ " itself, responsible for helping to make much of what we use as designers on the web standard and cross-system compatible) has a much better chance, in my humble opinion - and I am quite looking forward to the consequences if it succeeds."
159
+ ]),
160
+ md_par([
161
+ "Now, onwards to the topic of my post as declared in the header (yes, I know, a slow start - but it",
162
+ md_entity("rsquo"),
163
+ "s an interesting topic with an interesting history!). WebKit, the open source rendering engine behind the wonderfulness that is Safari, and how it handles the ",
164
+ md_entity("lsquo"),
165
+ "new",
166
+ md_entity("rsquo"),
167
+ " ",
168
+ md_code("@font-face"),
169
+ " declaration. No, it",
170
+ md_entity("rsquo"),
171
+ "s not really ",
172
+ md_entity("lsquo"),
173
+ "new",
174
+ md_entity("rsquo"),
175
+ ", but yes, it feels like it is."
176
+ ]),
177
+ md_par([
178
+ "To put it simply, and to be very blunt, it",
179
+ md_entity("rsquo"),
180
+ "s broken."
181
+ ]),
182
+ md_par([
183
+ "The ",
184
+ md_link([
185
+ md_el(:abbr,["CSS"],{:title=>"Cascading Style Sheets"},[]),
186
+ " spec section"
187
+ ], "spec"),
188
+ " for ",
189
+ md_code("@font-face"),
190
+ " is very specific - typefaces are to be selected based on a wide array of criteria placed in the ",
191
+ md_code("@font-face"),
192
+ " declaration block itself. Various textual ",
193
+ md_el(:abbr,["CSS"],{:title=>"Cascading Style Sheets"},[]),
194
+ " attributes may be defined within the ",
195
+ md_code("@font-face"),
196
+ " declaration, and then they will be checked when the typeface is referred to later in the ",
197
+ md_el(:abbr,["CSS"],{:title=>"Cascading Style Sheets"},[]),
198
+ ". For instance, if I have two ",
199
+ md_code("@font-face"),
200
+ " declarations for the Diavlo family - one for regular text, and one for a heavier weighted version of the typeface - then I later utilize Diavlo in a ",
201
+ md_code("font-family:"),
202
+ " attribute, it should refer to the basic Diavlo font defined in the first ",
203
+ md_code("@font-face"),
204
+ ". However, if I were to do the same, but also specify a heavy ",
205
+ md_code("font-weight:"),
206
+ ", then it should use the heavier version of Diavlo. To place this example in code:"
207
+ ]),
208
+ md_el(:code,[],{:raw_code=>"@font-face {\n font-family: 'Diavlo';\n src: url(./Diavlo/Diavlo_Book.otf) format(\"opentype\");\n}\n\n@font-face {\n font-family: 'Diavlo';\n font-weight: 900;\n src: url(./Diavlo/Diavlo_Black.otf) format(\"opentype\");\n}\n\nh1, h2, h3, h4, h5, h6 {\n font-family: 'Diavlo';\n font-weight: 900;\n}\n\ndiv#content {\n font-family: 'Diavlo';\n}", :lang=>nil},[]),
209
+ md_par([
210
+ "As you can see, my headings should use the typeface defined in ",
211
+ md_code("Diavlo_Black.otf"),
212
+ ", while my body content should use ",
213
+ md_code("Diavlo_Book.otf"),
214
+ ". However, in WebKit, this doesn",
215
+ md_entity("rsquo"),
216
+ "t work - it completely ignores any attribute except ",
217
+ md_code("font-family:"),
218
+ " and ",
219
+ md_code("src:"),
220
+ " in a ",
221
+ md_code("@font-face"),
222
+ " declaration! Completely ignores them! Not only that - not ",
223
+ md_em(["only"]),
224
+ " that - it disregards all but the last ",
225
+ md_code("@font-face"),
226
+ " for a given ",
227
+ md_code("font-family:"),
228
+ " attribute string!"
229
+ ]),
230
+ md_par([
231
+ "The implication here is that, to make ",
232
+ md_code("@font-face"),
233
+ " work as it is currently implemented in WebKit (and thus, Safari 3.1), I have to declare ",
234
+ md_em(["completely imaginary, non-existent type families"]),
235
+ " to satisfy WebKit alone. Here",
236
+ md_entity("rsquo"),
237
+ "s the method I have used in the places I current implement ",
238
+ md_code("@font-face"),
239
+ ":"
240
+ ]),
241
+ md_el(:code,[],{:raw_code=>"@font-face {\n font-family: 'Diavlo Book';\n src: url(./Diavlo/Diavlo_Book.otf) format(\"opentype\");\n}\n\n@font-face {\n font-family: 'Diavlo Black';\n src: url(./Diavlo/Diavlo_Black.otf) format(\"opentype\");\n}\n\nh1, h2, h3, h4, h5, h6 {\n font-family: 'Diavlo Black';\n}\n\ndiv#content {\n font-family: 'Diavlo Book';\n}", :lang=>nil},[]),
242
+ md_par([
243
+ "Isn",
244
+ md_entity("rsquo"),
245
+ "t it horrible? Seriously, my eyes, they bleed. There",
246
+ md_entity("rsquo"),
247
+ "s lots of problems with this far beyond the lack of semanticity when it comes to the typeface names",
248
+ md_entity("hellip"),
249
+ " let me see how many ways this breaks the purpose of ",
250
+ md_code("@font-face"),
251
+ ":"
252
+ ]),
253
+ md_el(:ul,[
254
+ md_el(:li,[
255
+ md_par([
256
+ "You remove a large element our control over the display of the page."
257
+ ]),
258
+ md_par([
259
+ "As soon as we begin to use ",
260
+ md_code("@font-face"),
261
+ " in our page, we can no longer make any use of any other textual control attribute - ",
262
+ md_code("font-weight:"),
263
+ ", ",
264
+ md_code("font-style:"),
265
+ ", and ",
266
+ md_code("font-variant:"),
267
+ " are no longer available to us, because they no longer correctly map to technical typeface variant/features."
268
+ ]),
269
+ md_par([
270
+ "Also, many default elements are destroyed, unusable, without ",
271
+ md_entity("lsquo"),
272
+ "fixing",
273
+ md_entity("rsquo"),
274
+ " - for instance, ",
275
+ md_code("<b>"),
276
+ " would have no effect in a page styled for WebKit as above; We would have to specify something like ",
277
+ md_code("b {font-family: 'Diavlo Black';}"),
278
+ " - how broken is that? Unless we caught all such default elements and re-styled them to use the bastardized names instead of the correct attributes, lots of basic HTML formatting would be broken. I myself may never use in-document formatting (separation of design and content!), but what about comments forms? Forum posts? Direct HTML-literal quotes?"
279
+ ]),
280
+ md_par([
281
+ "If we want to use Javascript to modify the display of the content, we can",
282
+ md_entity("rsquo"),
283
+ "t simply adjust the mentioned textual control attributes - we have to know and change the entire ",
284
+ md_code("font-family:"),
285
+ " array of strings."
286
+ ])
287
+ ],{:want_my_paragraph=>true},[]),
288
+ md_el(:li,[
289
+ md_par(["You make us very wet."]),
290
+ md_par([
291
+ "And by wet, I mean ",
292
+ md_entity("lsquo"),
293
+ "not ",
294
+ md_el(:abbr,["DRY"],{:title=>"Don't Repeat Yourself"},[]),
295
+ md_entity("rsquo"),
296
+ ". What if we decide to change one of the bastardized font names? Or use a different font entirely? We have to go through all of our ",
297
+ md_el(:abbr,["CSS"],{:title=>"Cascading Style Sheets"},[]),
298
+ ", all of our Javascript, and make sure we update every occurrence of the typeface",
299
+ md_entity("rsquo"),
300
+ "s bastardized name."
301
+ ])
302
+ ],{:want_my_paragraph=>true},[]),
303
+ md_el(:li,[
304
+ md_par([
305
+ "You remove our user",
306
+ md_entity("rsquo"),
307
+ "s user choice, and waste bandwidth."
308
+ ]),
309
+ md_par([
310
+ "Since the names refer to families that don",
311
+ md_entity("rsquo"),
312
+ "t, in fact, exist, the browser can",
313
+ md_entity("rsquo"),
314
+ "t override the declaration with a user",
315
+ md_entity("rsquo"),
316
+ "s installed version of the typeface. This means that, regardless of whether the user already has the typeface installed on their own computer, the browser won",
317
+ md_entity("rsquo"),
318
+ "t use that - it doesn",
319
+ md_entity("rsquo"),
320
+ "t know to use ",
321
+ md_entity("lsquo"),
322
+ "Diavlo",
323
+ md_entity("rsquo"),
324
+ ", which the user has installed, because it was told to use ",
325
+ md_entity("lsquo"),
326
+ "Diavlo Black",
327
+ md_entity("rsquo"),
328
+ ", which no user in the entire world has installed on their computer."
329
+ ])
330
+ ],{:want_my_paragraph=>false},[])
331
+ ],{},[]),
332
+ md_par([
333
+ "This whole thing is rather worrying - I",
334
+ md_entity("rsquo"),
335
+ "ve heard Opera has ",
336
+ md_code("@font-face"),
337
+ " support, though I haven",
338
+ md_entity("rsquo"),
339
+ "t had time to test this myself, so I don",
340
+ md_entity("rsquo"),
341
+ "t know if it actually does - or, for that matter, if it does it ",
342
+ md_entity("lsquo"),
343
+ "correctly",
344
+ md_entity("rsquo"),
345
+ ", or has the same problems as WebKit. But either way, WebKit is one of the first two implementations to ever attempt to support ",
346
+ md_code("@font-face"),
347
+ " (Microsoft",
348
+ md_entity("rsquo"),
349
+ "s unrelated ",
350
+ md_code("@font-face"),
351
+ " declaration notwithstanding) - I really don",
352
+ md_entity("rsquo"),
353
+ "t want to see it",
354
+ md_entity("rsquo"),
355
+ "s early mistakes carried on to FireFox in a few years, and then Internet Explorer a few decades after that. That will leave us stuck with this broken system forever, as it has been demonstrated time and time again that if nobody else supports an old standard correctly, a newcomer to the standard will not do it correctly either. I for one would really, really, hate that."
356
+ ]),
357
+ md_par([
358
+ "In summary",
359
+ md_entity("hellip"),
360
+ " come on, WebKit team, this isn",
361
+ md_entity("rsquo"),
362
+ "t like you - you",
363
+ md_entity("rsquo"),
364
+ "re always the ones with the closest-to-standard implementation, and the cleanest code, and",
365
+ md_entity("hellip"),
366
+ " hell, overall? Webkit is the most secure/fastest browser available. But this is making me lose my faith in you, guys, please get it right. You",
367
+ md_entity("rsquo"),
368
+ "re pioneering a leap into the future when it comes to the Web - this is as important, or ",
369
+ md_em(["more"]),
370
+ " important, than Mosiac",
371
+ md_entity("rsquo"),
372
+ "s allowing of images was."
373
+ ]),
374
+ md_par([
375
+ "To put it succinctly - don",
376
+ md_entity("rsquo"),
377
+ "t fuck this up, y",
378
+ md_entity("rsquo"),
379
+ "all."
380
+ ]),
381
+ md_ref_def("museo", "http://www.josbuivenga.demon.nl/museo.html", {:title=>"Jos Buivenga's Museo free typeface"}),
382
+ md_ref_def("diavlo", "http://www.josbuivenga.demon.nl/diavlo.html", {:title=>"Jos Buivenga's free Diavlo typeface"}),
383
+ md_el(:footnote,[
384
+ md_par([
385
+ "These are fonts by ",
386
+ md_link(["Jos Buivenga"], "jos"),
387
+ ", quite the amazing person. His (free) fonts are, uniquely, released for use on the web in ",
388
+ md_code("@font-face"),
389
+ " declarations - unlike the vast majority of other (even free to download) typefaces, which have ridiculously restricting licenses and terms of use statements. Props, Jos - you",
390
+ md_entity("rsquo"),
391
+ "re a pioneer, and deserve recognition as such."
392
+ ])
393
+ ],{:footnote_id=>"^jos"},[]),
394
+ md_el(:abbr_def,[],{:abbr=>"CSS",:text=>"Cascading Style Sheets"},[]),
395
+ md_el(:abbr_def,[],{:abbr=>".EOT",:text=>"Embedded OpenType"},[]),
396
+ md_el(:footnote,[
397
+ md_par([
398
+ "To give Microsoft a little credit, something I rarely do",
399
+ md_entity("hellip"),
400
+ " Yes, I",
401
+ md_entity("rsquo"),
402
+ "m aware Microsoft submitted EOT to the ",
403
+ md_el(:abbr,["W3C"],{:title=>"World Wide Web Consortium"},[]),
404
+ " as a proposal - the problem isn",
405
+ md_entity("rsquo"),
406
+ "t with their attempts to make it non-proprietary, but with the basic concept of making typefaces on the web DRMed. Look what such attempts have done to the music and video industry - simply decimated it. Do we really want to see the same thing happen to our beloved medium as typography moves into the 21st century?"
407
+ ])
408
+ ],{:footnote_id=>"^eot"},[]),
409
+ md_el(:abbr_def,[],{:abbr=>"W3C",:text=>"World Wide Web Consortium"},[]),
410
+ md_ref_def("w3c", "http://w3c.org", {:title=>"World Wide Web Consortium"}),
411
+ md_ref_def("spec", "http://?", {:title=>nil}),
412
+ md_el(:abbr_def,[],{:abbr=>"DRY",:text=>"Don't Repeat Yourself"},[]),
413
+ md_ref_def("jos", "jos", {:title=>nil})
414
+ ],{},[])
415
+ *** Output of to_html ***
416
+ <h1 id="webkit_safari_31_and_the_css_fontface_declaration">WebKit (Safari 3.1) and the <abbr title="Cascading Style Sheets">CSS</abbr> @font-face declaration</h1>
417
+
418
+ <p>I&#8217;m a big fan of typography in general. If you check out <a href="http://elliottcable.name">my homepage</a> or my <a href="http://elliottcable.name/contact.xhtml">contact elliottcable</a> page, and you&#8217;re using Safari/WebKit or Opera/Kestrel, you&#8217;ll notice the typefaces (fonts, as colloquialized) are <em>very</em> non-standard. (As of this writing, I&#8217;m using <a href="http://www.josbuivenga.demon.nl/museo.html" title="Jos Buivenga's Museo free typeface">Museo</a> and <a href="http://www.josbuivenga.demon.nl/diavlo.html" title="Jos Buivenga's free Diavlo typeface">Diavlo</a><sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> heavily on both.)</p>
419
+
420
+ <p>The internet has not be a friendly place for typohiles like myself, up to this point, at least. One might even say it was a frightful, mentally scarring environment for those akin to yours truly. We&#8217;ve been restricted to reading page after page after page on day after day after day for year after year after year abominations of markup and design enslaved by the horrible overlords we know as Lucida, Verdana, Arial, Helvetica, Geneva, Georgia, Courier, and&#8230; dare I invoke ye, thou my terrible overlord? Times New Roman.</p>
421
+
422
+ <p>Wherefore art thou, my glorious Archer? And thee as well, my beautiful Garamond? The technical restrictions of that horrible monster we know as the Web Browser hath forced us all too long to use those most banal, those most common, and those most abused, out of all of the typefaces of the world.</p>
423
+
424
+ <p>All hyperbole aside, I&#8217;m extremely happy to see the advent of a standard <code>@font-face</code> declaration in <abbr title="Cascading Style Sheets">CSS</abbr>. Internet Explorer first implemented a crutched, basic version of this way back in version 4, but nothing ever really came of it - their decision to create the proprietary <abbr title="Embedded OpenType">.EOT</abbr><sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup> format to appease overly restrictive type foundries&#8217; worries about intellectual property (aka. the cold, hard dominatrix that we know only as Ms. Profit) truly and completely killed that initial attempt at bringing astute typography and it&#8217;s advocates to the web. This new run at <code>@font-face</code> by an established, trusted, and open group (the <a href="http://w3c.org" title="World Wide Web Consortium"><abbr title="World Wide Web Consortium">W3C</abbr></a> itself, responsible for helping to make much of what we use as designers on the web standard and cross-system compatible) has a much better chance, in my humble opinion - and I am quite looking forward to the consequences if it succeeds.</p>
425
+
426
+ <p>Now, onwards to the topic of my post as declared in the header (yes, I know, a slow start - but it&#8217;s an interesting topic with an interesting history!). WebKit, the open source rendering engine behind the wonderfulness that is Safari, and how it handles the &#8216;new&#8217; <code>@font-face</code> declaration. No, it&#8217;s not really &#8216;new&#8217;, but yes, it feels like it is.</p>
427
+
428
+ <p>To put it simply, and to be very blunt, it&#8217;s broken.</p>
429
+
430
+ <p>The <a href="http://?"><abbr title="Cascading Style Sheets">CSS</abbr> spec section</a> for <code>@font-face</code> is very specific - typefaces are to be selected based on a wide array of criteria placed in the <code>@font-face</code> declaration block itself. Various textual <abbr title="Cascading Style Sheets">CSS</abbr> attributes may be defined within the <code>@font-face</code> declaration, and then they will be checked when the typeface is referred to later in the <abbr title="Cascading Style Sheets">CSS</abbr>. For instance, if I have two <code>@font-face</code> declarations for the Diavlo family - one for regular text, and one for a heavier weighted version of the typeface - then I later utilize Diavlo in a <code>font-family:</code> attribute, it should refer to the basic Diavlo font defined in the first <code>@font-face</code>. However, if I were to do the same, but also specify a heavy <code>font-weight:</code>, then it should use the heavier version of Diavlo. To place this example in code:</p>
431
+
432
+ <pre><code>@font-face {
433
+ font-family: 'Diavlo';
434
+ src: url(./Diavlo/Diavlo_Book.otf) format("opentype");
435
+ }
436
+
437
+ @font-face {
438
+ font-family: 'Diavlo';
439
+ font-weight: 900;
440
+ src: url(./Diavlo/Diavlo_Black.otf) format("opentype");
441
+ }
442
+
443
+ h1, h2, h3, h4, h5, h6 {
444
+ font-family: 'Diavlo';
445
+ font-weight: 900;
446
+ }
447
+
448
+ div#content {
449
+ font-family: 'Diavlo';
450
+ }</code></pre>
451
+
452
+ <p>As you can see, my headings should use the typeface defined in <code>Diavlo_Black.otf</code>, while my body content should use <code>Diavlo_Book.otf</code>. However, in WebKit, this doesn&#8217;t work - it completely ignores any attribute except <code>font-family:</code> and <code>src:</code> in a <code>@font-face</code> declaration! Completely ignores them! Not only that - not <em>only</em> that - it disregards all but the last <code>@font-face</code> for a given <code>font-family:</code> attribute string!</p>
453
+
454
+ <p>The implication here is that, to make <code>@font-face</code> work as it is currently implemented in WebKit (and thus, Safari 3.1), I have to declare <em>completely imaginary, non-existent type families</em> to satisfy WebKit alone. Here&#8217;s the method I have used in the places I current implement <code>@font-face</code>:</p>
455
+
456
+ <pre><code>@font-face {
457
+ font-family: 'Diavlo Book';
458
+ src: url(./Diavlo/Diavlo_Book.otf) format("opentype");
459
+ }
460
+
461
+ @font-face {
462
+ font-family: 'Diavlo Black';
463
+ src: url(./Diavlo/Diavlo_Black.otf) format("opentype");
464
+ }
465
+
466
+ h1, h2, h3, h4, h5, h6 {
467
+ font-family: 'Diavlo Black';
468
+ }
469
+
470
+ div#content {
471
+ font-family: 'Diavlo Book';
472
+ }</code></pre>
473
+
474
+ <p>Isn&#8217;t it horrible? Seriously, my eyes, they bleed. There&#8217;s lots of problems with this far beyond the lack of semanticity when it comes to the typeface names&#8230; let me see how many ways this breaks the purpose of <code>@font-face</code>:</p>
475
+
476
+ <ul>
477
+ <li>
478
+ <p>You remove a large element our control over the display of the page.</p>
479
+
480
+ <p>As soon as we begin to use <code>@font-face</code> in our page, we can no longer make any use of any other textual control attribute - <code>font-weight:</code>, <code>font-style:</code>, and <code>font-variant:</code> are no longer available to us, because they no longer correctly map to technical typeface variant/features.</p>
481
+
482
+ <p>Also, many default elements are destroyed, unusable, without &#8216;fixing&#8217; - for instance, <code>&lt;b&gt;</code> would have no effect in a page styled for WebKit as above; We would have to specify something like <code>b {font-family: 'Diavlo Black';}</code> - how broken is that? Unless we caught all such default elements and re-styled them to use the bastardized names instead of the correct attributes, lots of basic HTML formatting would be broken. I myself may never use in-document formatting (separation of design and content!), but what about comments forms? Forum posts? Direct HTML-literal quotes?</p>
483
+
484
+ <p>If we want to use Javascript to modify the display of the content, we can&#8217;t simply adjust the mentioned textual control attributes - we have to know and change the entire <code>font-family:</code> array of strings.</p>
485
+ </li>
486
+
487
+ <li>
488
+ <p>You make us very wet.</p>
489
+
490
+ <p>And by wet, I mean &#8216;not <abbr title="Don't Repeat Yourself">DRY</abbr>&#8217;. What if we decide to change one of the bastardized font names? Or use a different font entirely? We have to go through all of our <abbr title="Cascading Style Sheets">CSS</abbr>, all of our Javascript, and make sure we update every occurrence of the typeface&#8217;s bastardized name.</p>
491
+ </li>
492
+
493
+ <li>
494
+ <p>You remove our user&#8217;s user choice, and waste bandwidth.</p>
495
+
496
+ <p>Since the names refer to families that don&#8217;t, in fact, exist, the browser can&#8217;t override the declaration with a user&#8217;s installed version of the typeface. This means that, regardless of whether the user already has the typeface installed on their own computer, the browser won&#8217;t use that - it doesn&#8217;t know to use &#8216;Diavlo&#8217;, which the user has installed, because it was told to use &#8216;Diavlo Black&#8217;, which no user in the entire world has installed on their computer.</p>
497
+ </li>
498
+ </ul>
499
+
500
+ <p>This whole thing is rather worrying - I&#8217;ve heard Opera has <code>@font-face</code> support, though I haven&#8217;t had time to test this myself, so I don&#8217;t know if it actually does - or, for that matter, if it does it &#8216;correctly&#8217;, or has the same problems as WebKit. But either way, WebKit is one of the first two implementations to ever attempt to support <code>@font-face</code> (Microsoft&#8217;s unrelated <code>@font-face</code> declaration notwithstanding) - I really don&#8217;t want to see it&#8217;s early mistakes carried on to FireFox in a few years, and then Internet Explorer a few decades after that. That will leave us stuck with this broken system forever, as it has been demonstrated time and time again that if nobody else supports an old standard correctly, a newcomer to the standard will not do it correctly either. I for one would really, really, hate that.</p>
501
+
502
+ <p>In summary&#8230; come on, WebKit team, this isn&#8217;t like you - you&#8217;re always the ones with the closest-to-standard implementation, and the cleanest code, and&#8230; hell, overall? Webkit is the most secure/fastest browser available. But this is making me lose my faith in you, guys, please get it right. You&#8217;re pioneering a leap into the future when it comes to the Web - this is as important, or <em>more</em> important, than Mosiac&#8217;s allowing of images was.</p>
503
+
504
+ <p>To put it succinctly - don&#8217;t fuck this up, y&#8217;all.</p>
505
+ <div class="footnotes"><hr /><ol><li id="fn:1">
506
+ <p>These are fonts by <a href="jos">Jos Buivenga</a>, quite the amazing person. His (free) fonts are, uniquely, released for use on the web in <code>@font-face</code> declarations - unlike the vast majority of other (even free to download) typefaces, which have ridiculously restricting licenses and terms of use statements. Props, Jos - you&#8217;re a pioneer, and deserve recognition as such. <a href="#fnref:1" rev="footnote">&#8617;</a></p>
507
+ </li><li id="fn:2">
508
+ <p>To give Microsoft a little credit, something I rarely do&#8230; Yes, I&#8217;m aware Microsoft submitted EOT to the <abbr title="World Wide Web Consortium">W3C</abbr> as a proposal - the problem isn&#8217;t with their attempts to make it non-proprietary, but with the basic concept of making typefaces on the web DRMed. Look what such attempts have done to the music and video industry - simply decimated it. Do we really want to see the same thing happen to our beloved medium as typography moves into the 21st century? <a href="#fnref:2" rev="footnote">&#8617;</a></p>
509
+ </li></ol></div>
510
+ *** Output of to_latex ***
511
+ \hypertarget{webkit_safari_31_and_the_css_fontface_declaration}{}\section*{{WebKit (Safari 3.1) and the CSS @font-face declaration}}\label{webkit_safari_31_and_the_css_fontface_declaration}
512
+
513
+ I'm a big fan of typography in general. If you check out \href{http://elliottcable.name}{my homepage} or my \href{http://elliottcable.name/contact.xhtml}{contact elliottcable} page, and you're using Safari/WebKit or Opera/Kestrel, you'll notice the typefaces (fonts, as colloquialized) are \emph{very} non-standard. (As of this writing, I'm using \href{http://www.josbuivenga.demon.nl/museo.html}{Museo} and \href{http://www.josbuivenga.demon.nl/diavlo.html}{Diavlo}\footnote{These are fonts by \href{jos}{Jos Buivenga}, quite the amazing person. His (free) fonts are, uniquely, released for use on the web in {\colorbox[rgb]{1.00,0.93,1.00}{\tt \char64font\char45face}} declarations - unlike the vast majority of other (even free to download) typefaces, which have ridiculously restricting licenses and terms of use statements. Props, Jos - you're a pioneer, and deserve recognition as such.} heavily on both.)
514
+
515
+ The internet has not be a friendly place for typohiles like myself, up to this point, at least. One might even say it was a frightful, mentally scarring environment for those akin to yours truly. We've been restricted to reading page after page after page on day after day after day for year after year after year abominations of markup and design enslaved by the horrible overlords we know as Lucida, Verdana, Arial, Helvetica, Geneva, Georgia, Courier, and\ldots{} dare I invoke ye, thou my terrible overlord? Times New Roman.
516
+
517
+ Wherefore art thou, my glorious Archer? And thee as well, my beautiful Garamond? The technical restrictions of that horrible monster we know as the Web Browser hath forced us all too long to use those most banal, those most common, and those most abused, out of all of the typefaces of the world.
518
+
519
+ All hyperbole aside, I'm extremely happy to see the advent of a standard {\colorbox[rgb]{1.00,0.93,1.00}{\tt \char64font\char45face}} declaration in CSS. Internet Explorer first implemented a crutched, basic version of this way back in version 4, but nothing ever really came of it - their decision to create the proprietary .EOT\footnote{To give Microsoft a little credit, something I rarely do\ldots{} Yes, I'm aware Microsoft submitted EOT to the W3C as a proposal - the problem isn't with their attempts to make it non-proprietary, but with the basic concept of making typefaces on the web DRMed. Look what such attempts have done to the music and video industry - simply decimated it. Do we really want to see the same thing happen to our beloved medium as typography moves into the 21st century?} format to appease overly restrictive type foundries' worries about intellectual property (aka. the cold, hard dominatrix that we know only as Ms. Profit) truly and completely killed that initial attempt at bringing astute typography and it's advocates to the web. This new run at {\colorbox[rgb]{1.00,0.93,1.00}{\tt \char64font\char45face}} by an established, trusted, and open group (the \href{http://w3c.org}{W3C} itself, responsible for helping to make much of what we use as designers on the web standard and cross-system compatible) has a much better chance, in my humble opinion - and I am quite looking forward to the consequences if it succeeds.
520
+
521
+ Now, onwards to the topic of my post as declared in the header (yes, I know, a slow start - but it's an interesting topic with an interesting history!). WebKit, the open source rendering engine behind the wonderfulness that is Safari, and how it handles the `new' {\colorbox[rgb]{1.00,0.93,1.00}{\tt \char64font\char45face}} declaration. No, it's not really `new', but yes, it feels like it is.
522
+
523
+ To put it simply, and to be very blunt, it's broken.
524
+
525
+ The \href{http://?}{CSS spec section} for {\colorbox[rgb]{1.00,0.93,1.00}{\tt \char64font\char45face}} is very specific - typefaces are to be selected based on a wide array of criteria placed in the {\colorbox[rgb]{1.00,0.93,1.00}{\tt \char64font\char45face}} declaration block itself. Various textual CSS attributes may be defined within the {\colorbox[rgb]{1.00,0.93,1.00}{\tt \char64font\char45face}} declaration, and then they will be checked when the typeface is referred to later in the CSS. For instance, if I have two {\colorbox[rgb]{1.00,0.93,1.00}{\tt \char64font\char45face}} declarations for the Diavlo family - one for regular text, and one for a heavier weighted version of the typeface - then I later utilize Diavlo in a {\colorbox[rgb]{1.00,0.93,1.00}{\tt font\char45family\char58}} attribute, it should refer to the basic Diavlo font defined in the first {\colorbox[rgb]{1.00,0.93,1.00}{\tt \char64font\char45face}}. However, if I were to do the same, but also specify a heavy {\colorbox[rgb]{1.00,0.93,1.00}{\tt font\char45weight\char58}}, then it should use the heavier version of Diavlo. To place this example in code:
526
+
527
+ \begin{verbatim}@font-face {
528
+ font-family: 'Diavlo';
529
+ src: url(./Diavlo/Diavlo_Book.otf) format("opentype");
530
+ }
531
+
532
+ @font-face {
533
+ font-family: 'Diavlo';
534
+ font-weight: 900;
535
+ src: url(./Diavlo/Diavlo_Black.otf) format("opentype");
536
+ }
537
+
538
+ h1, h2, h3, h4, h5, h6 {
539
+ font-family: 'Diavlo';
540
+ font-weight: 900;
541
+ }
542
+
543
+ div#content {
544
+ font-family: 'Diavlo';
545
+ }\end{verbatim}
546
+ As you can see, my headings should use the typeface defined in {\colorbox[rgb]{1.00,0.93,1.00}{\tt Diavlo\char95Black\char46otf}}, while my body content should use {\colorbox[rgb]{1.00,0.93,1.00}{\tt Diavlo\char95Book\char46otf}}. However, in WebKit, this doesn't work - it completely ignores any attribute except {\colorbox[rgb]{1.00,0.93,1.00}{\tt font\char45family\char58}} and {\colorbox[rgb]{1.00,0.93,1.00}{\tt src\char58}} in a {\colorbox[rgb]{1.00,0.93,1.00}{\tt \char64font\char45face}} declaration! Completely ignores them! Not only that - not \emph{only} that - it disregards all but the last {\colorbox[rgb]{1.00,0.93,1.00}{\tt \char64font\char45face}} for a given {\colorbox[rgb]{1.00,0.93,1.00}{\tt font\char45family\char58}} attribute string!
547
+
548
+ The implication here is that, to make {\colorbox[rgb]{1.00,0.93,1.00}{\tt \char64font\char45face}} work as it is currently implemented in WebKit (and thus, Safari 3.1), I have to declare \emph{completely imaginary, non-existent type families} to satisfy WebKit alone. Here's the method I have used in the places I current implement {\colorbox[rgb]{1.00,0.93,1.00}{\tt \char64font\char45face}}:
549
+
550
+ \begin{verbatim}@font-face {
551
+ font-family: 'Diavlo Book';
552
+ src: url(./Diavlo/Diavlo_Book.otf) format("opentype");
553
+ }
554
+
555
+ @font-face {
556
+ font-family: 'Diavlo Black';
557
+ src: url(./Diavlo/Diavlo_Black.otf) format("opentype");
558
+ }
559
+
560
+ h1, h2, h3, h4, h5, h6 {
561
+ font-family: 'Diavlo Black';
562
+ }
563
+
564
+ div#content {
565
+ font-family: 'Diavlo Book';
566
+ }\end{verbatim}
567
+ Isn't it horrible? Seriously, my eyes, they bleed. There's lots of problems with this far beyond the lack of semanticity when it comes to the typeface names\ldots{} let me see how many ways this breaks the purpose of {\colorbox[rgb]{1.00,0.93,1.00}{\tt \char64font\char45face}}:
568
+
569
+ \begin{itemize}%
570
+ \item You remove a large element our control over the display of the page.
571
+
572
+ As soon as we begin to use {\colorbox[rgb]{1.00,0.93,1.00}{\tt \char64font\char45face}} in our page, we can no longer make any use of any other textual control attribute - {\colorbox[rgb]{1.00,0.93,1.00}{\tt font\char45weight\char58}}, {\colorbox[rgb]{1.00,0.93,1.00}{\tt font\char45style\char58}}, and {\colorbox[rgb]{1.00,0.93,1.00}{\tt font\char45variant\char58}} are no longer available to us, because they no longer correctly map to technical typeface variant/features.
573
+
574
+ Also, many default elements are destroyed, unusable, without `fixing' - for instance, {\colorbox[rgb]{1.00,0.93,1.00}{\tt \char60b\char62}} would have no effect in a page styled for WebKit as above; We would have to specify something like {\colorbox[rgb]{1.00,0.93,1.00}{\tt b\char32\char123font\char45family\char58\char32\char39Diavlo\char32Black\char39\char59\char125}} - how broken is that? Unless we caught all such default elements and re-styled them to use the bastardized names instead of the correct attributes, lots of basic HTML formatting would be broken. I myself may never use in-document formatting (separation of design and content!), but what about comments forms? Forum posts? Direct HTML-literal quotes?
575
+
576
+ If we want to use Javascript to modify the display of the content, we can't simply adjust the mentioned textual control attributes - we have to know and change the entire {\colorbox[rgb]{1.00,0.93,1.00}{\tt font\char45family\char58}} array of strings.
577
+
578
+
579
+ \item You make us very wet.
580
+
581
+ And by wet, I mean `not DRY'. What if we decide to change one of the bastardized font names? Or use a different font entirely? We have to go through all of our CSS, all of our Javascript, and make sure we update every occurrence of the typeface's bastardized name.
582
+
583
+
584
+ \item You remove our user's user choice, and waste bandwidth.
585
+
586
+ Since the names refer to families that don't, in fact, exist, the browser can't override the declaration with a user's installed version of the typeface. This means that, regardless of whether the user already has the typeface installed on their own computer, the browser won't use that - it doesn't know to use `Diavlo', which the user has installed, because it was told to use `Diavlo Black', which no user in the entire world has installed on their computer.
587
+
588
+
589
+
590
+ \end{itemize}
591
+ This whole thing is rather worrying - I've heard Opera has {\colorbox[rgb]{1.00,0.93,1.00}{\tt \char64font\char45face}} support, though I haven't had time to test this myself, so I don't know if it actually does - or, for that matter, if it does it `correctly', or has the same problems as WebKit. But either way, WebKit is one of the first two implementations to ever attempt to support {\colorbox[rgb]{1.00,0.93,1.00}{\tt \char64font\char45face}} (Microsoft's unrelated {\colorbox[rgb]{1.00,0.93,1.00}{\tt \char64font\char45face}} declaration notwithstanding) - I really don't want to see it's early mistakes carried on to FireFox in a few years, and then Internet Explorer a few decades after that. That will leave us stuck with this broken system forever, as it has been demonstrated time and time again that if nobody else supports an old standard correctly, a newcomer to the standard will not do it correctly either. I for one would really, really, hate that.
592
+
593
+ In summary\ldots{} come on, WebKit team, this isn't like you - you're always the ones with the closest-to-standard implementation, and the cleanest code, and\ldots{} hell, overall? Webkit is the most secure/fastest browser available. But this is making me lose my faith in you, guys, please get it right. You're pioneering a leap into the future when it comes to the Web - this is as important, or \emph{more} important, than Mosiac's allowing of images was.
594
+
595
+ To put it succinctly - don't fuck this up, y'all.
596
+ *** Output of to_md ***
597
+ WebKit (Safari 3.1) and the CSS @font-face declarationI m a big fan of typography in general.
598
+ If you check out my homepageor my
599
+ contact elliottcablepage, and you re
600
+ using Safari/WebKit or Opera/Kestrel,
601
+ you ll notice the typefaces (fonts, as
602
+ colloquialized) are verynon-standard.
603
+ (As of this writing, I m using Museoand
604
+ Diavloheavily on both.)
605
+
606
+ The internet has not be a friendly
607
+ place for typohiles like myself, up to
608
+ this point, at least. One might even
609
+ say it was a frightful, mentally
610
+ scarring environment for those akin to
611
+ yours truly. We ve been restricted to
612
+ reading page after page after page on
613
+ day after day after day for year after
614
+ year after year abominations of markup
615
+ and design enslaved by the horrible
616
+ overlords we know as Lucida, Verdana,
617
+ Arial, Helvetica, Geneva, Georgia,
618
+ Courier, and dare I invoke ye, thou my
619
+ terrible overlord? Times New Roman.
620
+
621
+ Wherefore art thou, my glorious Archer?
622
+ And thee as well, my beautiful
623
+ Garamond? The technical restrictions of
624
+ that horrible monster we know as the
625
+ Web Browser hath forced us all too long
626
+ to use those most banal, those most
627
+ common, and those most abused, out of
628
+ all of the typefaces of the world.
629
+
630
+ All hyperbole aside, I m extremely
631
+ happy to see the advent of a standard
632
+ declaration in CSS. Internet Explorer
633
+ first implemented a crutched, basic
634
+ version of this way back in version 4,
635
+ but nothing ever really came of it -
636
+ their decision to create the
637
+ proprietary .EOT format to appease
638
+ overly restrictive type foundries
639
+ worries about intellectual property
640
+ (aka. the cold, hard dominatrix that we
641
+ know only as Ms. Profit) truly and
642
+ completely killed that initial attempt
643
+ at bringing astute typography and it s
644
+ advocates to the web. This new run at
645
+ by an established, trusted, and open
646
+ group (the W3Citself, responsible for
647
+ helping to make much of what we use as
648
+ designers on the web standard and
649
+ cross-system compatible) has a much
650
+ better chance, in my humble opinion -
651
+ and I am quite looking forward to the
652
+ consequences if it succeeds.
653
+
654
+ Now, onwards to the topic of my post as
655
+ declared in the header (yes, I know, a
656
+ slow start - but it s an interesting
657
+ topic with an interesting history!).
658
+ WebKit, the open source rendering
659
+ engine behind the wonderfulness that is
660
+ Safari, and how it handles the new
661
+ declaration. No, it s not really new ,
662
+ but yes, it feels like it is.
663
+
664
+ To put it simply, and to be very blunt,
665
+ it s broken.
666
+
667
+ The CSS spec sectionfor is very
668
+ specific - typefaces are to be selected
669
+ based on a wide array of criteria
670
+ placed in the declaration block itself.
671
+ Various textual CSS attributes may be
672
+ defined within the declaration, and
673
+ then they will be checked when the
674
+ typeface is referred to later in the
675
+ CSS. For instance, if I have two
676
+ declarations for the Diavlo family -
677
+ one for regular text, and one for a
678
+ heavier weighted version of the
679
+ typeface - then I later utilize Diavlo
680
+ in a attribute, it should refer to the
681
+ basic Diavlo font defined in the first
682
+ . However, if I were to do the same,
683
+ but also specify a heavy , then it
684
+ should use the heavier version of
685
+ Diavlo. To place this example in code:
686
+
687
+ As you can see, my headings should use
688
+ the typeface defined in , while my body
689
+ content should use . However, in
690
+ WebKit, this doesn t work - it
691
+ completely ignores any attribute except
692
+ and in a declaration! Completely
693
+ ignores them! Not only that - not only
694
+ that - it disregards all but the last
695
+ for a given attribute string!
696
+
697
+ The implication here is that, to make
698
+ work as it is currently implemented in
699
+ WebKit (and thus, Safari 3.1), I have
700
+ to declare
701
+ completely imaginary, non-existent type families
702
+ to satisfy WebKit alone. Here s the
703
+ method I have used in the places I
704
+ current implement :
705
+
706
+ Isn t it horrible? Seriously, my eyes,
707
+ they bleed. There s lots of problems
708
+ with this far beyond the lack of
709
+ semanticity when it comes to the
710
+ typeface names let me see how many ways
711
+ this breaks the purpose of :
712
+
713
+ -You remove a large element our control over the display of the page.
714
+ As soon as we begin to use in our page, we can no longer make any use of any other textual control attribute - , , and are no longer available to us, because they no longer correctly map to technical typeface variant/features.
715
+ Also, many default elements are destroyed, unusable, without fixing - for instance, would have no effect in a page styled for WebKit as above; We would have to specify something like - how broken is that? Unless we caught all such default elements and re-styled them to use the bastardized names instead of the correct attributes, lots of basic HTML formatting would be broken. I myself may never use in-document formatting (separation of design and content!), but what about comments forms? Forum posts? Direct HTML-literal quotes?
716
+ If we want to use Javascript to modify the display of the content, we cant simply adjust the mentioned textual control attributes - we have to know and change the entire array of strings.
717
+ -ou make us very wet.
718
+ And by wet, I mean not DRY. What if we decide to change one of the bastardized font names? Or use a different font entirely? We have to go through all of our CSS, all of our Javascript, and make sure we update every occurrence of the typefaces bastardized name.
719
+ -You remove our users user choice, and waste bandwidth.
720
+ Since the names refer to families that dont, in fact, exist, the browser cant override the declaration with a users installed version of the typeface. This means that, regardless of whether the user already has the typeface installed on their own computer, the browser wont use that - it doesnt know to use Diavlo, which the user has installed, because it was told to use Diavlo Black, which no user in the entire world has installed on their computer.
721
+
722
+ This whole thing is rather worrying - I
723
+ ve heard Opera has support, though I
724
+ haven t had time to test this myself,
725
+ so I don t know if it actually does -
726
+ or, for that matter, if it does it
727
+ correctly , or has the same problems as
728
+ WebKit. But either way, WebKit is one
729
+ of the first two implementations to
730
+ ever attempt to support (Microsoft s
731
+ unrelated declaration notwithstanding)
732
+ - I really don t want to see it s early
733
+ mistakes carried on to FireFox in a few
734
+ years, and then Internet Explorer a few
735
+ decades after that. That will leave us
736
+ stuck with this broken system forever,
737
+ as it has been demonstrated time and
738
+ time again that if nobody else supports
739
+ an old standard correctly, a newcomer
740
+ to the standard will not do it
741
+ correctly either. I for one would
742
+ really, really, hate that.
743
+
744
+ In summary come on, WebKit team, this
745
+ isn t like you - you re always the ones
746
+ with the closest-to-standard
747
+ implementation, and the cleanest code,
748
+ and hell, overall? Webkit is the most
749
+ secure/fastest browser available. But
750
+ this is making me lose my faith in you,
751
+ guys, please get it right. You re
752
+ pioneering a leap into the future when
753
+ it comes to the Web - this is as
754
+ important, or moreimportant, than
755
+ Mosiac s allowing of images was.
756
+
757
+ To put it succinctly - don t fuck this
758
+ up, y all.
759
+
760
+ CSS: Cascading Style Sheets.EOT:
761
+ Embedded OpenType : To give Microsoft a
762
+ little credit, something I rarely do
763
+ Yes, I m aware Microsoft submitted EOT
764
+ to the W3C as a proposal - the problem
765
+ isn t with their attempts to make it
766
+ non-proprietary, but with the basic
767
+ concept of making typefaces on the web
768
+ DRMed. Look what such attempts have
769
+ done to the music and video industry -
770
+ simply decimated it. Do we really want
771
+ to see the same thing happen to our
772
+ beloved medium as typography moves into
773
+ the 21st century?
774
+ W3C: World Wide Web Consortium
775
+ *** Output of to_s ***
776
+ WebKit (Safari 3.1) and the CSS @font-face declarationIm a big fan of typography in general. If you check out my homepage or my contact elliottcable page, and youre using Safari/WebKit or Opera/Kestrel, youll notice the typefaces (fonts, as colloquialized) are very non-standard. (As of this writing, Im using Museo and Diavlo heavily on both.)The internet has not be a friendly place for typohiles like myself, up to this point, at least. One might even say it was a frightful, mentally scarring environment for those akin to yours truly. Weve been restricted to reading page after page after page on day after day after day for year after year after year abominations of markup and design enslaved by the horrible overlords we know as Lucida, Verdana, Arial, Helvetica, Geneva, Georgia, Courier, and dare I invoke ye, thou my terrible overlord? Times New Roman.Wherefore art thou, my glorious Archer? And thee as well, my beautiful Garamond? The technical restrictions of that horrible monster we know as the Web Browser hath forced us all too long to use those most banal, those most common, and those most abused, out of all of the typefaces of the world.All hyperbole aside, Im extremely happy to see the advent of a standard declaration in CSS. Internet Explorer first implemented a crutched, basic version of this way back in version 4, but nothing ever really came of it - their decision to create the proprietary .EOT format to appease overly restrictive type foundries worries about intellectual property (aka. the cold, hard dominatrix that we know only as Ms. Profit) truly and completely killed that initial attempt at bringing astute typography and its advocates to the web. This new run at by an established, trusted, and open group (the W3C itself, responsible for helping to make much of what we use as designers on the web standard and cross-system compatible) has a much better chance, in my humble opinion - and I am quite looking forward to the consequences if it succeeds.Now, onwards to the topic of my post as declared in the header (yes, I know, a slow start - but its an interesting topic with an interesting history!). WebKit, the open source rendering engine behind the wonderfulness that is Safari, and how it handles the new declaration. No, its not really new, but yes, it feels like it is.To put it simply, and to be very blunt, its broken.The CSS spec section for is very specific - typefaces are to be selected based on a wide array of criteria placed in the declaration block itself. Various textual CSS attributes may be defined within the declaration, and then they will be checked when the typeface is referred to later in the CSS. For instance, if I have two declarations for the Diavlo family - one for regular text, and one for a heavier weighted version of the typeface - then I later utilize Diavlo in a attribute, it should refer to the basic Diavlo font defined in the first . However, if I were to do the same, but also specify a heavy , then it should use the heavier version of Diavlo. To place this example in code:As you can see, my headings should use the typeface defined in , while my body content should use . However, in WebKit, this doesnt work - it completely ignores any attribute except and in a declaration! Completely ignores them! Not only that - not only that - it disregards all but the last for a given attribute string!The implication here is that, to make work as it is currently implemented in WebKit (and thus, Safari 3.1), I have to declare completely imaginary, non-existent type families to satisfy WebKit alone. Heres the method I have used in the places I current implement :Isnt it horrible? Seriously, my eyes, they bleed. Theres lots of problems with this far beyond the lack of semanticity when it comes to the typeface names let me see how many ways this breaks the purpose of :You remove a large element our control over the display of the page.As soon as we begin to use in our page, we can no longer make any use of any other textual control attribute - , , and are no longer available to us, because they no longer correctly map to technical typeface variant/features.Also, many default elements are destroyed, unusable, without fixing - for instance, would have no effect in a page styled for WebKit as above; We would have to specify something like - how broken is that? Unless we caught all such default elements and re-styled them to use the bastardized names instead of the correct attributes, lots of basic HTML formatting would be broken. I myself may never use in-document formatting (separation of design and content!), but what about comments forms? Forum posts? Direct HTML-literal quotes?If we want to use Javascript to modify the display of the content, we cant simply adjust the mentioned textual control attributes - we have to know and change the entire array of strings.You make us very wet.And by wet, I mean not DRY. What if we decide to change one of the bastardized font names? Or use a different font entirely? We have to go through all of our CSS, all of our Javascript, and make sure we update every occurrence of the typefaces bastardized name.You remove our users user choice, and waste bandwidth.Since the names refer to families that dont, in fact, exist, the browser cant override the declaration with a users installed version of the typeface. This means that, regardless of whether the user already has the typeface installed on their own computer, the browser wont use that - it doesnt know to use Diavlo, which the user has installed, because it was told to use Diavlo Black, which no user in the entire world has installed on their computer.This whole thing is rather worrying - Ive heard Opera has support, though I havent had time to test this myself, so I dont know if it actually does - or, for that matter, if it does it correctly, or has the same problems as WebKit. But either way, WebKit is one of the first two implementations to ever attempt to support (Microsofts unrelated declaration notwithstanding) - I really dont want to see its early mistakes carried on to FireFox in a few years, and then Internet Explorer a few decades after that. That will leave us stuck with this broken system forever, as it has been demonstrated time and time again that if nobody else supports an old standard correctly, a newcomer to the standard will not do it correctly either. I for one would really, really, hate that.In summary come on, WebKit team, this isnt like you - youre always the ones with the closest-to-standard implementation, and the cleanest code, and hell, overall? Webkit is the most secure/fastest browser available. But this is making me lose my faith in you, guys, please get it right. Youre pioneering a leap into the future when it comes to the Web - this is as important, or more important, than Mosiacs allowing of images was.To put it succinctly - dont fuck this up, yall.CSS: Cascading Style Sheets.EOT: Embedded OpenType : To give Microsoft a little credit, something I rarely do Yes, Im aware Microsoft submitted EOT to the W3C as a proposal - the problem isnt with their attempts to make it non-proprietary, but with the basic concept of making typefaces on the web DRMed. Look what such attempts have done to the music and video industry - simply decimated it. Do we really want to see the same thing happen to our beloved medium as typography moves into the 21st century? W3C: World Wide Web Consortium