lilypond-devel
[Top][All Lists]
Advanced

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

Re: Extracting approximate outlines from FT ?


From: Han-Wen Nienhuys
Subject: Re: Extracting approximate outlines from FT ?
Date: Fri, 24 Apr 2020 17:54:47 +0200

On Fri, Apr 17, 2020 at 7:56 PM Werner LEMBERG <address@hidden> wrote:
> > I've been looking into performance, and one big source of slowness
> > is calculating skylines. I found that we calculate exact skylines
> > based on glyph shapes for some symbols.
> >
> > For example, for the F clef, we compute an outline of 23 and 20
> > segments, based on sampling the exact bezier curves in the glyph.
> > This is silly (because the F clef is obscured by the staff symbol),
> > but even if it weren't, it seems extremely expensive overkill.  Can
> > you recommend a mechanism by which we can get a linear approximation
> > of the curve directly out of freetype?
>
> FreeType doesn't offer this, sorry – at least not in a form that would
> be usable for LilyPond IMHO.  You could use `FT_Outline_Decompose` and
> register your own handler for simplifying Bezier arcs – given the
> well-behaving of font outlines (at least in Feta), maybe the direct
> use of control points are sufficient, possibly doing one or at most
> two de Casteljau subdivisions?

Good idea. I'll keep it in mind. Other question: is there a standard
wrt to outline direction? If I can assume that external outlines go in
clockwise order, I could skip left-pointing path elements when
creating the upwards skyline, cutting the amount of work in half.
Also, is there is way to detect internal curves (eg. the inner curve
of the O glyph?).

-- 
Han-Wen Nienhuys - address@hidden - http://www.xs4all.nl/~hanwen



reply via email to

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