summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/truetype/ttobjs.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/freetype/src/truetype/ttobjs.h')
-rw-r--r--src/3rdparty/freetype/src/truetype/ttobjs.h327
1 files changed, 164 insertions, 163 deletions
diff --git a/src/3rdparty/freetype/src/truetype/ttobjs.h b/src/3rdparty/freetype/src/truetype/ttobjs.h
index 38fa30e4e9..40eb37b4c4 100644
--- a/src/3rdparty/freetype/src/truetype/ttobjs.h
+++ b/src/3rdparty/freetype/src/truetype/ttobjs.h
@@ -1,67 +1,66 @@
-/***************************************************************************/
-/* */
-/* ttobjs.h */
-/* */
-/* Objects manager (specification). */
-/* */
-/* Copyright 1996-2018 by */
-/* 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ttobjs.h
+ *
+ * Objects manager (specification).
+ *
+ * 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,
+ * 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 TTOBJS_H_
#define TTOBJS_H_
-#include <ft2build.h>
-#include FT_INTERNAL_OBJECTS_H
-#include FT_INTERNAL_TRUETYPE_TYPES_H
+#include <freetype/internal/ftobjs.h>
+#include <freetype/internal/tttypes.h>
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Type> */
- /* TT_Driver */
- /* */
- /* <Description> */
- /* A handle to a TrueType driver object. */
- /* */
+ /**************************************************************************
+ *
+ * @Type:
+ * TT_Driver
+ *
+ * @Description:
+ * A handle to a TrueType driver object.
+ */
typedef struct TT_DriverRec_* TT_Driver;
- /*************************************************************************/
- /* */
- /* <Type> */
- /* TT_GlyphSlot */
- /* */
- /* <Description> */
- /* A handle to a TrueType glyph slot object. */
- /* */
- /* <Note> */
- /* This is a direct typedef of FT_GlyphSlot, as there is nothing */
- /* specific about the TrueType glyph slot. */
- /* */
+ /**************************************************************************
+ *
+ * @Type:
+ * TT_GlyphSlot
+ *
+ * @Description:
+ * A handle to a TrueType glyph slot object.
+ *
+ * @Note:
+ * This is a direct typedef of FT_GlyphSlot, as there is nothing
+ * specific about the TrueType glyph slot.
+ */
typedef FT_GlyphSlot TT_GlyphSlot;
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_GraphicsState */
- /* */
- /* <Description> */
- /* The TrueType graphics state used during bytecode interpretation. */
- /* */
+ /**************************************************************************
+ *
+ * @Struct:
+ * TT_GraphicsState
+ *
+ * @Description:
+ * The TrueType graphics state used during bytecode interpretation.
+ */
typedef struct TT_GraphicsState_
{
FT_UShort rp0;
@@ -113,25 +112,25 @@ FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* EXECUTION SUBTABLES */
- /* */
- /* These sub-tables relate to instruction execution. */
- /* */
- /*************************************************************************/
+ /**************************************************************************
+ *
+ * EXECUTION SUBTABLES
+ *
+ * These sub-tables relate to instruction execution.
+ *
+ */
#define TT_MAX_CODE_RANGES 3
- /*************************************************************************/
- /* */
- /* There can only be 3 active code ranges at once: */
- /* - the Font Program */
- /* - the CVT Program */
- /* - a glyph's instructions set */
- /* */
+ /**************************************************************************
+ *
+ * There can only be 3 active code ranges at once:
+ * - the Font Program
+ * - the CVT Program
+ * - a glyph's instructions set
+ */
typedef enum TT_CodeRange_Tag_
{
tt_coderange_none = 0,
@@ -152,10 +151,10 @@ FT_BEGIN_HEADER
typedef TT_CodeRange TT_CodeRangeTable[TT_MAX_CODE_RANGES];
- /*************************************************************************/
- /* */
- /* Defines a function/instruction definition record. */
- /* */
+ /**************************************************************************
+ *
+ * Defines a function/instruction definition record.
+ */
typedef struct TT_DefRecord_
{
FT_Int range; /* in which code range is it located? */
@@ -163,16 +162,14 @@ FT_BEGIN_HEADER
FT_Long end; /* where does it end? */
FT_UInt opc; /* function #, or instruction code */
FT_Bool active; /* is it active? */
- FT_Bool inline_delta; /* is function that defines inline delta? */
- FT_ULong sph_fdef_flags; /* flags to identify special functions */
} TT_DefRecord, *TT_DefArray;
- /*************************************************************************/
- /* */
- /* Subglyph transformation record. */
- /* */
+ /**************************************************************************
+ *
+ * Subglyph transformation record.
+ */
typedef struct TT_Transform_
{
FT_Fixed xx, xy; /* transformation matrix coefficients */
@@ -182,72 +179,72 @@ FT_BEGIN_HEADER
} TT_Transform;
- /*************************************************************************/
- /* */
- /* A note regarding non-squared pixels: */
- /* */
- /* (This text will probably go into some docs at some time; for now, it */
- /* is kept here to explain some definitions in the TT_Size_Metrics */
- /* record). */
- /* */
- /* The CVT is a one-dimensional array containing values that control */
- /* certain important characteristics in a font, like the height of all */
- /* capitals, all lowercase letter, default spacing or stem width/height. */
- /* */
- /* These values are found in FUnits in the font file, and must be scaled */
- /* to pixel coordinates before being used by the CVT and glyph programs. */
- /* Unfortunately, when using distinct x and y resolutions (or distinct x */
- /* and y pointsizes), there are two possible scalings. */
- /* */
- /* A first try was to implement a `lazy' scheme where all values were */
- /* scaled when first used. However, while some values are always used */
- /* in the same direction, some others are used under many different */
- /* circumstances and orientations. */
- /* */
- /* I have found a simpler way to do the same, and it even seems to work */
- /* in most of the cases: */
- /* */
- /* - All CVT values are scaled to the maximum ppem size. */
- /* */
- /* - When performing a read or write in the CVT, a ratio factor is used */
- /* to perform adequate scaling. Example: */
- /* */
- /* x_ppem = 14 */
- /* y_ppem = 10 */
- /* */
- /* We choose ppem = x_ppem = 14 as the CVT scaling size. All cvt */
- /* entries are scaled to it. */
- /* */
- /* x_ratio = 1.0 */
- /* y_ratio = y_ppem/ppem (< 1.0) */
- /* */
- /* We compute the current ratio like: */
- /* */
- /* - If projVector is horizontal, */
- /* ratio = x_ratio = 1.0 */
- /* */
- /* - if projVector is vertical, */
- /* ratio = y_ratio */
- /* */
- /* - else, */
- /* ratio = sqrt( (proj.x * x_ratio) ^ 2 + (proj.y * y_ratio) ^ 2 ) */
- /* */
- /* Reading a cvt value returns */
- /* ratio * cvt[index] */
- /* */
- /* Writing a cvt value in pixels: */
- /* cvt[index] / ratio */
- /* */
- /* The current ppem is simply */
- /* ratio * ppem */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* Metrics used by the TrueType size and context objects. */
- /* */
+ /**************************************************************************
+ *
+ * A note regarding non-squared pixels:
+ *
+ * (This text will probably go into some docs at some time; for now, it
+ * is kept here to explain some definitions in the TT_Size_Metrics
+ * record).
+ *
+ * The CVT is a one-dimensional array containing values that control
+ * certain important characteristics in a font, like the height of all
+ * capitals, all lowercase letter, default spacing or stem width/height.
+ *
+ * These values are found in FUnits in the font file, and must be scaled
+ * to pixel coordinates before being used by the CVT and glyph programs.
+ * Unfortunately, when using distinct x and y resolutions (or distinct x
+ * and y pointsizes), there are two possible scalings.
+ *
+ * A first try was to implement a `lazy' scheme where all values were
+ * scaled when first used. However, while some values are always used
+ * in the same direction, some others are used under many different
+ * circumstances and orientations.
+ *
+ * I have found a simpler way to do the same, and it even seems to work
+ * in most of the cases:
+ *
+ * - All CVT values are scaled to the maximum ppem size.
+ *
+ * - When performing a read or write in the CVT, a ratio factor is used
+ * to perform adequate scaling. Example:
+ *
+ * x_ppem = 14
+ * y_ppem = 10
+ *
+ * We choose ppem = x_ppem = 14 as the CVT scaling size. All cvt
+ * entries are scaled to it.
+ *
+ * x_ratio = 1.0
+ * y_ratio = y_ppem/ppem (< 1.0)
+ *
+ * We compute the current ratio like:
+ *
+ * - If projVector is horizontal,
+ * ratio = x_ratio = 1.0
+ *
+ * - if projVector is vertical,
+ * ratio = y_ratio
+ *
+ * - else,
+ * ratio = sqrt( (proj.x * x_ratio) ^ 2 + (proj.y * y_ratio) ^ 2 )
+ *
+ * Reading a cvt value returns
+ * ratio * cvt[index]
+ *
+ * Writing a cvt value in pixels:
+ * cvt[index] / ratio
+ *
+ * The current ppem is simply
+ * ratio * ppem
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * Metrics used by the TrueType size and context objects.
+ */
typedef struct TT_Size_Metrics_
{
/* for non-square pixels */
@@ -268,10 +265,10 @@ FT_BEGIN_HEADER
} TT_Size_Metrics;
- /*************************************************************************/
- /* */
- /* TrueType size class. */
- /* */
+ /**************************************************************************
+ *
+ * TrueType size class.
+ */
typedef struct TT_SizeRec_
{
FT_SizeRec root;
@@ -283,6 +280,8 @@ FT_BEGIN_HEADER
TT_Size_Metrics ttmetrics;
+ FT_Byte* widthp; /* glyph widths from the hdmx table */
+
FT_ULong strike_index; /* 0xFFFFFFFF to indicate invalid */
#ifdef TT_USE_BYTECODE_INTERPRETER
@@ -324,10 +323,10 @@ FT_BEGIN_HEADER
} TT_SizeRec;
- /*************************************************************************/
- /* */
- /* TrueType driver class. */
- /* */
+ /**************************************************************************
+ *
+ * TrueType driver class.
+ */
typedef struct TT_DriverRec_
{
FT_DriverRec root;
@@ -348,10 +347,10 @@ FT_BEGIN_HEADER
/* will always use the TT driver to create them. */
- /*************************************************************************/
- /* */
- /* Face functions */
- /* */
+ /**************************************************************************
+ *
+ * Face functions
+ */
FT_LOCAL( FT_Error )
tt_face_init( FT_Stream stream,
FT_Face ttface, /* TT_Face */
@@ -363,10 +362,10 @@ FT_BEGIN_HEADER
tt_face_done( FT_Face ttface ); /* TT_Face */
- /*************************************************************************/
- /* */
- /* Size functions */
- /* */
+ /**************************************************************************
+ *
+ * Size functions
+ */
FT_LOCAL( FT_Error )
tt_size_init( FT_Size ttsize ); /* TT_Size */
@@ -390,14 +389,16 @@ FT_BEGIN_HEADER
#endif /* TT_USE_BYTECODE_INTERPRETER */
FT_LOCAL( FT_Error )
- tt_size_reset( TT_Size size,
- FT_Bool only_height );
+ tt_size_reset_height( FT_Size size );
+
+ FT_LOCAL( FT_Error )
+ tt_size_reset( TT_Size size );
- /*************************************************************************/
- /* */
- /* Driver functions */
- /* */
+ /**************************************************************************
+ *
+ * Driver functions
+ */
FT_LOCAL( FT_Error )
tt_driver_init( FT_Module ttdriver ); /* TT_Driver */
@@ -405,10 +406,10 @@ FT_BEGIN_HEADER
tt_driver_done( FT_Module ttdriver ); /* TT_Driver */
- /*************************************************************************/
- /* */
- /* Slot functions */
- /* */
+ /**************************************************************************
+ *
+ * Slot functions
+ */
FT_LOCAL( FT_Error )
tt_slot_init( FT_GlyphSlot slot );