summaryrefslogtreecommitdiff
path: root/test/data/Encoding
Commit message (Collapse)AuthorAgeFilesLines
* Add a test for a broken encoding fileJohn-Mark Bell2022-05-221-7/+0
| | | | | | | | | | | | | | This file is broken in a number of ways: * It contains garbage content that does not form valid glyph name specifiers * It contains garbage directives * It tries to define more than 256 glyphs (which is not supported by non-UCS FontManagers) The latter point above uncovered a bug in the umap sanity checking where it failed to properly count the number of glyph indices being defined by the Encoding file.
* "Old" FontManager: improve Encoding file parser.John-Mark Bell2018-01-221-0/+7
In a non-Unicode world, a (non-Base) encoding may define glyphs for up to 256 character codes. Ensure that at most 256 Encoding file entries are used (as, otherwise, the character code will overflow). In particular, if symbol fonts created for the Unicode Font Manager (which does not have a 256 character limit for an encoding) are installed on a non-Unicode-capable system, only the first 256 glyphs in the font are accessible although the Encoding file may have more than 256 entries. Note, however, that the first 32 character codes will never be used as they are considered control codes. Thus, at most 224 usable characters may be defined. A further wrinkle is that glyph names may map to multiple Unicode codepoints, thus consuming multiple slots in the unicode map (which itself has a fixed size of 256 entries). Thus, it is technically possible for the unicode map to further limit the number of usable characters in a font to fewer than 224. However, unless the font is particularly baroque, this isn't a problem in the real world, because there are only 12 glyph names which map to more than one Unicode codepoint (they map to 2, each, for a total of 24 unicode map entries, if they're all present). Thus, to run out of space in the unicode map, you'd need a font which defines at least 4 of those glyphs twice (and defines the others once, and also defines known glyphs for every other character code). Fixes #2577.