mirror of
https://gitlab.freedesktop.org/freetype/freetype.git
synced 2026-05-05 06:38:00 +02:00
* src/autofit/aflatin.c (af_compute_vertical_extrema): New function.
To be used in a follow-up commit.
This commit is contained in:
parent
357032d1ce
commit
387c2d8063
1 changed files with 38 additions and 0 deletions
|
|
@ -2776,6 +2776,44 @@
|
|||
}
|
||||
|
||||
|
||||
/* Compute vertical extrema of all contours and store them in the */
|
||||
/* `contour_y_minima` and `contour_y_maxima` arrays of `hints`. */
|
||||
static void
|
||||
af_compute_vertical_extrema( AF_GlyphHints hints )
|
||||
{
|
||||
FT_Int contour;
|
||||
|
||||
|
||||
for ( contour = 0; contour < hints->num_contours; contour++ )
|
||||
{
|
||||
FT_Pos min_y = FT_INT_MAX;
|
||||
FT_Pos max_y = FT_INT_MIN;
|
||||
|
||||
AF_Point first_point = hints->contours[contour];
|
||||
AF_Point point = first_point;
|
||||
|
||||
|
||||
if ( !first_point || first_point->next->next == first_point )
|
||||
goto End_loop;
|
||||
|
||||
do
|
||||
{
|
||||
if ( point->y < min_y )
|
||||
min_y = point->y;
|
||||
if ( point->y > max_y )
|
||||
max_y = point->y;
|
||||
|
||||
point = point->next;
|
||||
|
||||
} while ( point != first_point );
|
||||
|
||||
End_loop:
|
||||
hints->contour_y_minima[contour] = min_y;
|
||||
hints->contour_y_maxima[contour] = max_y;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static FT_Int
|
||||
af_find_highest_contour( AF_GlyphHints hints )
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue