本译文采用与原文相同的许可协议进行授权和传播。
本译文不会对原文做任何除格式调整和拼写错误以外的调整和修改,以确保原文内容的完整性,保证原文所要阐述的事实和思想不被曲解。
- 原文 (英文)
- 中文
I love text layout, and have been working with it in one form or other for over 35 years. Yet, knowledge about it is quite arcane. I don’t believe there is a single place where it’s all properly written down. I have some explanation for that: while basic text layout is very important for UI, games, and other contexts, a lot of the “professional” needs around text layout are embedded in much more complicated systems such as Microsoft Word or a modern Web browser.
我喜欢文本布局,并且已经以不同形式和它打了 35 年交道。 然而,有关它的知识还是相当晦涩。 我不认为在某一个地方就能够详尽地阐述它,因为: 虽然基本的文本布局对 UI、游戏和其他语境非常重要, 但在如微软 Word 和现代 Web 浏览器这些更复杂的系统中, 掌握文本布局是有许多「专业性」要求的。
- 原文 (英文)
- 中文
A complete account of text layout would be at least a small book. Since there’s no way I can write that now, this blog post is a small step towards that – in particular, an attempt to describe the “big picture” using the conceptual framework of a “loose hierarchy”. Essentially, a text layout engine breaks the input into finer and finer grains, then reassembles the results into a text layout object suitable for drawing, measurement, and hit testing.
要完整地讲清楚文本布局,至少得写满一小本书。 由于现在我也没办法写这本书,这篇博客文章就算是迈出的一小步, 特别是,以「松散的层级结构」这一概念框架来描述「大图景」的一种尝试。 本质上,文本布局引擎是将输入拆分成很细很细的小块, 再重新组装为一个适用于塑形、测量和命中测试的文本布局对象。
译注:有关「命中测试」的概念, 请参考 Hit-Testing in iOS (原文地址https://smnh.me/hit-testing-in-ios)。
- 原文 (英文)
- 中文
The main hierarchy is concerned with laying out the entire paragraph as a single line of text. Line breaking is also important, but has a separate, parallel hierarchy.
主要层级结构关注的是将整个段落布局为一行文本。 换行也同样重要,但具有独立的、平行的层级结构。