1 /**************************************************************************** 2 * 3 * svmetric.h 4 * 5 * The FreeType services for metrics variations (specification). 6 * 7 * Copyright (C) 2016-2023 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 <freetype/internal/ftserv.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 typedef FT_Error 81 (*FT_Size_Reset_Func)( FT_Size size ); 82 83 FT_DEFINE_SERVICE(MetricsVariations)84 FT_DEFINE_SERVICE( MetricsVariations ) 85 { 86 FT_HAdvance_Adjust_Func hadvance_adjust; 87 FT_LSB_Adjust_Func lsb_adjust; 88 FT_RSB_Adjust_Func rsb_adjust; 89 90 FT_VAdvance_Adjust_Func vadvance_adjust; 91 FT_TSB_Adjust_Func tsb_adjust; 92 FT_BSB_Adjust_Func bsb_adjust; 93 FT_VOrg_Adjust_Func vorg_adjust; 94 95 FT_Metrics_Adjust_Func metrics_adjust; 96 FT_Size_Reset_Func size_reset; 97 }; 98 99 100 #define FT_DEFINE_SERVICE_METRICSVARIATIONSREC( class_, \ 101 hadvance_adjust_, \ 102 lsb_adjust_, \ 103 rsb_adjust_, \ 104 vadvance_adjust_, \ 105 tsb_adjust_, \ 106 bsb_adjust_, \ 107 vorg_adjust_, \ 108 metrics_adjust_, \ 109 size_reset_ ) \ 110 static const FT_Service_MetricsVariationsRec class_ = \ 111 { \ 112 hadvance_adjust_, \ 113 lsb_adjust_, \ 114 rsb_adjust_, \ 115 vadvance_adjust_, \ 116 tsb_adjust_, \ 117 bsb_adjust_, \ 118 vorg_adjust_, \ 119 metrics_adjust_, \ 120 size_reset_ \ 121 }; 122 123 /* */ 124 125 126 FT_END_HEADER 127 128 #endif /* SVMETRIC_H_ */ 129 130 131 /* END */ 132