Open skef opened 2 years ago
thanks, that would be desirable indeed. I'm thinking this could be useful for https://github.com/google/fonts/issues/4405
Thinking about this, I suppose what just testing for intersections would miss is a contour with the same direction entirely within another contour. There might be corner cases in VF instances where such a thing could happen in a production font. However, maybe its a small enough concern to be ignored.
Thinking about this, I suppose what just testing for intersections would miss is a contour with the same direction entirely within another contour. There might be corner cases in VF instances where such a thing could happen in a production font. However, maybe its a small enough concern to be ignored.
Yeah but I don't think those cases are problematic. So, fine with me.
pathops
seems to be both much faster and more accurate thanbooleanOperations
and seems far preferable for instancing a glyph. However, there are other cases where one wants to remove overlap from a glyph for purposes of analysis rather than final product, and one may only want to do so when there is overlap to be removed. For that, one would either want a state passed back with the output or -- given how fast the library is -- a method that can be called first to ask whether overlap will be removed.(Simple analysis of the result doesn't answer the question because of the other changes -- combined lines, added inflection points, and so on.)
I haven't entirely convinced myself but I suspect this question is close enough to the question "Are there any inter-segment intersections?" that the latter could serve for the former. If that's accurate then maybe one could replicate the non-debugging portions of
SkPathOpsSimplify.cpp:SimplifyDebug()
up to beforeHandleCoincidence()
and query thecoincidence
object.I don't really expect the maintainers to do this work themselves -- I'm filing to track a desirable thing that I may try to implement in the future.