Managing XUID Arrays

One question that I am often asked by OpenType CJK font developers is related to the XUID array, which is used by some environments for caching purposes. I decided to use this opportunity to write a brief tutorial on how to manage XUID arrays when developing OpenType CJK fonts.

The XUID array is specified in the CIDFont resource header, and is composed of two or more integer values. The first element in the XUID array is the most important, and is referred to as the Developer ID. The Developer ID is unique for each font developer, and if your organization has not yet registered one, you can register one on the Adobe website. Each organization requires only one Developer ID. Multiple Developer IDs are not required, and are discouraged. Adobe’s Developer ID is 1, and if you inspect the XUID arrays of OpenType CJK fonts that are developed by Adobe, you’ll see that the first element is the integer 1.

The second and subsequent elements of the XUID array are managed by each font developer, and it is up to each font developer to come up with and manage a scheme that ensures that each font includes a unique XUID array. In terms of suggested schemes, the first year of issue, expressed as a four-digit integer, such as “2011” for the current year, serves well as the second element of the XUID array. The third element could use a simple scheme, such as starting with the integer 1, and incrementing this value by one for each subsequent font. The important thing to understand is that the first XUID array element should be your Developer ID, which ensures that your fonts’ XUID arrays do not conflict with those of other font developers.

How many elements can an XUID array specify? The PostScript Language Reference Manual states that the implementation limit is 16, but I have experienced environments that support no more than four elements. Therefore, I recommend that font developers include no more than four elements in their XUID arrays. The minimum number of XUID array elements is two, the first of which is the Developer ID, of course.

When should an XUID array change? In general, the XUID array for each font can remain the same across different versions of the font. If the PostScript name of the font changes, which means the CIDFontName string that is specified in the CIDFont resource header, the XUID array should change. If the number of FDArray elements changes in the font, which is sometimes triggered by supporting a larger glyph set, the XUID array should change.


OpenType中日韩字库(OpenType CJK Font)开发者经常问及关于XUID数列的问题(XUID数列被用于一些环境的缓存中),我想借此机会简要地介绍一下如何管理OpenType中日韩字库的XUID数列。

XUID数列被定义在CIDFont资源头中,由两或多个整数值组成。数列中的第一个数值是最重要的,它是开发者ID(Developer ID),该ID对于每个字体开发者而言都是唯一的,如果您所在的组织还未注册,可以去Adobe网站上申请ID,同个开发者不需要且也不鼓励申请多个开发者ID。Adobe的开发者ID是1,如果您检查过Adobe的Opentype字库,可以看到第一个数值是1。

XUID数列的第二个和后面的数值可以由每个字体开发者自行管理,每个开发者需要构思和遵循一个规则,以确保每个字库包含一个唯一的XUID数列。建议的规则是,用四位整数来表示该字库首次发布的年份,例如当前是”2011″,可以把它作为XUID数列的第二个数值。第三个数值可以用一个简单的规则,例如起始值是1,后续其它字库以一递增该数值。重要的是保证首位数值必须是您开发者的ID,这可以确保您的XUID数列不与其他字库开发者冲突。

XUID数列能包含多少个数值?在PostScript Language Reference Manual中声明限制个数是16,但以我的经验,一般环境所支持的数目不超过四个,因此我推荐字体开发者在设置他们的XUID数列时不要超过四个数值。XUID的数值个数最小是两个,当然第一个数值必须是开发者ID。

什么时候应该修改XUID 数列?一般来说,不同版本的同一字库的XUID数列可以保持一致。如果字库的Postscript名字改变,也就是CIDFont资源头中的CIDFontName字符串改变了,那么XUID数列就需要相应地修改。如果FDArray包含的个数改变了,某些时候为了支持更大的字形集会修改FDArray的个数,这时候XUID数列也需要修改。

4 Responses to Managing XUID Arrays

  1. Amy says:

    This being a blog devoted to fine typography, would it be possible to mark the Chinese sections as Chinese with a lang = “zh-cn” or xml : lang = “zh-cn” tag? My browser defaults to displaying unspecified characters with a Japanese font, which I like as I mostly view Japanese, but on this blog it produces an ugly “ransom note” effect when Meiryo UI falls back to thinner, more pixellated SimSun for characters only found in Simplified Chinese.

    • Many thanks for the suggestion. How does the text appear now for this blog post? I implemented what I think should do what you suggested, but I prefer that you act as the judge.

      • Amy says:

        It works exactly as intended; that is, it forces the whole section to be displayed using my Simplified Chinese font instead of my Japanese font with fallback to Simplified Chinese. Thank you.