On Wed, Oct 31, 2012 at 12:03 PM, Behdad Esfahbod <beh...@behdad.org> wrote:
> On 12-10-31 07:25 AM, Alexei Podtelezhnikov wrote:
>> On Tue, Oct 30, 2012 at 6:56 AM, Nicolas Rougier
>> <nicolas.roug...@inria.fr> wrote:
>>
>>> My question relates to a more direct way to compute the signed distance and 
>>> to know if anyone has already coded it by any chance ? Said differently, is 
>>> there a quick way to compute the shortest signed distance from any point 
>>> (x,y) to the glyph contours ?
>>
>> Quick? I do not think so. A glyph outline is a collection of contours
>> is a collection of straight segments and Bézier curves.For the
>> straight segments it is trivial. It is very difficult but surely
>> doable for the conic and cubic curves. No it is not implemented.
>
> Distance to a cubic Bezier involves solving a fifth degree polynomial.

Ouch! Not doable.

The Freetype antialiased rendered does not do it either. It splits the
curves until the curvature is no longer noticeable, then threats all
segments as straight with trivial solutions as to where they cross
scanlines. Why don't you adopt a similar approach?

_______________________________________________
Freetype-devel mailing list
Freetype-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype-devel

Reply via email to