2019-05-30 20:27:34 +02:00
|
|
|
/****************************************************************************
|
|
|
|
*
|
|
|
|
* wofftypes.h
|
|
|
|
*
|
|
|
|
* Basic WOFF/WOFF2 type definitions and interface (specification
|
|
|
|
* only).
|
|
|
|
*
|
2022-01-11 10:54:10 +01:00
|
|
|
* Copyright (C) 1996-2022 by
|
2019-05-30 20:27:34 +02:00
|
|
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
|
|
|
*
|
|
|
|
* This file is part of the FreeType project, and may only be used,
|
|
|
|
* modified, and distributed under the terms of the FreeType project
|
|
|
|
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
|
|
|
* this file you indicate that you have read the license and
|
|
|
|
* understand and accept it fully.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef WOFFTYPES_H_
|
|
|
|
#define WOFFTYPES_H_
|
|
|
|
|
|
|
|
|
2020-06-08 13:31:55 +02:00
|
|
|
#include <freetype/tttables.h>
|
|
|
|
#include <freetype/internal/ftobjs.h>
|
2019-05-30 20:27:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
FT_BEGIN_HEADER
|
|
|
|
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
*
|
|
|
|
* @struct:
|
|
|
|
* WOFF_HeaderRec
|
|
|
|
*
|
|
|
|
* @description:
|
|
|
|
* WOFF file format header.
|
|
|
|
*
|
|
|
|
* @fields:
|
|
|
|
* See
|
|
|
|
*
|
|
|
|
* https://www.w3.org/TR/WOFF/#WOFFHeader
|
|
|
|
*/
|
|
|
|
typedef struct WOFF_HeaderRec_
|
|
|
|
{
|
|
|
|
FT_ULong signature;
|
|
|
|
FT_ULong flavor;
|
|
|
|
FT_ULong length;
|
|
|
|
FT_UShort num_tables;
|
|
|
|
FT_UShort reserved;
|
|
|
|
FT_ULong totalSfntSize;
|
|
|
|
FT_UShort majorVersion;
|
|
|
|
FT_UShort minorVersion;
|
|
|
|
FT_ULong metaOffset;
|
|
|
|
FT_ULong metaLength;
|
|
|
|
FT_ULong metaOrigLength;
|
|
|
|
FT_ULong privOffset;
|
|
|
|
FT_ULong privLength;
|
|
|
|
|
|
|
|
} WOFF_HeaderRec, *WOFF_Header;
|
|
|
|
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
*
|
|
|
|
* @struct:
|
|
|
|
* WOFF_TableRec
|
|
|
|
*
|
|
|
|
* @description:
|
|
|
|
* This structure describes a given table of a WOFF font.
|
|
|
|
*
|
|
|
|
* @fields:
|
|
|
|
* Tag ::
|
|
|
|
* A four-bytes tag describing the table.
|
|
|
|
*
|
|
|
|
* Offset ::
|
|
|
|
* The offset of the table from the start of the WOFF font in its
|
|
|
|
* resource.
|
|
|
|
*
|
|
|
|
* CompLength ::
|
|
|
|
* Compressed table length (in bytes).
|
|
|
|
*
|
|
|
|
* OrigLength ::
|
|
|
|
* Uncompressed table length (in bytes).
|
|
|
|
*
|
|
|
|
* CheckSum ::
|
|
|
|
* The table checksum. This value can be ignored.
|
|
|
|
*
|
|
|
|
* OrigOffset ::
|
|
|
|
* The uncompressed table file offset. This value gets computed while
|
|
|
|
* constructing the (uncompressed) SFNT header. It is not contained in
|
|
|
|
* the WOFF file.
|
|
|
|
*/
|
|
|
|
typedef struct WOFF_TableRec_
|
|
|
|
{
|
2021-10-28 04:36:11 +02:00
|
|
|
FT_Tag Tag; /* table ID */
|
2019-05-30 20:27:34 +02:00
|
|
|
FT_ULong Offset; /* table file offset */
|
|
|
|
FT_ULong CompLength; /* compressed table length */
|
|
|
|
FT_ULong OrigLength; /* uncompressed table length */
|
|
|
|
FT_ULong CheckSum; /* uncompressed checksum */
|
|
|
|
|
|
|
|
FT_ULong OrigOffset; /* uncompressed table file offset */
|
|
|
|
/* (not in the WOFF file) */
|
|
|
|
} WOFF_TableRec, *WOFF_Table;
|
|
|
|
|
|
|
|
|
2019-06-16 15:26:18 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
|
|
|
* @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;
|
|
|
|
|
|
|
|
|
2019-06-11 20:10:19 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
|
|
|
* @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
|
2019-08-21 16:51:02 +02:00
|
|
|
* SFNT font stream, so that is used as a reference value instead.
|
2019-06-11 20:10:19 +02:00
|
|
|
*/
|
2019-06-16 15:26:18 +02:00
|
|
|
typedef struct WOFF2_HeaderRec_
|
2019-06-11 20:10:19 +02:00
|
|
|
{
|
|
|
|
FT_ULong signature;
|
|
|
|
FT_ULong flavor;
|
|
|
|
FT_ULong length;
|
|
|
|
FT_UShort num_tables;
|
2019-07-17 22:20:16 +02:00
|
|
|
FT_ULong totalSfntSize;
|
2019-06-11 20:10:19 +02:00
|
|
|
FT_ULong totalCompressedSize;
|
|
|
|
FT_ULong metaOffset;
|
|
|
|
FT_ULong metaLength;
|
|
|
|
FT_ULong metaOrigLength;
|
|
|
|
FT_ULong privOffset;
|
|
|
|
FT_ULong privLength;
|
|
|
|
|
2019-08-21 16:51:02 +02:00
|
|
|
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 */
|
2019-06-16 15:26:18 +02:00
|
|
|
|
2019-08-21 16:51:02 +02:00
|
|
|
WOFF2_TtcFont ttc_fonts; /* metadata for fonts in a TTC */
|
2019-06-11 20:10:19 +02:00
|
|
|
|
|
|
|
} WOFF2_HeaderRec, *WOFF2_Header;
|
|
|
|
|
|
|
|
|
2019-10-08 11:12:18 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
|
|
|
* @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 */
|
2021-10-28 04:24:27 +02:00
|
|
|
FT_Tag Tag; /* table file offset */
|
2019-10-08 11:12:18 +02:00
|
|
|
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;
|
|
|
|
|
|
|
|
|
[woff2] Reconstruct transformed `glyf' table.
Reconstruct `glyf' table if it is transformed in the uncompressed
table stream. Also add necessary structures, macros and functions.
* include/freetype/internal/wofftypes.h (WOFF2_InfoRec,
WOFF2_SubstreamRec, WOFF2_PointRec): New structures.
(WOFF2_TableRec): s/OrigLength/dst_length/.
* src/sfnt/sfwoff2.c (READ_255USHORT, READ_BASE128): Use
`FT_SET_ERROR' to set implicit `error' variable.
(WRITE_SHORT): New macro.
(N_CONTOUR_STREAM, N_POINTS_STREAM, FLAG_STREAM, GLYPH_STREAM,
COMPOSITE_STREAM, BBOX_STREAM, INSTRUCTION_STREAM): New macros to
refer to substreams of the transformed `glyf' tables.
(Read255UShort, ReadBase128): Return errors set by `FT_READ_XXX'
macros.
(with_sign, safe_int_addition): New functions to add sign to values
based on a flag and perform safe addition respectively.
(triplet_decode): Decode variable-length (flag, xCoordinate,
yCoordinate) triplet for a simple glyph. See
https://www.w3.org/TR/WOFF2/#triplet_decoding
(store_points, compute_bbox, composteGlyph_size, reconstruct_glyf):
New functions.
(reconstruct_font): Call `reconstruct_glyf'.
* src/sfnt/sfwoff2.h: Add required constants.
* src/sfnt/woff2tags.h: Move out constants to `sfwoff2.h'.
2019-07-12 23:44:17 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
|
|
|
* @struct:
|
|
|
|
* WOFF2_InfoRec
|
|
|
|
*
|
|
|
|
* @description:
|
|
|
|
* Metadata for WOFF2 font that may be required for reconstruction of
|
|
|
|
* sfnt tables.
|
|
|
|
*
|
|
|
|
* @fields:
|
2019-08-21 16:51:02 +02:00
|
|
|
* header_checksum ::
|
|
|
|
* Checksum of SFNT offset table.
|
|
|
|
*
|
[woff2] Reconstruct transformed `glyf' table.
Reconstruct `glyf' table if it is transformed in the uncompressed
table stream. Also add necessary structures, macros and functions.
* include/freetype/internal/wofftypes.h (WOFF2_InfoRec,
WOFF2_SubstreamRec, WOFF2_PointRec): New structures.
(WOFF2_TableRec): s/OrigLength/dst_length/.
* src/sfnt/sfwoff2.c (READ_255USHORT, READ_BASE128): Use
`FT_SET_ERROR' to set implicit `error' variable.
(WRITE_SHORT): New macro.
(N_CONTOUR_STREAM, N_POINTS_STREAM, FLAG_STREAM, GLYPH_STREAM,
COMPOSITE_STREAM, BBOX_STREAM, INSTRUCTION_STREAM): New macros to
refer to substreams of the transformed `glyf' tables.
(Read255UShort, ReadBase128): Return errors set by `FT_READ_XXX'
macros.
(with_sign, safe_int_addition): New functions to add sign to values
based on a flag and perform safe addition respectively.
(triplet_decode): Decode variable-length (flag, xCoordinate,
yCoordinate) triplet for a simple glyph. See
https://www.w3.org/TR/WOFF2/#triplet_decoding
(store_points, compute_bbox, composteGlyph_size, reconstruct_glyf):
New functions.
(reconstruct_font): Call `reconstruct_glyf'.
* src/sfnt/sfwoff2.h: Add required constants.
* src/sfnt/woff2tags.h: Move out constants to `sfwoff2.h'.
2019-07-12 23:44:17 +02:00
|
|
|
* num_glyphs ::
|
|
|
|
* Number of glyphs in the font.
|
|
|
|
*
|
|
|
|
* num_hmetrics ::
|
2019-08-21 16:51:02 +02:00
|
|
|
* `numberOfHMetrics` field in the 'hhea' table.
|
[woff2] Reconstruct transformed `glyf' table.
Reconstruct `glyf' table if it is transformed in the uncompressed
table stream. Also add necessary structures, macros and functions.
* include/freetype/internal/wofftypes.h (WOFF2_InfoRec,
WOFF2_SubstreamRec, WOFF2_PointRec): New structures.
(WOFF2_TableRec): s/OrigLength/dst_length/.
* src/sfnt/sfwoff2.c (READ_255USHORT, READ_BASE128): Use
`FT_SET_ERROR' to set implicit `error' variable.
(WRITE_SHORT): New macro.
(N_CONTOUR_STREAM, N_POINTS_STREAM, FLAG_STREAM, GLYPH_STREAM,
COMPOSITE_STREAM, BBOX_STREAM, INSTRUCTION_STREAM): New macros to
refer to substreams of the transformed `glyf' tables.
(Read255UShort, ReadBase128): Return errors set by `FT_READ_XXX'
macros.
(with_sign, safe_int_addition): New functions to add sign to values
based on a flag and perform safe addition respectively.
(triplet_decode): Decode variable-length (flag, xCoordinate,
yCoordinate) triplet for a simple glyph. See
https://www.w3.org/TR/WOFF2/#triplet_decoding
(store_points, compute_bbox, composteGlyph_size, reconstruct_glyf):
New functions.
(reconstruct_font): Call `reconstruct_glyf'.
* src/sfnt/sfwoff2.h: Add required constants.
* src/sfnt/woff2tags.h: Move out constants to `sfwoff2.h'.
2019-07-12 23:44:17 +02:00
|
|
|
*
|
|
|
|
* x_mins ::
|
2019-08-21 16:51:02 +02:00
|
|
|
* `xMin` values of glyph bounding box.
|
2019-10-08 11:12:18 +02:00
|
|
|
*
|
|
|
|
* 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.
|
[woff2] Reconstruct transformed `glyf' table.
Reconstruct `glyf' table if it is transformed in the uncompressed
table stream. Also add necessary structures, macros and functions.
* include/freetype/internal/wofftypes.h (WOFF2_InfoRec,
WOFF2_SubstreamRec, WOFF2_PointRec): New structures.
(WOFF2_TableRec): s/OrigLength/dst_length/.
* src/sfnt/sfwoff2.c (READ_255USHORT, READ_BASE128): Use
`FT_SET_ERROR' to set implicit `error' variable.
(WRITE_SHORT): New macro.
(N_CONTOUR_STREAM, N_POINTS_STREAM, FLAG_STREAM, GLYPH_STREAM,
COMPOSITE_STREAM, BBOX_STREAM, INSTRUCTION_STREAM): New macros to
refer to substreams of the transformed `glyf' tables.
(Read255UShort, ReadBase128): Return errors set by `FT_READ_XXX'
macros.
(with_sign, safe_int_addition): New functions to add sign to values
based on a flag and perform safe addition respectively.
(triplet_decode): Decode variable-length (flag, xCoordinate,
yCoordinate) triplet for a simple glyph. See
https://www.w3.org/TR/WOFF2/#triplet_decoding
(store_points, compute_bbox, composteGlyph_size, reconstruct_glyf):
New functions.
(reconstruct_font): Call `reconstruct_glyf'.
* src/sfnt/sfwoff2.h: Add required constants.
* src/sfnt/woff2tags.h: Move out constants to `sfwoff2.h'.
2019-07-12 23:44:17 +02:00
|
|
|
*/
|
|
|
|
typedef struct WOFF2_InfoRec_
|
|
|
|
{
|
2019-07-15 23:15:03 +02:00
|
|
|
FT_ULong header_checksum;
|
[woff2] Reconstruct transformed `glyf' table.
Reconstruct `glyf' table if it is transformed in the uncompressed
table stream. Also add necessary structures, macros and functions.
* include/freetype/internal/wofftypes.h (WOFF2_InfoRec,
WOFF2_SubstreamRec, WOFF2_PointRec): New structures.
(WOFF2_TableRec): s/OrigLength/dst_length/.
* src/sfnt/sfwoff2.c (READ_255USHORT, READ_BASE128): Use
`FT_SET_ERROR' to set implicit `error' variable.
(WRITE_SHORT): New macro.
(N_CONTOUR_STREAM, N_POINTS_STREAM, FLAG_STREAM, GLYPH_STREAM,
COMPOSITE_STREAM, BBOX_STREAM, INSTRUCTION_STREAM): New macros to
refer to substreams of the transformed `glyf' tables.
(Read255UShort, ReadBase128): Return errors set by `FT_READ_XXX'
macros.
(with_sign, safe_int_addition): New functions to add sign to values
based on a flag and perform safe addition respectively.
(triplet_decode): Decode variable-length (flag, xCoordinate,
yCoordinate) triplet for a simple glyph. See
https://www.w3.org/TR/WOFF2/#triplet_decoding
(store_points, compute_bbox, composteGlyph_size, reconstruct_glyf):
New functions.
(reconstruct_font): Call `reconstruct_glyf'.
* src/sfnt/sfwoff2.h: Add required constants.
* src/sfnt/woff2tags.h: Move out constants to `sfwoff2.h'.
2019-07-12 23:44:17 +02:00
|
|
|
FT_UShort num_glyphs;
|
|
|
|
FT_UShort num_hmetrics;
|
|
|
|
FT_Short* x_mins;
|
|
|
|
|
2019-10-08 11:12:18 +02:00
|
|
|
WOFF2_Table glyf_table;
|
|
|
|
WOFF2_Table loca_table;
|
|
|
|
WOFF2_Table head_table;
|
2019-06-11 20:10:19 +02:00
|
|
|
|
2019-10-08 11:12:18 +02:00
|
|
|
} WOFF2_InfoRec, *WOFF2_Info;
|
2019-06-11 20:10:19 +02:00
|
|
|
|
|
|
|
|
[woff2] Reconstruct transformed `glyf' table.
Reconstruct `glyf' table if it is transformed in the uncompressed
table stream. Also add necessary structures, macros and functions.
* include/freetype/internal/wofftypes.h (WOFF2_InfoRec,
WOFF2_SubstreamRec, WOFF2_PointRec): New structures.
(WOFF2_TableRec): s/OrigLength/dst_length/.
* src/sfnt/sfwoff2.c (READ_255USHORT, READ_BASE128): Use
`FT_SET_ERROR' to set implicit `error' variable.
(WRITE_SHORT): New macro.
(N_CONTOUR_STREAM, N_POINTS_STREAM, FLAG_STREAM, GLYPH_STREAM,
COMPOSITE_STREAM, BBOX_STREAM, INSTRUCTION_STREAM): New macros to
refer to substreams of the transformed `glyf' tables.
(Read255UShort, ReadBase128): Return errors set by `FT_READ_XXX'
macros.
(with_sign, safe_int_addition): New functions to add sign to values
based on a flag and perform safe addition respectively.
(triplet_decode): Decode variable-length (flag, xCoordinate,
yCoordinate) triplet for a simple glyph. See
https://www.w3.org/TR/WOFF2/#triplet_decoding
(store_points, compute_bbox, composteGlyph_size, reconstruct_glyf):
New functions.
(reconstruct_font): Call `reconstruct_glyf'.
* src/sfnt/sfwoff2.h: Add required constants.
* src/sfnt/woff2tags.h: Move out constants to `sfwoff2.h'.
2019-07-12 23:44:17 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
|
|
|
* @struct:
|
|
|
|
* WOFF2_SubstreamRec
|
|
|
|
*
|
|
|
|
* @description:
|
|
|
|
* This structure stores information about a substream in the transformed
|
2019-08-21 16:51:02 +02:00
|
|
|
* 'glyf' table in a WOFF2 stream.
|
[woff2] Reconstruct transformed `glyf' table.
Reconstruct `glyf' table if it is transformed in the uncompressed
table stream. Also add necessary structures, macros and functions.
* include/freetype/internal/wofftypes.h (WOFF2_InfoRec,
WOFF2_SubstreamRec, WOFF2_PointRec): New structures.
(WOFF2_TableRec): s/OrigLength/dst_length/.
* src/sfnt/sfwoff2.c (READ_255USHORT, READ_BASE128): Use
`FT_SET_ERROR' to set implicit `error' variable.
(WRITE_SHORT): New macro.
(N_CONTOUR_STREAM, N_POINTS_STREAM, FLAG_STREAM, GLYPH_STREAM,
COMPOSITE_STREAM, BBOX_STREAM, INSTRUCTION_STREAM): New macros to
refer to substreams of the transformed `glyf' tables.
(Read255UShort, ReadBase128): Return errors set by `FT_READ_XXX'
macros.
(with_sign, safe_int_addition): New functions to add sign to values
based on a flag and perform safe addition respectively.
(triplet_decode): Decode variable-length (flag, xCoordinate,
yCoordinate) triplet for a simple glyph. See
https://www.w3.org/TR/WOFF2/#triplet_decoding
(store_points, compute_bbox, composteGlyph_size, reconstruct_glyf):
New functions.
(reconstruct_font): Call `reconstruct_glyf'.
* src/sfnt/sfwoff2.h: Add required constants.
* src/sfnt/woff2tags.h: Move out constants to `sfwoff2.h'.
2019-07-12 23:44:17 +02:00
|
|
|
*
|
|
|
|
* @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;
|
2019-08-21 16:51:02 +02:00
|
|
|
|
[woff2] Reconstruct transformed `glyf' table.
Reconstruct `glyf' table if it is transformed in the uncompressed
table stream. Also add necessary structures, macros and functions.
* include/freetype/internal/wofftypes.h (WOFF2_InfoRec,
WOFF2_SubstreamRec, WOFF2_PointRec): New structures.
(WOFF2_TableRec): s/OrigLength/dst_length/.
* src/sfnt/sfwoff2.c (READ_255USHORT, READ_BASE128): Use
`FT_SET_ERROR' to set implicit `error' variable.
(WRITE_SHORT): New macro.
(N_CONTOUR_STREAM, N_POINTS_STREAM, FLAG_STREAM, GLYPH_STREAM,
COMPOSITE_STREAM, BBOX_STREAM, INSTRUCTION_STREAM): New macros to
refer to substreams of the transformed `glyf' tables.
(Read255UShort, ReadBase128): Return errors set by `FT_READ_XXX'
macros.
(with_sign, safe_int_addition): New functions to add sign to values
based on a flag and perform safe addition respectively.
(triplet_decode): Decode variable-length (flag, xCoordinate,
yCoordinate) triplet for a simple glyph. See
https://www.w3.org/TR/WOFF2/#triplet_decoding
(store_points, compute_bbox, composteGlyph_size, reconstruct_glyf):
New functions.
(reconstruct_font): Call `reconstruct_glyf'.
* src/sfnt/sfwoff2.h: Add required constants.
* src/sfnt/woff2tags.h: Move out constants to `sfwoff2.h'.
2019-07-12 23:44:17 +02:00
|
|
|
} WOFF2_SubstreamRec, *WOFF2_Substream;
|
|
|
|
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
*
|
|
|
|
* @struct:
|
|
|
|
* WOFF2_PointRec
|
|
|
|
*
|
|
|
|
* @description:
|
|
|
|
* This structure stores information about a point in the transformed
|
2019-08-21 16:51:02 +02:00
|
|
|
* 'glyf' table in a WOFF2 stream.
|
[woff2] Reconstruct transformed `glyf' table.
Reconstruct `glyf' table if it is transformed in the uncompressed
table stream. Also add necessary structures, macros and functions.
* include/freetype/internal/wofftypes.h (WOFF2_InfoRec,
WOFF2_SubstreamRec, WOFF2_PointRec): New structures.
(WOFF2_TableRec): s/OrigLength/dst_length/.
* src/sfnt/sfwoff2.c (READ_255USHORT, READ_BASE128): Use
`FT_SET_ERROR' to set implicit `error' variable.
(WRITE_SHORT): New macro.
(N_CONTOUR_STREAM, N_POINTS_STREAM, FLAG_STREAM, GLYPH_STREAM,
COMPOSITE_STREAM, BBOX_STREAM, INSTRUCTION_STREAM): New macros to
refer to substreams of the transformed `glyf' tables.
(Read255UShort, ReadBase128): Return errors set by `FT_READ_XXX'
macros.
(with_sign, safe_int_addition): New functions to add sign to values
based on a flag and perform safe addition respectively.
(triplet_decode): Decode variable-length (flag, xCoordinate,
yCoordinate) triplet for a simple glyph. See
https://www.w3.org/TR/WOFF2/#triplet_decoding
(store_points, compute_bbox, composteGlyph_size, reconstruct_glyf):
New functions.
(reconstruct_font): Call `reconstruct_glyf'.
* src/sfnt/sfwoff2.h: Add required constants.
* src/sfnt/woff2tags.h: Move out constants to `sfwoff2.h'.
2019-07-12 23:44:17 +02:00
|
|
|
*
|
|
|
|
* @fields:
|
|
|
|
* x ::
|
2019-08-27 10:08:01 +02:00
|
|
|
* x-coordinate of point.
|
[woff2] Reconstruct transformed `glyf' table.
Reconstruct `glyf' table if it is transformed in the uncompressed
table stream. Also add necessary structures, macros and functions.
* include/freetype/internal/wofftypes.h (WOFF2_InfoRec,
WOFF2_SubstreamRec, WOFF2_PointRec): New structures.
(WOFF2_TableRec): s/OrigLength/dst_length/.
* src/sfnt/sfwoff2.c (READ_255USHORT, READ_BASE128): Use
`FT_SET_ERROR' to set implicit `error' variable.
(WRITE_SHORT): New macro.
(N_CONTOUR_STREAM, N_POINTS_STREAM, FLAG_STREAM, GLYPH_STREAM,
COMPOSITE_STREAM, BBOX_STREAM, INSTRUCTION_STREAM): New macros to
refer to substreams of the transformed `glyf' tables.
(Read255UShort, ReadBase128): Return errors set by `FT_READ_XXX'
macros.
(with_sign, safe_int_addition): New functions to add sign to values
based on a flag and perform safe addition respectively.
(triplet_decode): Decode variable-length (flag, xCoordinate,
yCoordinate) triplet for a simple glyph. See
https://www.w3.org/TR/WOFF2/#triplet_decoding
(store_points, compute_bbox, composteGlyph_size, reconstruct_glyf):
New functions.
(reconstruct_font): Call `reconstruct_glyf'.
* src/sfnt/sfwoff2.h: Add required constants.
* src/sfnt/woff2tags.h: Move out constants to `sfwoff2.h'.
2019-07-12 23:44:17 +02:00
|
|
|
*
|
|
|
|
* y ::
|
2019-08-27 10:08:01 +02:00
|
|
|
* y-coordinate of point.
|
[woff2] Reconstruct transformed `glyf' table.
Reconstruct `glyf' table if it is transformed in the uncompressed
table stream. Also add necessary structures, macros and functions.
* include/freetype/internal/wofftypes.h (WOFF2_InfoRec,
WOFF2_SubstreamRec, WOFF2_PointRec): New structures.
(WOFF2_TableRec): s/OrigLength/dst_length/.
* src/sfnt/sfwoff2.c (READ_255USHORT, READ_BASE128): Use
`FT_SET_ERROR' to set implicit `error' variable.
(WRITE_SHORT): New macro.
(N_CONTOUR_STREAM, N_POINTS_STREAM, FLAG_STREAM, GLYPH_STREAM,
COMPOSITE_STREAM, BBOX_STREAM, INSTRUCTION_STREAM): New macros to
refer to substreams of the transformed `glyf' tables.
(Read255UShort, ReadBase128): Return errors set by `FT_READ_XXX'
macros.
(with_sign, safe_int_addition): New functions to add sign to values
based on a flag and perform safe addition respectively.
(triplet_decode): Decode variable-length (flag, xCoordinate,
yCoordinate) triplet for a simple glyph. See
https://www.w3.org/TR/WOFF2/#triplet_decoding
(store_points, compute_bbox, composteGlyph_size, reconstruct_glyf):
New functions.
(reconstruct_font): Call `reconstruct_glyf'.
* src/sfnt/sfwoff2.h: Add required constants.
* src/sfnt/woff2tags.h: Move out constants to `sfwoff2.h'.
2019-07-12 23:44:17 +02:00
|
|
|
*
|
|
|
|
* on_curve ::
|
2019-08-27 10:08:01 +02:00
|
|
|
* Set if point is on-curve.
|
[woff2] Reconstruct transformed `glyf' table.
Reconstruct `glyf' table if it is transformed in the uncompressed
table stream. Also add necessary structures, macros and functions.
* include/freetype/internal/wofftypes.h (WOFF2_InfoRec,
WOFF2_SubstreamRec, WOFF2_PointRec): New structures.
(WOFF2_TableRec): s/OrigLength/dst_length/.
* src/sfnt/sfwoff2.c (READ_255USHORT, READ_BASE128): Use
`FT_SET_ERROR' to set implicit `error' variable.
(WRITE_SHORT): New macro.
(N_CONTOUR_STREAM, N_POINTS_STREAM, FLAG_STREAM, GLYPH_STREAM,
COMPOSITE_STREAM, BBOX_STREAM, INSTRUCTION_STREAM): New macros to
refer to substreams of the transformed `glyf' tables.
(Read255UShort, ReadBase128): Return errors set by `FT_READ_XXX'
macros.
(with_sign, safe_int_addition): New functions to add sign to values
based on a flag and perform safe addition respectively.
(triplet_decode): Decode variable-length (flag, xCoordinate,
yCoordinate) triplet for a simple glyph. See
https://www.w3.org/TR/WOFF2/#triplet_decoding
(store_points, compute_bbox, composteGlyph_size, reconstruct_glyf):
New functions.
(reconstruct_font): Call `reconstruct_glyf'.
* src/sfnt/sfwoff2.h: Add required constants.
* src/sfnt/woff2tags.h: Move out constants to `sfwoff2.h'.
2019-07-12 23:44:17 +02:00
|
|
|
*/
|
|
|
|
typedef struct WOFF2_PointRec_
|
|
|
|
{
|
|
|
|
FT_Int x;
|
|
|
|
FT_Int y;
|
|
|
|
FT_Bool on_curve;
|
2019-08-21 16:51:02 +02:00
|
|
|
|
[woff2] Reconstruct transformed `glyf' table.
Reconstruct `glyf' table if it is transformed in the uncompressed
table stream. Also add necessary structures, macros and functions.
* include/freetype/internal/wofftypes.h (WOFF2_InfoRec,
WOFF2_SubstreamRec, WOFF2_PointRec): New structures.
(WOFF2_TableRec): s/OrigLength/dst_length/.
* src/sfnt/sfwoff2.c (READ_255USHORT, READ_BASE128): Use
`FT_SET_ERROR' to set implicit `error' variable.
(WRITE_SHORT): New macro.
(N_CONTOUR_STREAM, N_POINTS_STREAM, FLAG_STREAM, GLYPH_STREAM,
COMPOSITE_STREAM, BBOX_STREAM, INSTRUCTION_STREAM): New macros to
refer to substreams of the transformed `glyf' tables.
(Read255UShort, ReadBase128): Return errors set by `FT_READ_XXX'
macros.
(with_sign, safe_int_addition): New functions to add sign to values
based on a flag and perform safe addition respectively.
(triplet_decode): Decode variable-length (flag, xCoordinate,
yCoordinate) triplet for a simple glyph. See
https://www.w3.org/TR/WOFF2/#triplet_decoding
(store_points, compute_bbox, composteGlyph_size, reconstruct_glyf):
New functions.
(reconstruct_font): Call `reconstruct_glyf'.
* src/sfnt/sfwoff2.h: Add required constants.
* src/sfnt/woff2tags.h: Move out constants to `sfwoff2.h'.
2019-07-12 23:44:17 +02:00
|
|
|
} WOFF2_PointRec, *WOFF2_Point;
|
|
|
|
|
|
|
|
|
2019-05-30 20:27:34 +02:00
|
|
|
FT_END_HEADER
|
|
|
|
|
|
|
|
#endif /* WOFFTYPES_H_ */
|
|
|
|
|
|
|
|
|
|
|
|
/* END */
|