jjgod / blog Random notes by Jjgod Jiang.

Typography

TeX Live 2009 的 LaTeX 中文支持

最近刚发布的 TeX Live 2009 是对中文支持有较大改进的一个版本,这里简单介绍一下。

首先,一如 2007, 2008 版本,TeX Live 2009 有中文版本的安装使用指南,强烈建议在提问前把相关章节好好看看,这份指南主要叙述的是和中文无关的一些通用的问题。

然后 TeX Live 2009 的中文支持主要分为两部分,基于 XeTeX 的,和基于传统 CJK 宏包的。(我这里只讨论 LaTeX 的,如果你希望尝试 ConTeXt 和 luatex,可以参考 Li Yanrui 的 blog,他有很详细的介绍。)

基于 XeTeX 的方案

这是我们推荐的方案,又可分为高层与低层两种,分别适用于不同需求的用户。

首先,安装所需的宏包:

sudo tlmgr install xeCJK ctex

高层的方案是使用 ctex 宏包自带的文档类,例如原来用 article 文档类的就改用 ctexart 文档类,原来用 book 文档类的就改用 ctexbook 文档类,这样绝大部分你会遇到的中文问题,比如字体设置、hyperref 的调用、章节标题的设置等等,都自动为你解决了。详情可以看 ctex 宏包的文档。下面是一个小例子:

\documentclass{ctexart} \begin{document} 你好,TeX Live 2009! \end{document}

默认情况 (winfonts) 下,你需要宋体 (SimSun)、仿宋 (simfang)、黑体 (simhei)、楷体 (simkai)、隶书 [...]

闲聊文本渲染技术的近期发展

在今年 7 月的 GUADEC 上 Behdad Esfahbod 做了一个题为 State of Text Rendering 的讲座,系统地综述了当前文本渲染技术的现状,顺带强调主要由他开发的 harfbuzz-ng 是未来发展的方向,4 个月过去了,最近文本渲染技术有了什么发展呢?这里谈谈我的一些印象和见解。

首先,harfbuzz-ng 到底想做成什么样子?我们知道底层的字体格式支持,开放的有 FreeType 一枝独秀,各平台私有的有 Win32 的 GDI font, Mac OS X 有 ATS 和 CGFont,上层的文本布局排版引擎,现在各家自有一套到两套:Windows 的 DirectWrite 和 Uniscribe;Mac OS X 有 Core Text 和 ATSUI,有 NSLayoutManager;GTK+ 有 pango,都是比较成熟的接口了,那 harfbuzz-ng 是要取代他们吗?

不是,也完全说不通,毕竟 pango 就是 Behdad Esfahbod 自己维护的,没理由拆自己的台。但是开放的 pango 等平台一直缺失的部分是 OpenType 复杂排版特性的支持,这一点 [...]

Text Layout with Core Text (slides)

I did a talk in Cocoaheads Beijing yesterday on the topic “Text Layout with Core Text”, and here is my slides (4 MB, pdf).

I may write a more detailed article on Core Text typesetting later, stay tuned.

Snow Leopard vs. 3rd Party LCD Displays

Update: CWS provided a solution in comment: opening Terminal and entering defaults -currentHost write -globalDomain AppleFontSmoothing -int 2, after re-login, everything is back to normal again!

Update: Turns out the problem is not just from Dell, various 3rd party display manufactures including Samsung, LG, HP and EIZO also have the same issue.

A very tricky issue has [...]

Updates on font changes in Snow Leopard

A few months ago, I’ve covered font related changes in Snow Leopard in this post, that was perceived from developer preview build 10A286, after I got build 10A335 and 10A354, several changes can be observed.

Heiti SC and Heiti TC we covered earlier are now used as the default fallback fonts for Simplified Chinese and Traditional [...]

← Before