LettError / designSpaceRoboFontExtension

A RoboFont extension for creating and editing designspace documents.
MIT License
29 stars 6 forks source link

Incompatibility of group type reported as problem #48

Open frankrolf opened 1 year ago

frankrolf commented 1 year ago

My colleague @misbatabassum found an issue regarding the Problems report in DesignspaceEdit.

While the glyphs in the respective groups are actually the same, it is the data type of the group representation which differs (tuple vs list).

I attached an example project to reproduce this behavior:

Scenario 1:

Scenario 2:

designspace_edit_group_members.zip

Digging around in the code, I found that this could be circumvented by changing this line from

if sourceGroupMembers != defaultGroupMembers:

to

if list(sourceGroupMembers) != list(defaultGroupMembers):

— but that really just is a band-aid solution.

Probably something is going on here. It seems a different kind of font object is returned via AllFonts as there is via _instantiateFont. Ideally, those should be the same.

This behavior has been reproduced in Robofont 4.3 (public), as well as Robfont Version 4.4b (build 2304041121).

frankrolf commented 1 year ago

I dug some more, and indeed the compared object is different: one of the UFOs is open in RF, the other is submitted as a path to _instantiateFont:

from ufoProcessor import DesignSpaceProcessor
open_font = CurrentFont()
dp = DesignSpaceProcessor()
instantiated_font = dp._instantiateFont('ss_2.ufo')

print(type(open_font))
print(type(instantiated_font))
<class 'lib.fontObjects.fontPartsWrappers.RFont'>
<class 'defcon.objects.font.Font'>