freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Freetype-devel] Re: GSOC - Distance Fields


From: Anuj Verma
Subject: Re: [Freetype-devel] Re: GSOC - Distance Fields
Date: Sat, 30 May 2020 20:17:09 +0530


Hello Alexei,

> Great! Without further delay, go ahead and write a standalone program
> that calculates DF for a outline glyph in whatever format you choose
> or is appropriate.

I have written the program, you can find it at: https://github.com/preversewharf45/freetype2-sdf
To view the output I'm currently using a small OpenGL framework: https://github.com/preversewharf45/freetype2-sdf-demo
this already has the sdf code.

However there is an issue with the program, the glyphs which contain intersecting contours have an issue.
(example: https://imgur.com/MxJfAwY)
Currently the sign of the distance is determined by the orientation of the closest edge, so at places where
one contour intersects another the pixel near that contour can be specified as outside even though it is
inside the shape.
To fix this issue I'm thinking of using the winding of the contours, so is there any function in freetype
to get the winding or something similar?

Also, should I start integrating this in freetype or first fix the issue?


Anuj


reply via email to

[Prev in Thread] Current Thread [Next in Thread]