Add glyph index and glyph load flags to glyph slot. * include/freetype/freetype.h (FT_GlyphSlotRec): Rename unused `reserved' field to `glyph_index'. * include/freetype/internal/ftobjs.h (FT_Slot_InternalRec): Add `load_flags' field. * src/base/ftobjs.c (FT_Load_Glyph): Set new fields.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
diff --git a/ChangeLog b/ChangeLog
index d42fc2f..b1bec04 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
2018-06-14 Werner Lemberg <wl@gnu.org>
+ Add glyph index and glyph load flags to glyph slot.
+
+ * include/freetype/freetype.h (FT_GlyphSlotRec): Rename unused
+ `reserved' field to `glyph_index'.
+
+ * include/freetype/internal/ftobjs.h (FT_Slot_InternalRec): Add
+ `load_flags' field.
+
+ * src/base/ftobjs.c (FT_Load_Glyph): Set new fields.
+
+2018-06-14 Werner Lemberg <wl@gnu.org>
+
[sfnt] Move `CPAL' stuff into separate files.
* src/sfnt/sfdriver.c: Include `ttcpal.h'.
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index 56a9620..35e6ed6 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -1781,6 +1781,10 @@ FT_BEGIN_HEADER
* listed through a direct, single-linked list
* using its `next' field.
*
+ * glyph_index ::
+ * The glyph index passed as an argument to @FT_Load_Glyph while
+ * initializeing the glyph slot (since FreeType version 2.10).
+ *
* generic ::
* A typeless pointer unused by the FreeType
* library or any of its drivers. It can be
@@ -1975,7 +1979,7 @@ FT_BEGIN_HEADER
FT_Library library;
FT_Face face;
FT_GlyphSlot next;
- FT_UInt reserved; /* retained for binary compatibility */
+ FT_UInt glyph_index; /* new in 2.10; was reserved previously */
FT_Generic generic;
FT_Glyph_Metrics metrics;
diff --git a/include/freetype/internal/ftobjs.h b/include/freetype/internal/ftobjs.h
index 18e01b8..9e92a31 100644
--- a/include/freetype/internal/ftobjs.h
+++ b/include/freetype/internal/ftobjs.h
@@ -434,6 +434,10 @@ FT_BEGIN_HEADER
*
* color_layers ::
* Data from (SFNT) COLR/CPAL tables.
+ *
+ * load_flags ::
+ * The load flags passed as an argument to @FT_Load_Glyph while
+ * initializing the glyph slot.
*/
#define FT_GLYPH_OWN_BITMAP 0x1U
@@ -449,6 +453,8 @@ FT_BEGIN_HEADER
FT_Colr_Internal color_layers;
+ FT_Int32 load_flags;
+
} FT_GlyphSlot_InternalRec;
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 364d2ad..bd3c039 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -999,6 +999,9 @@
}
}
+ slot->glyph_index = glyph_index;
+ slot->internal->load_flags = load_flags;
+
/* do we need to render the image or preset the bitmap now? */
if ( !error &&
( load_flags & FT_LOAD_NO_SCALE ) == 0 &&