Skip to content

Commit

Permalink
lvfntman: tweak code to be forward compatible with freetype 2.13.3
Browse files Browse the repository at this point in the history
Some of the fields of `FT_Outline` changed type:

freetype/freetype@2a7bb45
  • Loading branch information
benoit-pierre committed Aug 12, 2024
1 parent 07171e7 commit f28098d
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions crengine/src/lvfntman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2670,13 +2670,11 @@ class LVFreeTypeFace : public LVFont
// Step 3. for bezier: Q control-point-x control-point-y, destination-x, destination-y
// for line: L x-coord, y-coord
// for move: M x-coord, y-coord
FT_Outline outline = _slot->outline;
FT_Vector* points = outline.points;
char* tags = outline.tags;
short* contours = outline.contours;
const FT_Outline * outline = &_slot->outline;
const FT_Vector * points = outline->points;
int contour_starti = 0;
for (int i = 0 ; i < outline.n_contours ; i++ ) {
int contour_endi = contours[i];
for (int i = 0 ; i < outline->n_contours ; i++ ) {
int contour_endi = outline->contours[i];
int offset = contour_starti;
int npts = contour_endi - contour_starti + 1;
SVGGlyphsCollector_svg_move_to(NULL, svg_collector, NULL, points[contour_starti].x, points[contour_starti].y, NULL);
Expand All @@ -2689,9 +2687,9 @@ class LVFreeTypeFace : public LVFont
long y = points[a].y;
long nx = points[nexti].x;
long ny = points[nexti].y;
bool this_tagbit1 = (tags[a] & 1);
bool next_tagbit1 = (tags[nexti] & 1);
bool nextnext_tagbit1 = (tags[ nextnexti ] & 1);
bool this_tagbit1 = (outline->tags[a] & 1);
bool next_tagbit1 = (outline->tags[nexti] & 1);
bool nextnext_tagbit1 = (outline->tags[ nextnexti ] & 1);
bool this_isctl = !this_tagbit1;
bool next_isctl = !next_tagbit1;
bool nextnext_isctl = !nextnext_tagbit1;
Expand Down

0 comments on commit f28098d

Please sign in to comment.