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: Behdad Esfahbod
Subject: Re: [Freetype-devel] Re: GSOC - Distance Fields
Date: Sat, 20 Jun 2020 15:32:15 -0700

Werner!

On Wed, Jun 17, 2020 at 12:23 AM Werner LEMBERG <wl@gnu.org> wrote:
> Also, why doesn't FreeType use floats?  Is it just because of
> platform which doesn't have floating point type?

Yes.  The original intention of FreeType was to provide support for
embedded devices, which usually are systems that have CPUs with very
limited capabilities and a tiny amount of memory.  This goal hasn't

Reminds me of Colbert on Bush: "The greatest thing about this man is that he’s steady. You know where he stands,” Colbert said about Bush. “He believes the same thing Wednesday that he believed on Monday — no matter what happened Tuesday.  Events can change; this man’s beliefs never will."

FreeType was designed in the 90s.  Back then there were embedded systems that did not have an FPU.  There also existed embedded systems that did not allow a library to have static writable data segment.  Both of those limitations were ingrained into FreeType design.  Both are *still* actively defended.  In the meantime the world has changed...

Systems without an FPU are vastly less common than they were 20 years ago.  They still exist, and is a defendable position to want FreeType to continue to work on those systems, however:

  - Compilers and kernels have stepped up to provide floating-point emulation libraries which work transparently to the client code.  That is, introducing limited use of float in FreeType is by no means an impediment to those building the library for systems without FPU.  Even if that was not true, the SDF module can be easily disabled,

  - I have a *very* hard time imagining any system that has a programmable GPU, but no FPU.  As such, I find it completely nonsensical to ban using float for the SDF generation.

In HarfBuzz we started from the same position, exactly because of precedent in FreeType.  But when we got to variable fonts, we acknowledged the shift in the scene and just used float internally.  Broke nothing... And sure there are users of FreeType who won't ever want HarfBuzz.  I'm not ruling those use-cases out categorically.  But my arguments above address those situations as well.

I strongly advise that you reconsider this.  And many other decisions that seem to be stuck in 20 years ago.  I'm working on writing a full assessment of FreeType as a project and will share in a new thread when that is ready.  In the meantime, I like to see Anuj's time be spent in producing a **solid** SDF implementation, instead of fighting barriers that are not technically justified.

b

 

--
behdad
http://behdad.org/

reply via email to

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