Exemplo n.º 1
0
 def _testFont(self, TheFont):
     result = []
     for anyGlyph in TheFont.glyphs:
         myBBox = None
         myBBox = trueBBox(anyGlyph)
         if type(myBBox) != type(None):
             if myBBox.height > TheFont.upm * 1.5:
                 print myBBox.ll, myBBox.ur
                 for c in anyGlyph.components:
                     print TheFont.glyphs[c.index]
                     b = trueBBox(TheFont.glyphs[c.index]),
                     print b
                 result.append(anyGlyph.name + ': ' + str(myBBox.height))
     return result
Exemplo n.º 2
0
 def _testFont(self, TheFont):
     result = []
     isAny = False
     for anyGlyph in TheFont.glyphs:
         compoCount = len(anyGlyph.components)
         if compoCount > 0:
             isAny = True
             rectDict = {}
             for i in range(compoCount):
                 tempGlyph = Glyph(
                     anyGlyph.parent.glyphs[anyGlyph.components[i].index])
                 if len(tempGlyph) > 0:
                     tempGlyph.Scale(anyGlyph.components[i].scale,
                                     Point(0, 0))
                     tempGlyph.Shift(anyGlyph.components[i].delta)
                     rectDict[i] = trueBBox(tempGlyph)
                 else:
                     rectDict[i] = None
             for i in range(compoCount):
                 for j in range(compoCount):
                     if i != j:
                         if type(rectDict[i]) != type(None) and type(
                                 rectDict[j]) != type(None):
                             if rectDict[i].Check(
                                     rectDict[j]
                             ) and anyGlyph.name not in result:
                                 result.append(anyGlyph.name)
     if isAny:
         return result
     else:
         return None
Exemplo n.º 3
0
 def _testFont(self, TheFont):
     result = []
     isAny = False
     for anyGlyph in TheFont.glyphs:
         myRSB = getRSB(anyGlyph)
         if myRSB != None and myRSB < 0:
             myBBox = trueBBox(anyGlyph)
             if abs(myRSB) > myBBox.width * 0.5:
                 result.append(anyGlyph.name + ': ' + str(myRSB))
     return result
Exemplo n.º 4
0
 def _testFont(self, TheFont):
   result = []
   isAny = False
   for anyGlyph in TheFont.glyphs:
     myRSB = getRSB(anyGlyph)
     if myRSB != None and myRSB < 0:
       myBBox = trueBBox(anyGlyph)
       if abs(myRSB) > myBBox.width * 0.5 :
         result.append(anyGlyph.name + ': ' + str(myRSB))
   return result
Exemplo n.º 5
0
 def _testFont(self, TheFont):
   result = None
   for anyGlyph in TheFont.glyphs:
     if len(anyGlyph) > 0 and len(anyGlyph.hhints) > 0:
       if result == None:
         result = []
       myBBox = trueBBox(anyGlyph)
       myRange = xrange(myBBox.ll.y, myBBox.ur.y + 1)
       for anyHHint in anyGlyph.hhints:
         if anyHHint.position not in myRange or anyHHint.position + anyHHint.width not in myRange:
           result.append('%s: (p=%s, w=%s)' % (anyGlyph.name, anyHHint.position, anyHHint.width))
   return result
Exemplo n.º 6
0
 def _testFont(self, TheFont):
     result = []
     for anyGlyph in TheFont.glyphs:
         if len(anyGlyph) > 0:
             for i in range(anyGlyph.GetContoursNumber()):
                 myBBox = trueBBox(
                     Glyph(
                         1, anyGlyph[anyGlyph.GetContourBegin(i):anyGlyph.
                                     GetContourBegin(i) +
                                     anyGlyph.GetContourLength(i)]))
                 result.append(myBBox.width * myBBox.height)
     return result
Exemplo n.º 7
0
 def _testFont(self, TheFont):
     result = None
     for anyGlyph in TheFont.glyphs:
         if len(anyGlyph) > 0 and len(anyGlyph.vhints) > 0:
             if result == None:
                 result = []
             myBBox = trueBBox(anyGlyph)
             myRange = xrange(myBBox.ll.x, myBBox.ur.x + 1)
             for anyVHint in anyGlyph.vhints:
                 if anyVHint.position not in myRange or anyVHint.position + anyVHint.width not in myRange:
                     result.append(
                         '%s: (p=%s, w=%s)' %
                         (anyGlyph.name, anyVHint.position, anyVHint.width))
     return result
Exemplo n.º 8
0
 def _testFont(self, TheFont):
     result = []
     for anyGlyph in TheFont.glyphs:
         if len(anyGlyph) > 0:
             for i in range(anyGlyph.GetContoursNumber()):
                 myBBox = trueBBox(
                     Glyph(
                         1, anyGlyph[anyGlyph.GetContourBegin(i):anyGlyph.
                                     GetContourBegin(i) +
                                     anyGlyph.GetContourLength(i)]))
                 myArea = myBBox.width * myBBox.height
                 if myArea < 100:
                     result.append(anyGlyph.name + ' (' +
                                   str(int(myBBox.x)) + ',' +
                                   str(int(myBBox.y)) + ')')
     return result