diff --git a/Lib/ufo2ft/postProcessor.py b/Lib/ufo2ft/postProcessor.py index 34b91d7d..41da0852 100644 --- a/Lib/ufo2ft/postProcessor.py +++ b/Lib/ufo2ft/postProcessor.py @@ -148,7 +148,7 @@ def process_glyph_names(self, useProductionNames=None): useProductionNames = self.ufo.lib.get( USE_PRODUCTION_NAMES, not self.ufo.lib.get(GLYPHS_DONT_USE_PRODUCTION_NAMES) - and self._postscriptNames is not None, + and self._postscriptNames, ) else: keepGlyphNames = True diff --git a/tests/outlineCompiler_test.py b/tests/outlineCompiler_test.py index c6e1786d..c4b6129b 100644 --- a/tests/outlineCompiler_test.py +++ b/tests/outlineCompiler_test.py @@ -958,6 +958,12 @@ def test_compile_with_custom_postscript_names_notdef_preserved( "lll", ] + def test_empty_postscript_names_no_rename(self, testufo): + testufo.lib["public.postscriptNames"] = {} + original_order = compileTTF(testufo, useProductionNames=False).getGlyphOrder() + result = compileTTF(testufo).getGlyphOrder() + assert result == original_order + def test_warn_name_exceeds_max_length(self, testufo, caplog): long_name = 64 * "a" testufo.newGlyph(long_name)