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: Werner LEMBERG
Subject: Re: Extracting approximate outlines from FT ?
Date: Sun, 26 Apr 2020 11:26:20 +0200 (CEST)

>> The 'inner' outline of an 'O' glyph has exactly the opposite
>> direction of the outer outline.  In other words, for getting the
>> outermost outline(s) of a glyph you can always skip such 'inner'
>> ones.
> 
> I'm confused. Our code currently does
> 
>  FT_Load_Glyph (face, idx, FT_LOAD_NO_SCALE);
>  FT_Outline *outline = &(face->glyph->outline);
>   int j = 0;
>   while (j < outline->n_points)
> 
> ie. it goes over a single list of points, so we are processing any
> internal curves together with the exterior one?

Yes.  

> I guess we should loop multiple times, by looking at
> outline->contours?

Yes.

> Could I assume that the outer contour is always the first one?

No.  This is completely up to the font designer.

Unfortunately, the OpenType standard doesn't store the orientation of
outlines in the `glyf` or `CFF` (or `CFF2`) table.  In other words,
this has to be computed, which further means that you have to use
`FT_Outline_Get_Orientation` so that you can differentiate between
inner and outer outlines in case you need it.

Fortunately, most glyphs have a rather simple structure (i.e.,
consisting of one or two outlines), so call this function isn't too
expensive, AFAICS.


    Werner



reply via email to

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