Introducing FDArray Test

News|Adobe Blogs|Dr. Ken Lunde 2015-10-16 15:14:14

(The introductory graphic illustrates how the character 剣 (U+5263) is displayed using the fonts that are introduced in this article. The code point for this character maps to a glyph that displays as "63" in theFDArray Test 257font, which is the hexadecimal equivalent of the decimal index of the FDArray element to which its glyph is assigned, which is 99. Likewise, the code point for this character maps to a glyph that displays as "52" in theFDArray Test 65535font, which is the hexadecimal equivalent of the decimal index of the FDArray element to which its glyph is assigned, which is 82.)

I have built several CID-keyed OpenType/CFF fonts that are specifically designed to test various limits, by exercising various implementation limits, such as the number of glyphs (65,535 is the architectural limit), the number of FDArray elements (256 is the architectural limit), and the number of mappings in the 'May of 2012 article that explains how such fonts can be built.

Anyway, I spent pretty much all day yesterday—except for a somewhat longer than usual lunch break that was actually used to watch The Martian (2015) with my wife—preparing a pair of open source CID-keyed OpenType/CFF fonts that exercise these limits but to different degrees, and I also managed to prepare and release the project on GitHub as FDArray Test.

The smaller of the two fonts is named FDArray Test 257, and the 257 refers to its number of glyphs. GID+0 still serves as the mandatory .notdef, and GIDs 1 through 256 are each assigned to their own FDArray element, with indexes from 0 through 255. In other words, the 256 FDArray elements in this font include only one glyph, except for the first one that also includes GID+0. The number of mappings in the Format 12 'cmap' subtable is 1,111,998, which are assigned in ranges of up to 256 glyphs. The glyphs that are shown thus correspond to the seventh and eighth UTF-32 hexadecimal digits of a particular code point: 0xXXXXXXXX. The graphic below shows all 256 functional glyphs, GIDs 1 through 256, in this font (the integer value after the comma in the upper-left corner specifies the index of the FDArray element to which the glyph is assigned):

The larger of the two fonts is named FDArray Test 65535, and the 65535 likewise refers to its number of glyphs. GID+0 continues to serve as the mandatory .notdef, and GIDs 1 through 65534 are assigned to FDArray elements in contiguous ranges of 256 glyphs, with indexes from 0 through 255. The last FDArray element with index 255 includes only 254 glyphs. In other words, each 256 FDArray element in this font includes 256 glyphs, except for the first one that also includes GID+0, and the last one that includes only 254 glyphs. The number of mappings in the Format 12 'cmap' subtable is still 1,111,998, but are assigned in ranges of up to 64,534 glyphs. The glyphs that are shown thus correspond to the fifth and sixth UTF-32 hexadecimal digits of a particular code point: 0xXXXXXXXX.

Of course, these fonts are not terribly useful for creating documents, but should prove to be extremely useful for font consumers—such as font editors and rendering engines—that need to test various implementation limits, such as the ones that these fonts exhibit.

For those who are curious, the glyphs that are used in these fonts are the half-width Latin ones from the ExtraLight weight of Source Han Sans.

Enjoy! 

Light Weight

Light Weight

_Notdef

_Notdef

Pretty

Pretty