SOLVED RGlyph.area method only works on glyphs with contours.

  • Is it possible to add the ability to make RGlyph.area to work on glyphs which have components? Right now it only works on glyphs which have contours, but on glyphs with components it gives this error:

      File "/Applications/", line 90, in __get__
      File "/Applications/", line 106, in _get_area
      File "/Applications/", line 278, in _get_area
      File "/Applications/", line 313, in getRepresentation
      File "/Applications/", line 44, in glyphAreaRepresentationFactory
      File "/Applications/", line 479, in draw
      File "/Applications/", line 491, in drawPoints
      File "/Applications/", line 185, in drawPoints
      File "/Applications/", line 222, in addComponent
      File "/Applications/", line 176, in addComponent
    TypeError: 'NoneType' object is not subscriptable


  • @gferreira
    Thanks Gustavo, this is the solution I used too in the meanwhile.

    Looking forward to get the update!

  • admin

  • admin

    no glyphset is provided in defcon see

    a fix will follow shortly

  • hello @bahman,

    I agree it would be nice if it just worked with components too. not sure at which level to add it though: defcon or fontParts or mojo.roboFont?

    in the meantime, you can get it to work using the DecomposePointPen:

    from mojo.pens import DecomposePointPen
    g = CurrentGlyph()
    g2 = RGlyph()
    g.drawPoints(DecomposePointPen(g.font, g2.getPointPen()))


Log in to reply