-
Notifications
You must be signed in to change notification settings - Fork 45
Closed
Description
Issue:
I ran into a situation in which changing data on a copy of a font was affecting the data on the source font.
f1 = NewFont()
f1.info.postscriptBlueValues = [-10, 0, 50, 60]
f2 = f1.copy()
f2.info.postscriptBlueValues[0] = -2
f2.openInterface()
print(f1.info.postscriptBlueValues)
print(f2.info.postscriptBlueValues)Output:
[-2, 0, 50, 60]
[-2, 0, 50, 60]
Workaround:
The only workaround I was able to find was copying the list data itself. Should this be necessary?
I'm also reassigning rather than editing directly (that part is just me correcting bad practice above).
f1 = NewFont()
f1.info.postscriptBlueValues = [-10, 0, 50, 60]
f2 = f1.copy()
values = f1.info.postscriptBlueValues.copy()
values[0] = -2
f2.info.postscriptBlueValues = values
f2.openInterface()
print(f1.info.postscriptBlueValues)
print(f2.info.postscriptBlueValues)Output:
[-10, 0, 50, 60]
[-2, 0, 50, 60]
cc @typesupply
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels