-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Description
Summary
TextPath is a Path subclass with a different constructor (from a string, that gets converted to path representation), with the further ability to mutate itself by changing its size (but not anything else). Inheritance from Paths has led to an issue related to deep-copying (#29157).
Proposed fix
The TextPath class could be replaced by a Text(...).to_path() -> Path method. This would be easier to document (no ad-hoc class).
to_path() would not allow changing the size of the text but users could just mutate the Text object and call to_path() again, which is likely more correct (due to optical sizing a size-12 text is not necessarily just a 2x magnification of a size-6 text); or, if this is really a performance bottleneck, they could rescale the path vertices themselves (which is what TextPath does in _revalidate_path).