freetype-devel
[Top][All Lists]
Advanced

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

Re: Fw: GSoc 2020 project : Integrate distance fields to freetype


From: ANUJ VERMA
Subject: Re: Fw: GSoc 2020 project : Integrate distance fields to freetype
Date: Thu, 19 Mar 2020 11:41:54 +0530

Hello Nikolaus,
So I did look around for a different method and this is what I found. I am not considering valve's method of generating distance field from images because it is more time consuming and it is unnecessary because we have vector fonts which can be directly converted to distance fields.
So the core concept in all the methods is more or less similar, we have questions that define a shape, we then calculate the nearest distance from each point of the image to the edge of the shape. This distance is used as the values for the distance field. The more detailed explanation of the process is described in Chlumsky paper which I have linked below. One of the main disadvantages of this method is that we cannot produce sharp corner so Chlumsky has also proposed a better method which uses multiple color channels and divide the shape to preserve sharp corner.
I have created a simple demo to demonstrate the method. https://preversewharf45.github.io/
As well as one more demo which uses quadratic bezier curve and compute distance field in the GPU itself. https://www.shadertoy.com/view/ltXSDB

Now since freetype can create glyphs with multiple color channels such as FT_PIXEL_MODE_BGRA, we can integrate both these methods. One which output distance field in a single channel and one which output multiple channel distance fields for high precision.

Also please let me know if this project is added to GSoc list so that I can start writing a proposal. Moreover along with this I would also like to contribute to the ftinspect demo program.

Anuj

Link to Chlumsky paper on multiple channel signed distance fields : https://github.com/Chlumsky/msdfgen/files/3050967/thesis.pdf
And the link to Chlumsk's msdfgen library : https://github.com/Chlumsky/msdfgen

On Thu, Mar 19, 2020 at 2:59 AM Nikolaus Waxweiler <address@hidden> wrote:
I faintly remember that there has been some additional research on this
topic since Valve presented their approach. I think there even was
something in Qt. Might be worth snooping around for different
implementations.





reply via email to

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