Traceback when sorting AllFonts()

  • Hey,

    I was trying to sort the fonts in my AllFonts list.
    For this I turned to this page in the documentation. But when I try something like:

    fonts = AllFonts()

    I get the following traceback.

    Traceback (most recent call last):
      File "lib/fontObjects/fontPartsWrappers.pyc", line 1955, in sortBy
      File "/Applications/", line 550, in getAttrWithFallback
    KeyError: 's'
    During handling of the above exception, another exception occurred:
    Traceback (most recent call last):
      File "", line 2, in <module>
      File "lib/fontObjects/fontPartsWrappers.pyc", line 1957, in sortBy
      File "lib/fontObjects/fontPartsWrappers.pyc", line 1132, in __getattribute__
      File "/Applications/", line 82, in __getattribute__
    AttributeError: 'RInfo' object has no attribute 's'

    Is this not really implemented yet?
    Or should this be used differently?

    Thanks in advance!

  • admin

    This changed to a list of info attributes, see

  • Ah, awesome.
    I got it to work now with fonts.sortBy(sortOptions=['openTypeOS2WeightClass','styleName']).
    Thanks for the quick reply.

    Sidenote: Isn’t it a bit confusing that the implementation of is called mojo.roboFont.FontsList?

  • admin

    @benedikt said in Traceback when sorting AllFonts():

    these functionalities should be provided by an implementation and not by fontParts, similar to CurrentFont, CurrentGlyph, CurrentLayer, CurrentContour, CurrentPoint,... FontList is optional but could be provided by an implementation.

Log in to reply