Introducing FDArray Test

(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 the FDArray Test 257 font, 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 the FDArray Test 65535 font, 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 ‘cmap‘ table (when the surrogates and non-characters are factored out, Unicode has 1,111,998 possible mappings in its 17 planes). I have sometimes made these fonts available, such as in this 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 (aka the least significant byte): 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 (aka the second least significant byte): 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! 🍷

Comments are closed.