xref: /aosp_15_r20/external/freetype/include/freetype/internal/ftmmtypes.h (revision 63949dbd25bcc50c4e1178497ff9e9574d44fc5a)
1 /****************************************************************************
2  *
3  * ftmmtypes.h
4  *
5  *   OpenType Variations type definitions for internal use
6  *   with the multi-masters service (specification).
7  *
8  * Copyright (C) 2022-2023 by
9  * David Turner, Robert Wilhelm, Werner Lemberg, George Williams, and
10  * Dominik Röttsches.
11  *
12  * This file is part of the FreeType project, and may only be used,
13  * modified, and distributed under the terms of the FreeType project
14  * license, LICENSE.TXT.  By continuing to use, modify, or distribute
15  * this file you indicate that you have read the license and
16  * understand and accept it fully.
17  *
18  */
19 
20 
21 #ifndef FTMMTYPES_H_
22 #define FTMMTYPES_H_
23 
24 FT_BEGIN_HEADER
25 
26 
27   typedef FT_Int32  FT_ItemVarDelta;
28 
29   typedef struct  GX_ItemVarDataRec_
30   {
31     FT_UInt            itemCount;      /* Number of delta sets per item.   */
32     FT_UInt            regionIdxCount; /* Number of region indices.        */
33     FT_UInt*           regionIndices;  /* Array of `regionCount` indices;  */
34                                        /* these index `varRegionList`.     */
35     FT_Byte*           deltaSet;       /* Array of `itemCount` deltas;     */
36                                        /* use `innerIndex` for this array. */
37     FT_UShort          wordDeltaCount; /* Number of the first 32-bit ints  */
38                                        /* or 16-bit ints of `deltaSet`     */
39                                        /* depending on `longWords`.        */
40     FT_Bool            longWords;      /* If true, `deltaSet` is a 32-bit  */
41                                        /* array followed by a 16-bit       */
42                                        /* array, otherwise a 16-bit array  */
43                                        /* followed by an 8-bit array.      */
44   } GX_ItemVarDataRec, *GX_ItemVarData;
45 
46 
47   /* contribution of one axis to a region */
48   typedef struct  GX_AxisCoordsRec_
49   {
50     FT_Fixed  startCoord;
51     FT_Fixed  peakCoord;      /* zero means no effect (factor = 1) */
52     FT_Fixed  endCoord;
53 
54   } GX_AxisCoordsRec, *GX_AxisCoords;
55 
56 
57   typedef struct  GX_VarRegionRec_
58   {
59     GX_AxisCoords  axisList;               /* array of axisCount records */
60 
61   } GX_VarRegionRec, *GX_VarRegion;
62 
63 
64   /* item variation store */
65   typedef struct  GX_ItemVarStoreRec_
66   {
67     FT_UInt         dataCount;
68     GX_ItemVarData  varData;            /* array of dataCount records;     */
69                                         /* use `outerIndex' for this array */
70     FT_UShort     axisCount;
71     FT_UInt       regionCount;          /* total number of regions defined */
72     GX_VarRegion  varRegionList;
73 
74   } GX_ItemVarStoreRec, *GX_ItemVarStore;
75 
76 
77   typedef struct  GX_DeltaSetIdxMapRec_
78   {
79     FT_ULong  mapCount;
80     FT_UInt*  outerIndex;               /* indices to item var data */
81     FT_UInt*  innerIndex;               /* indices to delta set     */
82 
83   } GX_DeltaSetIdxMapRec, *GX_DeltaSetIdxMap;
84 
85 
86 FT_END_HEADER
87 
88 #endif /* FTMMTYPES_H_ */
89 
90 
91 /* END */
92