I have decided to use
\fontdimen parameters as an array of numbers (to store data about Unicode Character Properties). The question now is to fill in those
\fontdimen parameters in the most efficient way. I would much prefer methods that work for pdfTeX, XeTeX and LuaTeX.
The most efficient way is to load a
unicodedata.tfm defining a font with many
\fontdimen parameters. The
tfm file format begins with two bytes declaring its size in words (= 32 bits) as a signed integer (see
texdoc tftopl or an old TUGBoat paper), so the maximum number of
\fontdimen parameters declared through a
tfm file is
32738 (slightly less than 2^15 because of some header information). I need around 2^17.
Maybe there exists a file format other than
tfm to provide font metric to TeX?
The other approach, much slower, is to do it inside TeX: something like
\font\foo=cmr10 at 1sp \fontdimen 1\foo = 13459847sp \fontdimen 2\foo = 14839847sp % ... \fontdimen 1114111\foo = 10872349sp
This is (presumably) slower because TeX has to parse each of these dimensions, and each entry takes around 10 characters in a file. Space-wise, this can be improved and reduced to 4 bytes per entry, but that then requires even more work from TeX to decode.