freetype-devel
[Top][All Lists]
Advanced

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

Fw: GSoc 2020 project : Integrate distance fields to freetype


From: Werner LEMBERG
Subject: Fw: GSoc 2020 project : Integrate distance fields to freetype
Date: Wed, 18 Mar 2020 10:13:55 +0100 (CET)

Here's a new idea from Anuj for GSoC – this looks interesting!


    Werner
--- Begin Message --- Subject: Re: GSoc 2020 project : Integrate distance fields to freetype Date: Wed, 18 Mar 2020 13:35:08 +0530
Thank you for replying so quickly.

So, from what I understand till now is that freetype generate a texture for each character (which is a glyph) which can then be drawn in the fragment shader.
Now to generate signed distance field I have thought of two methods.
1. When the glyph is created we can add a post-processing step which will generate distance fields for the glyph which can then be accessed.
    There are several algorithms to generate distance fields from textures and this method is also discussed in the valve's paper where they used
    high resolution images and converted them to low resolution distance fields.
2. The second method is to generate distance fields directly from the vector images. This method is used in an open source library (https://github.com/Chlumsky/msdfgen)
    which generate distance field images from vector graphics. This method will be faster as there is no post-processing step involved and will be simpler because msdfgen
    can be used as a reference. (There is a paper by the author of msdfgen which discuss this method)

Either way we can implement these in the freetype library and then the user can request distance field either by passing a flag while creating a new face using FT_New_Face,
or we can add a new render mode in FT_Render_Mode. Moreover, the first method discussed can be made faster by using the GPU.

I am linking the Valve's paper this time properly [https://steamcdn-a.akamaihd.net/apps/valve/2007/SIGGRAPH2007_AlphaTestedMagnification.pdf]

Thank you,
Anuj



On Wed, Mar 18, 2020 at 11:57 AM Werner LEMBERG <address@hidden> wrote:

[Original message sent to the list deleted since it contains a 7MByte
 PDF attachment of a potentially non-public file]

[Please subscribe to the `freetype-devel` mailing list!]

Hello Anuj,


> My name is Anuj and I am a 3rd year computer science student.  I am
> interested in game engine development and font rendering is one of
> it's features.  A paper published by valve shows how good is
> distance field white rendering font.  It also reduce memory usage.
> So this year I would like to add distance field to freetype.

This sounds interesting – and it's very nice that you propose
something that is not on our GSOC ideas list!  Please elaborate how
you would do that.


    Werner


PS: > I have linked the Valve's paper on distance field.

    You didn't link, you sent the original paper!

--- End Message ---

reply via email to

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