Nice. How are you testing for flatness?
-
-
-
I test whether the distance from the midpoint of the curve segment subtended by a candidate secant line and the midpoint of the corresponding chord are within a tolerance. Simplified from the antigrain approach described here: http://antigrain.com/research/adaptive_bezier#toc0004 …
-
It’s rudimentary, but it works all right in practice.pic.twitter.com/7Omxz8POA2
-
Does this work with quad and cubic beziers?
-
This isn’t backed by rigorous analysis, but I think the edge-case failures would be worse with cubics. I haven’t tried, and the code doesn’t attempt to handle cubics.
-
Ah gotcha. I've been putting off implementing a scan converter/rasterizer for CGPaths looking for better algorithms - Loop/Blinn is the simpler/newer one that comes to mind?
-
Loop-Blinn is straightforward enough if you can pre-tessellate your paths. I think Slug is the current state of the art, though proprietary. Pathfinder takes a different tack and is open-source (Rust).
-
Yeah... I think due to the complexity I'll have to stick with a simple scan converter (which is the CA impl anyway so I've got a resource to look at).
End of conversation
New conversation -
-
-
So how do you get the font rendering itself correct? From my understanding, you need to take care of things like kerning, ligatures, and a host of stuff which would font rendering really complex.
-
That’s why I punt to Core Text for all of that
It gives me the laid-out glyph positions and paths, and I tesselate them to produce the mesh.
Article coming soon-ish. -
Great. I’d be really interested in taking a look.
End of conversation
New conversation -
-
-
CPU or GPU?
-
All pre-tesselated on CPU with libtess2.
-
Interesting. :3c
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
)