CFF: use latin1 so we can roundtrip non-ascii in FullName|FontName|FamilyName

Fixes #2898

use Latin1Converter for all name strings, and not just for Notice and Copyright. Then at least we can round-trip binary=>TTF=>binary, even if the TTX will not show the intended string.

Given that any non-ASCII in FullName can be considered broken, this at least this would let us round-trip without error.
This commit is contained in:
Cosimo Lupo 2023-07-10 18:12:49 +01:00
parent 4660b8c359
commit a8bd0ef1b0
No known key found for this signature in database
GPG Key ID: DF65A8A5A119C9A8

View File

@ -2172,9 +2172,9 @@ topDictOperators = [
(0, "version", "SID", None, None), (0, "version", "SID", None, None),
(1, "Notice", "SID", None, Latin1Converter()), (1, "Notice", "SID", None, Latin1Converter()),
((12, 0), "Copyright", "SID", None, Latin1Converter()), ((12, 0), "Copyright", "SID", None, Latin1Converter()),
(2, "FullName", "SID", None, None), (2, "FullName", "SID", None, Latin1Converter()),
((12, 38), "FontName", "SID", None, None), ((12, 38), "FontName", "SID", None, Latin1Converter()),
(3, "FamilyName", "SID", None, None), (3, "FamilyName", "SID", None, Latin1Converter()),
(4, "Weight", "SID", None, None), (4, "Weight", "SID", None, None),
((12, 1), "isFixedPitch", "number", 0, None), ((12, 1), "isFixedPitch", "number", 0, None),
((12, 2), "ItalicAngle", "number", 0, None), ((12, 2), "ItalicAngle", "number", 0, None),