Doing Web Typography with a Print Mindset
CSS is one of the most important typographic innovations of modern times. As long as a document is stored with a sufficiently “semantic” structure, different style rules can give it different appearances. We no longer need to arrange and stretch text by hand; we give instructions through CSS and the layout engine obeys.
Perhaps because my mother had beautiful handwriting, I held myself to strict standards of penmanship from childhood. Even when taking notes in class, if after a few characters I noticed that the previous line was slightly misaligned or uneven in size, I would obsessively want to tear up the whole page and start again. So when I first understood how the Web works, the shock and resonance were intense: text could actually be stored without styling, and then “markup” could be used to design styles for text of different levels and meanings. It freed those of us perfectionist obsessives with bad handwriting.
It doesn’t matter if your handwriting is ugly; CSS can sort everything out.
Hacking complex layout in the browser
Hanzi—or indeed every language and script—have developed their own distinctive ways of writing and typesetting over the ages, independently or influencing one another. Today’s Web standards, and even professional layout software, cannot yet support these features fully and correctly.
After studying CSS and JavaScript in depth, I found that some complex layout features could be achieved in Web browsers. Web standards still fall short and browser development takes ages, so to let more people use advanced typographic features on the Web sooner, I bundled the layout features I had implemented and open-sourced them as “Han.css”.
Its tagline is “the Hanzi typesetting framework, as fine as print,” precisely because I want to typeset in the browser with the rigour we bring to print. But it does not imitate print wholesale: web pages present content as a scroll, for instance, so blank lines suit them better than first-line indents for separating paragraphs.
Although a few dirty hacks are unavoidable, Han.css is on the whole usable. Larger projects such as Moedict, and smaller ones such as a Japanese Twitter friend’s blog, all use Han.css. If your project involves Chinese layout, Traditional or Simplified, please consider giving it a try.
Recently I added to Han.css two features I consider the most important—compression of punctuation at line start and end and hanging punctuation at line end. The implementation is very different from the Web versions of ebook readers such as Baidu Yuedu and Duokan; interested developers can see my source code on GitHub.
This is also a “political” idea
Recording the Kernel Panic podcast, the host Li Ruyi asked me: “Do you hope to convey your own political views through the Han.css framework?”
I was a bit nervous and answered too much like an official. I pay close attention to politics and love talking about it; nine out of ten of my Twitter posts are about politics. But in designing Han.css I avoided controversy as much as possible, even “self-censoring” the sample text. The framework provides default styles for Traditional Chinese, Simplified Chinese and Japanese, hoping to match the reading habits of all kinds of users as far as possible (though with my limited energy I cannot maintain manuals for several languages). Setting aside personal political preferences in favour of a more politically correct idea of seeking common ground while respecting differences—that too is a political idea.
At the same time, the framework includes supplements to, and small protests against, the shortcomings of current official standards. Many Simplified Chinese users would agree that curly quotation marks borrowed from English don’t really suit Chinese characters. And I avoid as far as possible the Kai-like glyphs of Taiwan’s “Standard Form of National Characters,” which many Traditional Chinese users dislike.
Taiwan’s Ministry of Education Punctuation Handbook used to prescribe a wavy underline (﹏) as the book-title mark. But a recent revision added (without replacing it) the mainland’s angle brackets (《》〈〉) as “book-title mark type B,” with finer semantic distinctions. Has Taiwan suddenly endorsed mainland punctuation rules? The real reason is this: the mark was first brought in by Taiwanese publishers from Simplified Chinese books, came into wide and ubiquitous use—in everything but textbooks—and only then was accepted by the Ministry.
Deep down we all welcome standards and like things to have rules to follow. When people develop new needs, standards must improve accordingly; when a standard is imperfect, overturn it and create a better one.
“Specification” or “requirements”?
I had the privilege of helping write CLReq.For CLReq’s main audience—the makers of Web standards—it is a statement of requirements for Chinese layout. It sets out in detail the layout requirements of Chinese, distinctive or not, so that future layout languages can support Chinese correctly.
In fact, during the past year of writing it, I kept calling it the “Chinese layout specification,” and only later corrected that to “Chinese layout requirements.” Please forgive the inaccurate name. Looking back, though, every editor involved has always written the document as a compilation of requirements. There are hardly any “musts” in it; mostly it uses “may” to guide readers on how to handle various situations.
For beginners in layout or the Web, calling CLReq a specification is not really a problem—just as JLReq has become a textbook of Japanese layout thanks to its thoroughness. But note: CLReq recommends practices; it does not mandate them.
So long as legibility is respected, layout is more a pursuit of taste and an expression of care for readers. You follow CLReq because you agree with it, not because it is a (finger-quotes) specification or standard.[1]
Traditional versus Simplified
Tsai Chih-hao once said that Simplified and Traditional Chinese are both contemporary, valid scripts used by countless people; there is no need to argue over which is orthodox.
Traditional and Simplified Chinese are very similar, yet have different problems and needs. CLReq applies to both; where they differ, we describe the differences in as much detail as we can, and where they are the same, we don’t distinguish them for the sake of it.[2]
If requirements that apply to only one take up more space, it is simply because they are more complex and “harder to handle”—not because of any personal or regional preference on the editors’ part. (A secret: the editor who wrote the section on zhuyin in interlinear annotation actually hates zhuyin.)
We are only experts in quotation marks
Most of the editors of CLReq are not members of W3C member organisations, let alone employed by W3C. To make it easier to deliver CLReq’s work to W3C, we were given the “title” of “invited experts”—not because W3C esteems our personal experience or expertise.[3]
The editors came together out of interest; we are only experts in quotation marks, and our findings need to be tested by real experts. Questions of any kind are welcome on CLReq’s GitHub project.
On Type is Beautiful (now The Type), this article was set with Han.css to optimise the layout, including spacing between Chinese and Western text, punctuation compression, hanging punctuation and emphasis marks.
Notes:
- CLReq is currently (2015) still a draft, with much content and many illustrations unfinished. Believing everything in a book is worse than having no book; please read it as you would Wikipedia.↩
- Many friends ask whether has a Simplified Chinese version. In fact, the current CLReq draft covers both Traditional and Simplified Chinese. Because the overall structure was drafted by Bobby Tung, there is more Traditional than Simplified, and the content is still being added to, so this is not the stage to split it into several versions. Once it is largely finalised in mid-2015, Traditional and Simplified versions will be published; this is all planned, so there is no need to worry.↩
- Invited Expert and Collaborator Agreement – W3C ↩








