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: Werner LEMBERG
Subject: Re: [Freetype-devel] Re: GSOC - Distance Fields
Date: Wed, 15 Jul 2020 07:13:43 +0200 (CEST)

> I have added all the optimization modes to the module.

Great, thanks!

> By far the fastest method is to subdivide the curve into a number of
> line segments.  [...]

OK.  I'm glad that you took the time to implement the various
algorithms so that we have such a comparison.

> The major downside of the BB and subdivision methods is that they
> require a considerable amount of memory usage (almost 3x of the size
> of bitmap) because we need to keep a track of the distances and
> signs of all the grid points.

I don't think this is an issue.  For other rendering modes like LCD
there are similar requirements, and platforms that are going to use
SFDs certainly have plenty of memory.  It would be nice, however, if
you can add this constraint to the documentation, and, if possible,
also add a logging message that either predicts the necessary
(approximate) amount of memory before the computation, and/or the
actual memory use after generating an SFD.

> I have updated the demo, added bilinear filtering, shape
> reconstruction and has all optimization modes which can be toggled.
> I have attached the new list of keys.
> (https://github.com/preversewharf45/ft2sdf-demo)

Thanks, will test soon.

> For now I would like to hold the outline implementation for now and
> go to the bitmap implementation.  After that the module can be used
> to generate SDF from bitmaps directly.  It will be pretty fast and
> will not require any additional memory other than the bitmap itself
> at a cost of reduced accuracy.

Excellent.

> However there are a few issues.
> 
> * `FT_Render_Glyph_Internal' break if the glyph format is already
>    a bitmap.
>    ```
>     case FT_GLYPH_FORMAT_BITMAP:   /* already a bitmap, don't do anything */
>       break;
>    ```
> * `FT_Lookup_Renderer' uses renderer format which is currently
>   `FT_GLYPH_FORMAT_OUTLINE' for the `sdf' module.  How can
>    make it accept both outline and bitmap glyph format ?
> 
> I don't like the idea of changing the internals of freetype so is
> there any other way in which this can be done ?

Don't worry about changing the internals!  You know best what to do,
and we can discuss later whether your solution is the right approach.
Regarding the second issue I think that you probably have to create a
second renderer that shares most of the code with the original one.
Alexei?


    Werner



reply via email to

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