summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/include/freetype/internal/wofftypes.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/freetype/include/freetype/internal/wofftypes.h')
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/wofftypes.h210
1 files changed, 205 insertions, 5 deletions
diff --git a/src/3rdparty/freetype/include/freetype/internal/wofftypes.h b/src/3rdparty/freetype/include/freetype/internal/wofftypes.h
index ba55bf883e..0c1d8eeaf8 100644
--- a/src/3rdparty/freetype/include/freetype/internal/wofftypes.h
+++ b/src/3rdparty/freetype/include/freetype/internal/wofftypes.h
@@ -5,7 +5,7 @@
* Basic WOFF/WOFF2 type definitions and interface (specification
* only).
*
- * Copyright (C) 1996-2019 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -21,9 +21,8 @@
#define WOFFTYPES_H_
-#include <ft2build.h>
-#include FT_TRUETYPE_TABLES_H
-#include FT_INTERNAL_OBJECTS_H
+#include <freetype/tttables.h>
+#include <freetype/internal/ftobjs.h>
FT_BEGIN_HEADER
@@ -93,7 +92,7 @@ FT_BEGIN_HEADER
*/
typedef struct WOFF_TableRec_
{
- FT_ULong Tag; /* table ID */
+ FT_Tag Tag; /* table ID */
FT_ULong Offset; /* table file offset */
FT_ULong CompLength; /* compressed table length */
FT_ULong OrigLength; /* uncompressed table length */
@@ -104,6 +103,207 @@ FT_BEGIN_HEADER
} WOFF_TableRec, *WOFF_Table;
+ /**************************************************************************
+ *
+ * @struct:
+ * WOFF2_TtcFontRec
+ *
+ * @description:
+ * Metadata for a TTC font entry in WOFF2.
+ *
+ * @fields:
+ * flavor ::
+ * TTC font flavor.
+ *
+ * num_tables ::
+ * Number of tables in TTC, indicating number of elements in
+ * `table_indices`.
+ *
+ * table_indices ::
+ * Array of table indices for each TTC font.
+ */
+ typedef struct WOFF2_TtcFontRec_
+ {
+ FT_ULong flavor;
+ FT_UShort num_tables;
+ FT_UShort* table_indices;
+
+ } WOFF2_TtcFontRec, *WOFF2_TtcFont;
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * WOFF2_HeaderRec
+ *
+ * @description:
+ * WOFF2 file format header.
+ *
+ * @fields:
+ * See
+ *
+ * https://www.w3.org/TR/WOFF2/#woff20Header
+ *
+ * @note:
+ * We don't care about the fields `reserved`, `majorVersion` and
+ * `minorVersion`, so they are not included. The `totalSfntSize` field
+ * does not necessarily represent the actual size of the uncompressed
+ * SFNT font stream, so that is used as a reference value instead.
+ */
+ typedef struct WOFF2_HeaderRec_
+ {
+ FT_ULong signature;
+ FT_ULong flavor;
+ FT_ULong length;
+ FT_UShort num_tables;
+ FT_ULong totalSfntSize;
+ FT_ULong totalCompressedSize;
+ FT_ULong metaOffset;
+ FT_ULong metaLength;
+ FT_ULong metaOrigLength;
+ FT_ULong privOffset;
+ FT_ULong privLength;
+
+ FT_ULong uncompressed_size; /* uncompressed brotli stream size */
+ FT_ULong compressed_offset; /* compressed stream offset */
+ FT_ULong header_version; /* version of original TTC Header */
+ FT_UShort num_fonts; /* number of fonts in TTC */
+ FT_ULong actual_sfnt_size; /* actual size of sfnt stream */
+
+ WOFF2_TtcFont ttc_fonts; /* metadata for fonts in a TTC */
+
+ } WOFF2_HeaderRec, *WOFF2_Header;
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * WOFF2_TableRec
+ *
+ * @description:
+ * This structure describes a given table of a WOFF2 font.
+ *
+ * @fields:
+ * See
+ *
+ * https://www.w3.org/TR/WOFF2/#table_dir_format
+ */
+ typedef struct WOFF2_TableRec_
+ {
+ FT_Byte FlagByte; /* table type and flags */
+ FT_Tag Tag; /* table file offset */
+ FT_ULong dst_length; /* uncompressed table length */
+ FT_ULong TransformLength; /* transformed length */
+
+ FT_ULong flags; /* calculated flags */
+ FT_ULong src_offset; /* compressed table offset */
+ FT_ULong src_length; /* compressed table length */
+ FT_ULong dst_offset; /* uncompressed table offset */
+
+ } WOFF2_TableRec, *WOFF2_Table;
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * WOFF2_InfoRec
+ *
+ * @description:
+ * Metadata for WOFF2 font that may be required for reconstruction of
+ * sfnt tables.
+ *
+ * @fields:
+ * header_checksum ::
+ * Checksum of SFNT offset table.
+ *
+ * num_glyphs ::
+ * Number of glyphs in the font.
+ *
+ * num_hmetrics ::
+ * `numberOfHMetrics` field in the 'hhea' table.
+ *
+ * x_mins ::
+ * `xMin` values of glyph bounding box.
+ *
+ * glyf_table ::
+ * A pointer to the `glyf' table record.
+ *
+ * loca_table ::
+ * A pointer to the `loca' table record.
+ *
+ * head_table ::
+ * A pointer to the `head' table record.
+ */
+ typedef struct WOFF2_InfoRec_
+ {
+ FT_ULong header_checksum;
+ FT_UShort num_glyphs;
+ FT_UShort num_hmetrics;
+ FT_Short* x_mins;
+
+ WOFF2_Table glyf_table;
+ WOFF2_Table loca_table;
+ WOFF2_Table head_table;
+
+ } WOFF2_InfoRec, *WOFF2_Info;
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * WOFF2_SubstreamRec
+ *
+ * @description:
+ * This structure stores information about a substream in the transformed
+ * 'glyf' table in a WOFF2 stream.
+ *
+ * @fields:
+ * start ::
+ * Beginning of the substream relative to uncompressed table stream.
+ *
+ * offset ::
+ * Offset of the substream relative to uncompressed table stream.
+ *
+ * size ::
+ * Size of the substream.
+ */
+ typedef struct WOFF2_SubstreamRec_
+ {
+ FT_ULong start;
+ FT_ULong offset;
+ FT_ULong size;
+
+ } WOFF2_SubstreamRec, *WOFF2_Substream;
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * WOFF2_PointRec
+ *
+ * @description:
+ * This structure stores information about a point in the transformed
+ * 'glyf' table in a WOFF2 stream.
+ *
+ * @fields:
+ * x ::
+ * x-coordinate of point.
+ *
+ * y ::
+ * y-coordinate of point.
+ *
+ * on_curve ::
+ * Set if point is on-curve.
+ */
+ typedef struct WOFF2_PointRec_
+ {
+ FT_Int x;
+ FT_Int y;
+ FT_Bool on_curve;
+
+ } WOFF2_PointRec, *WOFF2_Point;
+
+
FT_END_HEADER
#endif /* WOFFTYPES_H_ */