vrshoot
diff libs/ft2static/freetype/ftmm.h @ 0:b2f14e535253
initial commit
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 01 Feb 2014 19:58:19 +0200 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/libs/ft2static/freetype/ftmm.h Sat Feb 01 19:58:19 2014 +0200 1.3 @@ -0,0 +1,378 @@ 1.4 +/***************************************************************************/ 1.5 +/* */ 1.6 +/* ftmm.h */ 1.7 +/* */ 1.8 +/* FreeType Multiple Master font interface (specification). */ 1.9 +/* */ 1.10 +/* Copyright 1996-2001, 2003, 2004, 2006, 2009 by */ 1.11 +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ 1.12 +/* */ 1.13 +/* This file is part of the FreeType project, and may only be used, */ 1.14 +/* modified, and distributed under the terms of the FreeType project */ 1.15 +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 1.16 +/* this file you indicate that you have read the license and */ 1.17 +/* understand and accept it fully. */ 1.18 +/* */ 1.19 +/***************************************************************************/ 1.20 + 1.21 + 1.22 +#ifndef __FTMM_H__ 1.23 +#define __FTMM_H__ 1.24 + 1.25 + 1.26 +#include <ft2build.h> 1.27 +#include FT_TYPE1_TABLES_H 1.28 + 1.29 + 1.30 +FT_BEGIN_HEADER 1.31 + 1.32 + 1.33 + /*************************************************************************/ 1.34 + /* */ 1.35 + /* <Section> */ 1.36 + /* multiple_masters */ 1.37 + /* */ 1.38 + /* <Title> */ 1.39 + /* Multiple Masters */ 1.40 + /* */ 1.41 + /* <Abstract> */ 1.42 + /* How to manage Multiple Masters fonts. */ 1.43 + /* */ 1.44 + /* <Description> */ 1.45 + /* The following types and functions are used to manage Multiple */ 1.46 + /* Master fonts, i.e., the selection of specific design instances by */ 1.47 + /* setting design axis coordinates. */ 1.48 + /* */ 1.49 + /* George Williams has extended this interface to make it work with */ 1.50 + /* both Type~1 Multiple Masters fonts and GX distortable (var) */ 1.51 + /* fonts. Some of these routines only work with MM fonts, others */ 1.52 + /* will work with both types. They are similar enough that a */ 1.53 + /* consistent interface makes sense. */ 1.54 + /* */ 1.55 + /*************************************************************************/ 1.56 + 1.57 + 1.58 + /*************************************************************************/ 1.59 + /* */ 1.60 + /* <Struct> */ 1.61 + /* FT_MM_Axis */ 1.62 + /* */ 1.63 + /* <Description> */ 1.64 + /* A simple structure used to model a given axis in design space for */ 1.65 + /* Multiple Masters fonts. */ 1.66 + /* */ 1.67 + /* This structure can't be used for GX var fonts. */ 1.68 + /* */ 1.69 + /* <Fields> */ 1.70 + /* name :: The axis's name. */ 1.71 + /* */ 1.72 + /* minimum :: The axis's minimum design coordinate. */ 1.73 + /* */ 1.74 + /* maximum :: The axis's maximum design coordinate. */ 1.75 + /* */ 1.76 + typedef struct FT_MM_Axis_ 1.77 + { 1.78 + FT_String* name; 1.79 + FT_Long minimum; 1.80 + FT_Long maximum; 1.81 + 1.82 + } FT_MM_Axis; 1.83 + 1.84 + 1.85 + /*************************************************************************/ 1.86 + /* */ 1.87 + /* <Struct> */ 1.88 + /* FT_Multi_Master */ 1.89 + /* */ 1.90 + /* <Description> */ 1.91 + /* A structure used to model the axes and space of a Multiple Masters */ 1.92 + /* font. */ 1.93 + /* */ 1.94 + /* This structure can't be used for GX var fonts. */ 1.95 + /* */ 1.96 + /* <Fields> */ 1.97 + /* num_axis :: Number of axes. Cannot exceed~4. */ 1.98 + /* */ 1.99 + /* num_designs :: Number of designs; should be normally 2^num_axis */ 1.100 + /* even though the Type~1 specification strangely */ 1.101 + /* allows for intermediate designs to be present. This */ 1.102 + /* number cannot exceed~16. */ 1.103 + /* */ 1.104 + /* axis :: A table of axis descriptors. */ 1.105 + /* */ 1.106 + typedef struct FT_Multi_Master_ 1.107 + { 1.108 + FT_UInt num_axis; 1.109 + FT_UInt num_designs; 1.110 + FT_MM_Axis axis[T1_MAX_MM_AXIS]; 1.111 + 1.112 + } FT_Multi_Master; 1.113 + 1.114 + 1.115 + /*************************************************************************/ 1.116 + /* */ 1.117 + /* <Struct> */ 1.118 + /* FT_Var_Axis */ 1.119 + /* */ 1.120 + /* <Description> */ 1.121 + /* A simple structure used to model a given axis in design space for */ 1.122 + /* Multiple Masters and GX var fonts. */ 1.123 + /* */ 1.124 + /* <Fields> */ 1.125 + /* name :: The axis's name. */ 1.126 + /* Not always meaningful for GX. */ 1.127 + /* */ 1.128 + /* minimum :: The axis's minimum design coordinate. */ 1.129 + /* */ 1.130 + /* def :: The axis's default design coordinate. */ 1.131 + /* FreeType computes meaningful default values for MM; it */ 1.132 + /* is then an integer value, not in 16.16 format. */ 1.133 + /* */ 1.134 + /* maximum :: The axis's maximum design coordinate. */ 1.135 + /* */ 1.136 + /* tag :: The axis's tag (the GX equivalent to `name'). */ 1.137 + /* FreeType provides default values for MM if possible. */ 1.138 + /* */ 1.139 + /* strid :: The entry in `name' table (another GX version of */ 1.140 + /* `name'). */ 1.141 + /* Not meaningful for MM. */ 1.142 + /* */ 1.143 + typedef struct FT_Var_Axis_ 1.144 + { 1.145 + FT_String* name; 1.146 + 1.147 + FT_Fixed minimum; 1.148 + FT_Fixed def; 1.149 + FT_Fixed maximum; 1.150 + 1.151 + FT_ULong tag; 1.152 + FT_UInt strid; 1.153 + 1.154 + } FT_Var_Axis; 1.155 + 1.156 + 1.157 + /*************************************************************************/ 1.158 + /* */ 1.159 + /* <Struct> */ 1.160 + /* FT_Var_Named_Style */ 1.161 + /* */ 1.162 + /* <Description> */ 1.163 + /* A simple structure used to model a named style in a GX var font. */ 1.164 + /* */ 1.165 + /* This structure can't be used for MM fonts. */ 1.166 + /* */ 1.167 + /* <Fields> */ 1.168 + /* coords :: The design coordinates for this style. */ 1.169 + /* This is an array with one entry for each axis. */ 1.170 + /* */ 1.171 + /* strid :: The entry in `name' table identifying this style. */ 1.172 + /* */ 1.173 + typedef struct FT_Var_Named_Style_ 1.174 + { 1.175 + FT_Fixed* coords; 1.176 + FT_UInt strid; 1.177 + 1.178 + } FT_Var_Named_Style; 1.179 + 1.180 + 1.181 + /*************************************************************************/ 1.182 + /* */ 1.183 + /* <Struct> */ 1.184 + /* FT_MM_Var */ 1.185 + /* */ 1.186 + /* <Description> */ 1.187 + /* A structure used to model the axes and space of a Multiple Masters */ 1.188 + /* or GX var distortable font. */ 1.189 + /* */ 1.190 + /* Some fields are specific to one format and not to the other. */ 1.191 + /* */ 1.192 + /* <Fields> */ 1.193 + /* num_axis :: The number of axes. The maximum value is~4 for */ 1.194 + /* MM; no limit in GX. */ 1.195 + /* */ 1.196 + /* num_designs :: The number of designs; should be normally */ 1.197 + /* 2^num_axis for MM fonts. Not meaningful for GX */ 1.198 + /* (where every glyph could have a different */ 1.199 + /* number of designs). */ 1.200 + /* */ 1.201 + /* num_namedstyles :: The number of named styles; only meaningful for */ 1.202 + /* GX which allows certain design coordinates to */ 1.203 + /* have a string ID (in the `name' table) */ 1.204 + /* associated with them. The font can tell the */ 1.205 + /* user that, for example, Weight=1.5 is `Bold'. */ 1.206 + /* */ 1.207 + /* axis :: A table of axis descriptors. */ 1.208 + /* GX fonts contain slightly more data than MM. */ 1.209 + /* */ 1.210 + /* namedstyles :: A table of named styles. */ 1.211 + /* Only meaningful with GX. */ 1.212 + /* */ 1.213 + typedef struct FT_MM_Var_ 1.214 + { 1.215 + FT_UInt num_axis; 1.216 + FT_UInt num_designs; 1.217 + FT_UInt num_namedstyles; 1.218 + FT_Var_Axis* axis; 1.219 + FT_Var_Named_Style* namedstyle; 1.220 + 1.221 + } FT_MM_Var; 1.222 + 1.223 + 1.224 + /* */ 1.225 + 1.226 + 1.227 + /*************************************************************************/ 1.228 + /* */ 1.229 + /* <Function> */ 1.230 + /* FT_Get_Multi_Master */ 1.231 + /* */ 1.232 + /* <Description> */ 1.233 + /* Retrieve the Multiple Master descriptor of a given font. */ 1.234 + /* */ 1.235 + /* This function can't be used with GX fonts. */ 1.236 + /* */ 1.237 + /* <Input> */ 1.238 + /* face :: A handle to the source face. */ 1.239 + /* */ 1.240 + /* <Output> */ 1.241 + /* amaster :: The Multiple Masters descriptor. */ 1.242 + /* */ 1.243 + /* <Return> */ 1.244 + /* FreeType error code. 0~means success. */ 1.245 + /* */ 1.246 + FT_EXPORT( FT_Error ) 1.247 + FT_Get_Multi_Master( FT_Face face, 1.248 + FT_Multi_Master *amaster ); 1.249 + 1.250 + 1.251 + /*************************************************************************/ 1.252 + /* */ 1.253 + /* <Function> */ 1.254 + /* FT_Get_MM_Var */ 1.255 + /* */ 1.256 + /* <Description> */ 1.257 + /* Retrieve the Multiple Master/GX var descriptor of a given font. */ 1.258 + /* */ 1.259 + /* <Input> */ 1.260 + /* face :: A handle to the source face. */ 1.261 + /* */ 1.262 + /* <Output> */ 1.263 + /* amaster :: The Multiple Masters/GX var descriptor. */ 1.264 + /* Allocates a data structure, which the user must free */ 1.265 + /* (a single call to FT_FREE will do it). */ 1.266 + /* */ 1.267 + /* <Return> */ 1.268 + /* FreeType error code. 0~means success. */ 1.269 + /* */ 1.270 + FT_EXPORT( FT_Error ) 1.271 + FT_Get_MM_Var( FT_Face face, 1.272 + FT_MM_Var* *amaster ); 1.273 + 1.274 + 1.275 + /*************************************************************************/ 1.276 + /* */ 1.277 + /* <Function> */ 1.278 + /* FT_Set_MM_Design_Coordinates */ 1.279 + /* */ 1.280 + /* <Description> */ 1.281 + /* For Multiple Masters fonts, choose an interpolated font design */ 1.282 + /* through design coordinates. */ 1.283 + /* */ 1.284 + /* This function can't be used with GX fonts. */ 1.285 + /* */ 1.286 + /* <InOut> */ 1.287 + /* face :: A handle to the source face. */ 1.288 + /* */ 1.289 + /* <Input> */ 1.290 + /* num_coords :: The number of design coordinates (must be equal to */ 1.291 + /* the number of axes in the font). */ 1.292 + /* */ 1.293 + /* coords :: An array of design coordinates. */ 1.294 + /* */ 1.295 + /* <Return> */ 1.296 + /* FreeType error code. 0~means success. */ 1.297 + /* */ 1.298 + FT_EXPORT( FT_Error ) 1.299 + FT_Set_MM_Design_Coordinates( FT_Face face, 1.300 + FT_UInt num_coords, 1.301 + FT_Long* coords ); 1.302 + 1.303 + 1.304 + /*************************************************************************/ 1.305 + /* */ 1.306 + /* <Function> */ 1.307 + /* FT_Set_Var_Design_Coordinates */ 1.308 + /* */ 1.309 + /* <Description> */ 1.310 + /* For Multiple Master or GX Var fonts, choose an interpolated font */ 1.311 + /* design through design coordinates. */ 1.312 + /* */ 1.313 + /* <InOut> */ 1.314 + /* face :: A handle to the source face. */ 1.315 + /* */ 1.316 + /* <Input> */ 1.317 + /* num_coords :: The number of design coordinates (must be equal to */ 1.318 + /* the number of axes in the font). */ 1.319 + /* */ 1.320 + /* coords :: An array of design coordinates. */ 1.321 + /* */ 1.322 + /* <Return> */ 1.323 + /* FreeType error code. 0~means success. */ 1.324 + /* */ 1.325 + FT_EXPORT( FT_Error ) 1.326 + FT_Set_Var_Design_Coordinates( FT_Face face, 1.327 + FT_UInt num_coords, 1.328 + FT_Fixed* coords ); 1.329 + 1.330 + 1.331 + /*************************************************************************/ 1.332 + /* */ 1.333 + /* <Function> */ 1.334 + /* FT_Set_MM_Blend_Coordinates */ 1.335 + /* */ 1.336 + /* <Description> */ 1.337 + /* For Multiple Masters and GX var fonts, choose an interpolated font */ 1.338 + /* design through normalized blend coordinates. */ 1.339 + /* */ 1.340 + /* <InOut> */ 1.341 + /* face :: A handle to the source face. */ 1.342 + /* */ 1.343 + /* <Input> */ 1.344 + /* num_coords :: The number of design coordinates (must be equal to */ 1.345 + /* the number of axes in the font). */ 1.346 + /* */ 1.347 + /* coords :: The design coordinates array (each element must be */ 1.348 + /* between 0 and 1.0). */ 1.349 + /* */ 1.350 + /* <Return> */ 1.351 + /* FreeType error code. 0~means success. */ 1.352 + /* */ 1.353 + FT_EXPORT( FT_Error ) 1.354 + FT_Set_MM_Blend_Coordinates( FT_Face face, 1.355 + FT_UInt num_coords, 1.356 + FT_Fixed* coords ); 1.357 + 1.358 + 1.359 + /*************************************************************************/ 1.360 + /* */ 1.361 + /* <Function> */ 1.362 + /* FT_Set_Var_Blend_Coordinates */ 1.363 + /* */ 1.364 + /* <Description> */ 1.365 + /* This is another name of @FT_Set_MM_Blend_Coordinates. */ 1.366 + /* */ 1.367 + FT_EXPORT( FT_Error ) 1.368 + FT_Set_Var_Blend_Coordinates( FT_Face face, 1.369 + FT_UInt num_coords, 1.370 + FT_Fixed* coords ); 1.371 + 1.372 + 1.373 + /* */ 1.374 + 1.375 + 1.376 +FT_END_HEADER 1.377 + 1.378 +#endif /* __FTMM_H__ */ 1.379 + 1.380 + 1.381 +/* END */