From 287bf21847f37fc4a43e8cc0937376e5d5e87724 Mon Sep 17 00:00:00 2001 From: Benoit Pierre Date: Mon, 12 Aug 2024 21:59:24 +0000 Subject: [PATCH] lvfntman: tweak code to be forward compatible with freetype 2.13.3 (#601) Some of the fields of `FT_Outline` changed type: https://github.com/freetype/freetype/commit/2a7bb4596f566a34fd53932af0ef53b956459d25 --- crengine/src/lvfntman.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/crengine/src/lvfntman.cpp b/crengine/src/lvfntman.cpp index 25406be95..aec74dc7e 100644 --- a/crengine/src/lvfntman.cpp +++ b/crengine/src/lvfntman.cpp @@ -2572,13 +2572,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); @@ -2591,9 +2589,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;