Просмотр исходного кода

[generateGlyph] Don't replace glyph for any rule

Before, this would overwrite a glyph with a rule defined as a ligature
(using underscores) but not with other rules. I think it's better to
be consistent at least.
James Godfrey-Kittle 8 лет назад
Родитель
Сommit
386c9fd614
1 измененных файлов с 4 добавлено и 4 удалено
  1. 4 4
      scripts/lib/fontbuild/generateGlyph.py

+ 4 - 4
scripts/lib/fontbuild/generateGlyph.py

@@ -64,6 +64,10 @@ def copyMarkAnchors(f, g, srcname, width):
 
 def generateGlyph(f,gname,glyphList={}):
     glyphName, baseName, accentNames, offset = parseComposite(gname)
+    if f.has_key(glyphName):
+        print('Existing glyph "%s" found in font, ignoring composition rule '
+              '"%s"' % (glyphName, gname))
+        return
 
     if baseName.find("_") != -1:
         g = f.newGlyph(glyphName)
@@ -73,10 +77,6 @@ def generateGlyph(f,gname,glyphList={}):
             setUnicodeValue(g, glyphList)
 
     else:
-        if f.has_key(glyphName):
-            print('Existing glyph "%s" found in font, ignoring composition '
-                  'rule "%s"' % (glyphName, gname))
-            return
         try:
             f.compileGlyph(glyphName, baseName, accentNames)
         except KeyError as e: