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.
This commit is contained in:
Werner Lemberg 2018-06-14 21:00:23 +02:00
parent a44e20879c
commit 33ac83e376
4 changed files with 26 additions and 1 deletions

View File

@ -1,3 +1,15 @@
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.

View File

@ -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;

View File

@ -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;

View File

@ -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 &&