Add a preference to Force Integer Values, which means that after any operation (eg, Add Extrema) then all points are rounded to integer values. This is different to 'SnapToInt' which is just for drawing; with that pref set, then operations like Add Extrema will not alter curves at all but place non-int points.
Seven years later...
How hard do you think this would be, @skef? Could it be put in SplineRefigure? Do we want to do that?
I wouldn't be very comfortable with putting it in SplineRefigure as that function shouldn't change point locations -- it's supposed to be for the internal x and y spline calculations. Also, some operations have a number of intermediate steps and rounding on every SplineRefigure could cause a lot of drift.
One could add a "checkmark" menu item that corresponds to running round-to-int after every op, or most ops, but right now it would be annoying to add.
Understood. Probably, then, we'd want to put it in fontforgeexe and not fontforge, making it GUI-only. After all, we can just call {font|glyph|layer}.round() right now, so it's not really against #D2. I think it will take some work to get this right, for sure, but having a hook that runs every time a GUI operation is made is a genuinely _useful_ feature, for Python scripts as well.
Could we put it then in SCCharChangedUpdate? And perhaps add an events API for that call? :-)
A general API runs a high risk of non-terminating code, so that would have to be managed.
With suitable precautions SCCharChangedUpdate might be a place for rounding but I'm guessing it's currently treated as idempotent so it could also be a source of drift problems.
So it seems like the roadmap is:
SCCharChangedUpdate is called in fontforgeexe/*;UIDiscreteOperation function;I certainly don't have time for all that right now, but at least we know how to get there. 馃コ
Does this need to happen on every operation? It would introduce significant entropy for some workflows. And I'm not sure that it's even useful outside of drawing. If, for example, we were to snap after an overlap removal, it might make a once continuous feature visibly discontinuous.