fontMath
fontMath copied to clipboard
translate
I came in to a situation where I needed to translate a mathGlyph
if there is interest I can add the full translate as a PR
see https://gist.github.com/typemytype/52de64953b7486ae9090f19525e22c9b
Yes, please!
fontmath objects have __mul__ operator which takes a number value as a factor, while the __add__ operator must be another compatible fontmath object. Maybe this translate method could simply be __add__ but when the type of the second addend is not a fontmath object but an int/float?
Ehm, I actually meant a tuple of int/float
E.g. MathGlyph(glyph) + (10, 10)
similarly for __sub__ ofc
or maybe this could lead to confusions, and an explicit translate method is better.. 🤔
Adding this to __add__ is not a good idea as this implies __mul__ should also take a mathGlyph, instead of a factor only.
A separate translate is better...