• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
2  *
3  * svmetric.h
4  *
5  *   The FreeType services for metrics variations (specification).
6  *
7  * Copyright 2016-2018 by
8  * David Turner, Robert Wilhelm, and Werner Lemberg.
9  *
10  * This file is part of the FreeType project, and may only be used,
11  * modified, and distributed under the terms of the FreeType project
12  * license, LICENSE.TXT.  By continuing to use, modify, or distribute
13  * this file you indicate that you have read the license and
14  * understand and accept it fully.
15  *
16  */
17 
18 
19 #ifndef SVMETRIC_H_
20 #define SVMETRIC_H_
21 
22 #include FT_INTERNAL_SERVICE_H
23 
24 
25 FT_BEGIN_HEADER
26 
27 
28   /*
29    * A service to manage the `HVAR, `MVAR', and `VVAR' OpenType tables.
30    *
31    */
32 
33 #define FT_SERVICE_ID_METRICS_VARIATIONS  "metrics-variations"
34 
35 
36   /* HVAR */
37 
38   typedef FT_Error
39   (*FT_HAdvance_Adjust_Func)( FT_Face  face,
40                               FT_UInt  gindex,
41                               FT_Int  *avalue );
42 
43   typedef FT_Error
44   (*FT_LSB_Adjust_Func)( FT_Face  face,
45                          FT_UInt  gindex,
46                          FT_Int  *avalue );
47 
48   typedef FT_Error
49   (*FT_RSB_Adjust_Func)( FT_Face  face,
50                          FT_UInt  gindex,
51                          FT_Int  *avalue );
52 
53   /* VVAR */
54 
55   typedef FT_Error
56   (*FT_VAdvance_Adjust_Func)( FT_Face  face,
57                               FT_UInt  gindex,
58                               FT_Int  *avalue );
59 
60   typedef FT_Error
61   (*FT_TSB_Adjust_Func)( FT_Face  face,
62                          FT_UInt  gindex,
63                          FT_Int  *avalue );
64 
65   typedef FT_Error
66   (*FT_BSB_Adjust_Func)( FT_Face  face,
67                          FT_UInt  gindex,
68                          FT_Int  *avalue );
69 
70   typedef FT_Error
71   (*FT_VOrg_Adjust_Func)( FT_Face  face,
72                           FT_UInt  gindex,
73                           FT_Int  *avalue );
74 
75   /* MVAR */
76 
77   typedef void
78   (*FT_Metrics_Adjust_Func)( FT_Face  face );
79 
80 
FT_DEFINE_SERVICE(MetricsVariations)81   FT_DEFINE_SERVICE( MetricsVariations )
82   {
83     FT_HAdvance_Adjust_Func  hadvance_adjust;
84     FT_LSB_Adjust_Func       lsb_adjust;
85     FT_RSB_Adjust_Func       rsb_adjust;
86 
87     FT_VAdvance_Adjust_Func  vadvance_adjust;
88     FT_TSB_Adjust_Func       tsb_adjust;
89     FT_BSB_Adjust_Func       bsb_adjust;
90     FT_VOrg_Adjust_Func      vorg_adjust;
91 
92     FT_Metrics_Adjust_Func   metrics_adjust;
93   };
94 
95 
96 #define FT_DEFINE_SERVICE_METRICSVARIATIONSREC( class_,            \
97                                                 hadvance_adjust_,  \
98                                                 lsb_adjust_,       \
99                                                 rsb_adjust_,       \
100                                                 vadvance_adjust_,  \
101                                                 tsb_adjust_,       \
102                                                 bsb_adjust_,       \
103                                                 vorg_adjust_,      \
104                                                 metrics_adjust_  ) \
105   static const FT_Service_MetricsVariationsRec  class_ =           \
106   {                                                                \
107     hadvance_adjust_,                                              \
108     lsb_adjust_,                                                   \
109     rsb_adjust_,                                                   \
110     vadvance_adjust_,                                              \
111     tsb_adjust_,                                                   \
112     bsb_adjust_,                                                   \
113     vorg_adjust_,                                                  \
114     metrics_adjust_                                                \
115   };
116 
117   /* */
118 
119 
120 FT_END_HEADER
121 
122 #endif /* SVMETRIC_H_ */
123 
124 
125 /* END */
126