Closed SunHaozhe closed 3 years ago
For font editing tasks like this it is more appropriate to use fontforge's python binding, for example. While I think freetype-py can probably be made/enhanced, it is not the right tool for such task.
Fontforge (and its python binding) is free and open software...
Can I directly modify anchor points of a glyph? If yes, how can I do so?
For example, I want to randomly move each anchor point of a glyph by a small random amount of units, which creates a distorted version of that glyph.
It seems to me that
FT_Outline
defined in FreeType C++ version (https://www.freetype.org/freetype2/docs/reference/ft2-outline_processing.html#ft_outline) contains a field calledpoints
, the fieldpoints
points to an array ofn_points
FT_Vector
elements, giving the outline's point coordinates. Thus, if one is able to modify the value of thoseFT_Vector
, one can create a distorted version of that glyph. Is this functionality supported byfreetype-py
? If not, is there any way of achieving the same effect?Here, anchor points refer to the points that define the Bézier curves, thus the glyph outline.
By the way, RoboFont allows randomly moving anchor points, see here. However this is not a free and open software. Can we do the same thing using
freetype-py
somehow?