From a8bd0ef1b01d5d5e2eba885cc735742cfa73d324 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Mon, 10 Jul 2023 18:12:49 +0100 Subject: [PATCH] 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. --- Lib/fontTools/cffLib/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/fontTools/cffLib/__init__.py b/Lib/fontTools/cffLib/__init__.py index be851e348..b5b859fc5 100644 --- a/Lib/fontTools/cffLib/__init__.py +++ b/Lib/fontTools/cffLib/__init__.py @@ -2172,9 +2172,9 @@ topDictOperators = [ (0, "version", "SID", None, None), (1, "Notice", "SID", None, Latin1Converter()), ((12, 0), "Copyright", "SID", None, Latin1Converter()), - (2, "FullName", "SID", None, None), - ((12, 38), "FontName", "SID", None, None), - (3, "FamilyName", "SID", None, None), + (2, "FullName", "SID", None, Latin1Converter()), + ((12, 38), "FontName", "SID", None, Latin1Converter()), + (3, "FamilyName", "SID", None, Latin1Converter()), (4, "Weight", "SID", None, None), ((12, 1), "isFixedPitch", "number", 0, None), ((12, 2), "ItalicAngle", "number", 0, None),