4 |
/* */ |
/* */ |
5 |
/* Interface to Postscript-specific (Type 1 and Type 2) hints */ |
/* Interface to Postscript-specific (Type 1 and Type 2) hints */ |
6 |
/* recorders (specification only). These are used to support native */ |
/* recorders (specification only). These are used to support native */ |
7 |
/* T1/T2 hints in the "type1", "cid" and "cff" font drivers. */ |
/* T1/T2 hints in the `type1', `cid', and `cff' font drivers. */ |
8 |
/* */ |
/* */ |
9 |
/* Copyright 2001, 2002, 2003 by */ |
/* Copyright 2001, 2002, 2003, 2005 by */ |
10 |
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
11 |
/* */ |
/* */ |
12 |
/* This file is part of the FreeType project, and may only be used, */ |
/* This file is part of the FreeType project, and may only be used, */ |
73 |
/*************************************************************************/ |
/*************************************************************************/ |
74 |
/*************************************************************************/ |
/*************************************************************************/ |
75 |
|
|
76 |
/*************************************************************************/ |
/************************************************************************* |
77 |
/* */ |
* |
78 |
/* @type: */ |
* @type: |
79 |
/* T1_Hints */ |
* T1_Hints |
80 |
/* */ |
* |
81 |
/* @description: */ |
* @description: |
82 |
/* This is a handle to an opaque structure used to record glyph hints */ |
* This is a handle to an opaque structure used to record glyph hints |
83 |
/* from a Type 1 character glyph character string. */ |
* from a Type 1 character glyph character string. |
84 |
/* */ |
* |
85 |
/* The methods used to operate on this object are defined by the */ |
* The methods used to operate on this object are defined by the |
86 |
/* @T1_Hints_FuncsRec structure. Recording glyph hints is normally */ |
* @T1_Hints_FuncsRec structure. Recording glyph hints is normally |
87 |
/* achieved through the following scheme: */ |
* achieved through the following scheme: |
88 |
/* */ |
* |
89 |
/* - Open a new hint recording session by calling the "open" method. */ |
* - Open a new hint recording session by calling the `open' method. |
90 |
/* This will rewind the recorder and prepare it for new input. */ |
* This rewinds the recorder and prepare it for new input. |
91 |
/* */ |
* |
92 |
/* - For each hint found in the glyph charstring, call the */ |
* - For each hint found in the glyph charstring, call the corresponding |
93 |
/* corresponding method ("stem", "stem3", or "reset"). Note that */ |
* method (`stem', `stem3', or `reset'). Note that these functions do |
94 |
/* these functions do not return an error code. */ |
* not return an error code. |
95 |
/* */ |
* |
96 |
/* - Close the recording session by calling the "close" method. It */ |
* - Close the recording session by calling the `close' method. It |
97 |
/* will return an error code if the hints were invalid or something */ |
* returns an error code if the hints were invalid or something |
98 |
/* strange happened (e.g. memory shortage). */ |
* strange happened (e.g., memory shortage). |
99 |
/* */ |
* |
100 |
/* The hints accumulated in the object can later be used by the */ |
* The hints accumulated in the object can later be used by the |
101 |
/* PostScript hinter. */ |
* PostScript hinter. |
102 |
/* */ |
* |
103 |
|
*/ |
104 |
typedef struct T1_HintsRec_* T1_Hints; |
typedef struct T1_HintsRec_* T1_Hints; |
105 |
|
|
106 |
|
|
107 |
/*************************************************************************/ |
/************************************************************************* |
108 |
/* */ |
* |
109 |
/* @type: */ |
* @type: |
110 |
/* T1_Hints_Funcs */ |
* T1_Hints_Funcs |
111 |
/* */ |
* |
112 |
/* @description: */ |
* @description: |
113 |
/* A pointer to the @T1_Hints_FuncsRec structure that defines the */ |
* A pointer to the @T1_Hints_FuncsRec structure that defines the API of |
114 |
/* API of a given @T1_Hints object. */ |
* a given @T1_Hints object. |
115 |
/* */ |
* |
116 |
|
*/ |
117 |
typedef const struct T1_Hints_FuncsRec_* T1_Hints_Funcs; |
typedef const struct T1_Hints_FuncsRec_* T1_Hints_Funcs; |
118 |
|
|
119 |
|
|
120 |
/*************************************************************************/ |
/************************************************************************* |
121 |
/* */ |
* |
122 |
/* @functype: */ |
* @functype: |
123 |
/* T1_Hints_OpenFunc */ |
* T1_Hints_OpenFunc |
124 |
/* */ |
* |
125 |
/* @description: */ |
* @description: |
126 |
/* A method of the @T1_Hints class used to prepare it for a new */ |
* A method of the @T1_Hints class used to prepare it for a new Type 1 |
127 |
/* Type 1 hints recording session. */ |
* hints recording session. |
128 |
/* */ |
* |
129 |
/* @input: */ |
* @input: |
130 |
/* hints :: A handle to the Type 1 hints recorder. */ |
* hints :: |
131 |
/* */ |
* A handle to the Type 1 hints recorder. |
132 |
/* @note: */ |
* |
133 |
/* You should always call the @T1_Hints_CloseFunc method in order to */ |
* @note: |
134 |
/* close an opened recording session. */ |
* You should always call the @T1_Hints_CloseFunc method in order to |
135 |
/* */ |
* close an opened recording session. |
136 |
|
* |
137 |
|
*/ |
138 |
typedef void |
typedef void |
139 |
(*T1_Hints_OpenFunc)( T1_Hints hints ); |
(*T1_Hints_OpenFunc)( T1_Hints hints ); |
140 |
|
|
141 |
|
|
142 |
/*************************************************************************/ |
/************************************************************************* |
143 |
/* */ |
* |
144 |
/* @functype: */ |
* @functype: |
145 |
/* T1_Hints_SetStemFunc */ |
* T1_Hints_SetStemFunc |
146 |
/* */ |
* |
147 |
/* @description: */ |
* @description: |
148 |
/* A method of the @T1_Hints class used to record a new horizontal or */ |
* A method of the @T1_Hints class used to record a new horizontal or |
149 |
/* vertical stem. This corresponds to the Type 1 "hstem" and "vstem" */ |
* vertical stem. This corresponds to the Type 1 `hstem' and `vstem' |
150 |
/* operators. */ |
* operators. |
151 |
/* */ |
* |
152 |
/* @input: */ |
* @input: |
153 |
/* hints :: A handle to the Type 1 hints recorder. */ |
* hints :: |
154 |
/* */ |
* A handle to the Type 1 hints recorder. |
155 |
/* dimension :: 0 for horizontal stems (hstem), 1 for vertical ones */ |
* |
156 |
/* (vstem). */ |
* dimension :: |
157 |
/* */ |
* 0 for horizontal stems (hstem), 1 for vertical ones (vstem). |
158 |
/* coords :: Array of 2 integers, used as (position,length) stem */ |
* |
159 |
/* descriptor. */ |
* coords :: |
160 |
/* */ |
* Array of 2 integers, used as (position,length) stem descriptor. |
161 |
/* @note: */ |
* |
162 |
/* Use vertical coordinates (y) for horizontal stems (dim=0). Use */ |
* @note: |
163 |
/* horizontal coordinates (x) for vertical stems (dim=1). */ |
* Use vertical coordinates (y) for horizontal stems (dim=0). Use |
164 |
/* */ |
* horizontal coordinates (x) for vertical stems (dim=1). |
165 |
/* "coords[0]" is the absolute stem position (lowest coordinate); */ |
* |
166 |
/* "coords[1]" is the length. */ |
* `coords[0]' is the absolute stem position (lowest coordinate); |
167 |
/* */ |
* `coords[1]' is the length. |
168 |
/* The length can be negative, in which case it must be either -20 or */ |
* |
169 |
/* -21. It will be interpreted as a "ghost" stem, according to */ |
* The length can be negative, in which case it must be either -20 or |
170 |
/* Type 1 specification. */ |
* -21. It is interpreted as a `ghost' stem, according to the Type 1 |
171 |
/* */ |
* specification. |
172 |
/* If the length is -21 (corresponding to a bottom ghost stem), then */ |
* |
173 |
/* the real stem position is "coords[0]+coords[1]". */ |
* If the length is -21 (corresponding to a bottom ghost stem), then |
174 |
/* */ |
* the real stem position is `coords[0]+coords[1]'. |
175 |
|
* |
176 |
|
*/ |
177 |
typedef void |
typedef void |
178 |
(*T1_Hints_SetStemFunc)( T1_Hints hints, |
(*T1_Hints_SetStemFunc)( T1_Hints hints, |
179 |
FT_UInt dimension, |
FT_UInt dimension, |
180 |
FT_Long* coords ); |
FT_Long* coords ); |
181 |
|
|
182 |
|
|
183 |
/*************************************************************************/ |
/************************************************************************* |
184 |
/* */ |
* |
185 |
/* @functype: */ |
* @functype: |
186 |
/* T1_Hints_SetStem3Func */ |
* T1_Hints_SetStem3Func |
187 |
/* */ |
* |
188 |
/* @description: */ |
* @description: |
189 |
/* A method of the @T1_Hints class used to record three */ |
* A method of the @T1_Hints class used to record three |
190 |
/* counter-controlled horizontal or vertical stems at once. */ |
* counter-controlled horizontal or vertical stems at once. |
191 |
/* */ |
* |
192 |
/* @input: */ |
* @input: |
193 |
/* hints :: A handle to the Type 1 hints recorder. */ |
* hints :: |
194 |
/* */ |
* A handle to the Type 1 hints recorder. |
195 |
/* dimension :: 0 for horizontal stems, 1 for vertical ones. */ |
* |
196 |
/* */ |
* dimension :: |
197 |
/* coords :: An array of 6 integers, holding 3 (position,length) */ |
* 0 for horizontal stems, 1 for vertical ones. |
198 |
/* pairs for the counter-controlled stems. */ |
* |
199 |
/* */ |
* coords :: |
200 |
/* @note: */ |
* An array of 6 integers, holding 3 (position,length) pairs for the |
201 |
/* Use vertical coordinates (y) for horizontal stems (dim=0). Use */ |
* counter-controlled stems. |
202 |
/* horizontal coordinates (x) for vertical stems (dim=1). */ |
* |
203 |
/* */ |
* @note: |
204 |
/* The lengths cannot be negative (ghost stems are never */ |
* Use vertical coordinates (y) for horizontal stems (dim=0). Use |
205 |
/* counter-controlled). */ |
* horizontal coordinates (x) for vertical stems (dim=1). |
206 |
/* */ |
* |
207 |
|
* The lengths cannot be negative (ghost stems are never |
208 |
|
* counter-controlled). |
209 |
|
* |
210 |
|
*/ |
211 |
typedef void |
typedef void |
212 |
(*T1_Hints_SetStem3Func)( T1_Hints hints, |
(*T1_Hints_SetStem3Func)( T1_Hints hints, |
213 |
FT_UInt dimension, |
FT_UInt dimension, |
214 |
FT_Long* coords ); |
FT_Long* coords ); |
215 |
|
|
216 |
|
|
217 |
/*************************************************************************/ |
/************************************************************************* |
218 |
/* */ |
* |
219 |
/* @functype: */ |
* @functype: |
220 |
/* T1_Hints_ResetFunc */ |
* T1_Hints_ResetFunc |
221 |
/* */ |
* |
222 |
/* @description: */ |
* @description: |
223 |
/* A method of the @T1_Hints class used to reset the stems hints in a */ |
* A method of the @T1_Hints class used to reset the stems hints in a |
224 |
/* recording session. */ |
* recording session. |
225 |
/* */ |
* |
226 |
/* @input: */ |
* @input: |
227 |
/* hints :: A handle to the Type 1 hints recorder. */ |
* hints :: |
228 |
/* */ |
* A handle to the Type 1 hints recorder. |
229 |
/* end_point :: The index of the last point in the input glyph in */ |
* |
230 |
/* which the previously defined hints apply. */ |
* end_point :: |
231 |
/* */ |
* The index of the last point in the input glyph in which the |
232 |
|
* previously defined hints apply. |
233 |
|
* |
234 |
|
*/ |
235 |
typedef void |
typedef void |
236 |
(*T1_Hints_ResetFunc)( T1_Hints hints, |
(*T1_Hints_ResetFunc)( T1_Hints hints, |
237 |
FT_UInt end_point ); |
FT_UInt end_point ); |
238 |
|
|
239 |
|
|
240 |
/*************************************************************************/ |
/************************************************************************* |
241 |
/* */ |
* |
242 |
/* @functype: */ |
* @functype: |
243 |
/* T1_Hints_CloseFunc */ |
* T1_Hints_CloseFunc |
244 |
/* */ |
* |
245 |
/* @description: */ |
* @description: |
246 |
/* A method of the @T1_Hints class used to close a hint recording */ |
* A method of the @T1_Hints class used to close a hint recording |
247 |
/* session. */ |
* session. |
248 |
/* */ |
* |
249 |
/* @input: */ |
* @input: |
250 |
/* hints :: A handle to the Type 1 hints recorder. */ |
* hints :: |
251 |
/* */ |
* A handle to the Type 1 hints recorder. |
252 |
/* end_point :: The index of the last point in the input glyph. */ |
* |
253 |
/* */ |
* end_point :: |
254 |
/* @return: */ |
* The index of the last point in the input glyph. |
255 |
/* FreeType error code. 0 means success. */ |
* |
256 |
/* */ |
* @return: |
257 |
/* @note: */ |
* FreeType error code. 0 means success. |
258 |
/* The error code will be set to indicate that an error occured */ |
* |
259 |
/* during the recording session. */ |
* @note: |
260 |
/* */ |
* The error code is set to indicate that an error occurred during the |
261 |
|
* recording session. |
262 |
|
* |
263 |
|
*/ |
264 |
typedef FT_Error |
typedef FT_Error |
265 |
(*T1_Hints_CloseFunc)( T1_Hints hints, |
(*T1_Hints_CloseFunc)( T1_Hints hints, |
266 |
FT_UInt end_point ); |
FT_UInt end_point ); |
267 |
|
|
268 |
|
|
269 |
/*************************************************************************/ |
/************************************************************************* |
270 |
/* */ |
* |
271 |
/* @functype: */ |
* @functype: |
272 |
/* T1_Hints_ApplyFunc */ |
* T1_Hints_ApplyFunc |
273 |
/* */ |
* |
274 |
/* @description: */ |
* @description: |
275 |
/* A method of the @T1_Hints class used to apply hints to the */ |
* A method of the @T1_Hints class used to apply hints to the |
276 |
/* corresponding glyph outline. Must be called once all hints have */ |
* corresponding glyph outline. Must be called once all hints have been |
277 |
/* been recorded. */ |
* recorded. |
278 |
/* */ |
* |
279 |
/* @input: */ |
* @input: |
280 |
/* hints :: A handle to the Type 1 hints recorder. */ |
* hints :: |
281 |
/* */ |
* A handle to the Type 1 hints recorder. |
282 |
/* outline :: A pointer to the target outline descriptor. */ |
* |
283 |
/* */ |
* outline :: |
284 |
/* globals :: The hinter globals for this font. */ |
* A pointer to the target outline descriptor. |
285 |
/* */ |
* |
286 |
/* hint_mode :: Hinting information. */ |
* globals :: |
287 |
/* */ |
* The hinter globals for this font. |
288 |
/* @return: */ |
* |
289 |
/* FreeType error code. 0 means success. */ |
* hint_mode :: |
290 |
/* */ |
* Hinting information. |
291 |
/* @note: */ |
* |
292 |
/* On input, all points within the outline are in font coordinates. */ |
* @return: |
293 |
/* On output, they are in 1/64th of pixels. */ |
* FreeType error code. 0 means success. |
294 |
/* */ |
* |
295 |
/* The scaling transformation is taken from the "globals" object */ |
* @note: |
296 |
/* which must correspond to the same font as the glyph. */ |
* On input, all points within the outline are in font coordinates. On |
297 |
/* */ |
* output, they are in 1/64th of pixels. |
298 |
|
* |
299 |
|
* The scaling transformation is taken from the `globals' object which |
300 |
|
* must correspond to the same font as the glyph. |
301 |
|
* |
302 |
|
*/ |
303 |
typedef FT_Error |
typedef FT_Error |
304 |
(*T1_Hints_ApplyFunc)( T1_Hints hints, |
(*T1_Hints_ApplyFunc)( T1_Hints hints, |
305 |
FT_Outline* outline, |
FT_Outline* outline, |
307 |
FT_Render_Mode hint_mode ); |
FT_Render_Mode hint_mode ); |
308 |
|
|
309 |
|
|
310 |
/*************************************************************************/ |
/************************************************************************* |
311 |
/* */ |
* |
312 |
/* @struct: */ |
* @struct: |
313 |
/* T1_Hints_FuncsRec */ |
* T1_Hints_FuncsRec |
314 |
/* */ |
* |
315 |
/* @description: */ |
* @description: |
316 |
/* The structure used to provide the API to @T1_Hints objects. */ |
* The structure used to provide the API to @T1_Hints objects. |
317 |
/* */ |
* |
318 |
/* @fields: */ |
* @fields: |
319 |
/* hints :: A handle to the T1 Hints recorder. */ |
* hints :: |
320 |
/* */ |
* A handle to the T1 Hints recorder. |
321 |
/* open :: The function to open a recording session. */ |
* |
322 |
/* */ |
* open :: |
323 |
/* close :: The function to close a recording session. */ |
* The function to open a recording session. |
324 |
/* */ |
* |
325 |
/* stem :: The function to set a simple stem. */ |
* close :: |
326 |
/* */ |
* The function to close a recording session. |
327 |
/* stem3 :: The function to set counter-controlled stems. */ |
* |
328 |
/* */ |
* stem :: |
329 |
/* reset :: The function to reset stem hints. */ |
* The function to set a simple stem. |
330 |
/* */ |
* |
331 |
/* apply :: The function to apply the hints to the corresponding */ |
* stem3 :: |
332 |
/* glyph outline. */ |
* The function to set counter-controlled stems. |
333 |
/* */ |
* |
334 |
|
* reset :: |
335 |
|
* The function to reset stem hints. |
336 |
|
* |
337 |
|
* apply :: |
338 |
|
* The function to apply the hints to the corresponding glyph outline. |
339 |
|
* |
340 |
|
*/ |
341 |
typedef struct T1_Hints_FuncsRec_ |
typedef struct T1_Hints_FuncsRec_ |
342 |
{ |
{ |
343 |
T1_Hints hints; |
T1_Hints hints; |
359 |
/*************************************************************************/ |
/*************************************************************************/ |
360 |
/*************************************************************************/ |
/*************************************************************************/ |
361 |
|
|
362 |
/*************************************************************************/ |
/************************************************************************* |
363 |
/* */ |
* |
364 |
/* @type: */ |
* @type: |
365 |
/* T2_Hints */ |
* T2_Hints |
366 |
/* */ |
* |
367 |
/* @description: */ |
* @description: |
368 |
/* This is a handle to an opaque structure used to record glyph hints */ |
* This is a handle to an opaque structure used to record glyph hints |
369 |
/* from a Type 2 character glyph character string. */ |
* from a Type 2 character glyph character string. |
370 |
/* */ |
* |
371 |
/* The methods used to operate on this object are defined by the */ |
* The methods used to operate on this object are defined by the |
372 |
/* @T2_Hints_FuncsRec structure. Recording glyph hints is normally */ |
* @T2_Hints_FuncsRec structure. Recording glyph hints is normally |
373 |
/* achieved through the following scheme: */ |
* achieved through the following scheme: |
374 |
/* */ |
* |
375 |
/* - Open a new hint recording session by calling the "open" method. */ |
* - Open a new hint recording session by calling the `open' method. |
376 |
/* This will rewind the recorder and prepare it for new input. */ |
* This rewinds the recorder and prepare it for new input. |
377 |
/* */ |
* |
378 |
/* - For each hint found in the glyph charstring, call the */ |
* - For each hint found in the glyph charstring, call the corresponding |
379 |
/* corresponding method ("stems", "hintmask", "counters"). Note */ |
* method (`stems', `hintmask', `counters'). Note that these |
380 |
/* that these functions do not return an error code. */ |
* functions do not return an error code. |
381 |
/* */ |
* |
382 |
/* - Close the recording session by calling the "close" method. It */ |
* - Close the recording session by calling the `close' method. It |
383 |
/* will return an error code if the hints were invalid or something */ |
* returns an error code if the hints were invalid or something |
384 |
/* strange happened (e.g. memory shortage). */ |
* strange happened (e.g., memory shortage). |
385 |
/* */ |
* |
386 |
/* The hints accumulated in the object can later be used by the */ |
* The hints accumulated in the object can later be used by the |
387 |
/* Postscript hinter. */ |
* Postscript hinter. |
388 |
/* */ |
* |
389 |
|
*/ |
390 |
typedef struct T2_HintsRec_* T2_Hints; |
typedef struct T2_HintsRec_* T2_Hints; |
391 |
|
|
392 |
|
|
393 |
/*************************************************************************/ |
/************************************************************************* |
394 |
/* */ |
* |
395 |
/* @type: */ |
* @type: |
396 |
/* T2_Hints_Funcs */ |
* T2_Hints_Funcs |
397 |
/* */ |
* |
398 |
/* @description: */ |
* @description: |
399 |
/* A pointer to the @T2_Hints_FuncsRec structure that defines the API */ |
* A pointer to the @T2_Hints_FuncsRec structure that defines the API of |
400 |
/* of a given @T2_Hints object. */ |
* a given @T2_Hints object. |
401 |
/* */ |
* |
402 |
|
*/ |
403 |
typedef const struct T2_Hints_FuncsRec_* T2_Hints_Funcs; |
typedef const struct T2_Hints_FuncsRec_* T2_Hints_Funcs; |
404 |
|
|
405 |
|
|
406 |
/*************************************************************************/ |
/************************************************************************* |
407 |
/* */ |
* |
408 |
/* @functype: */ |
* @functype: |
409 |
/* T2_Hints_OpenFunc */ |
* T2_Hints_OpenFunc |
410 |
/* */ |
* |
411 |
/* @description: */ |
* @description: |
412 |
/* A method of the @T2_Hints class used to prepare it for a new */ |
* A method of the @T2_Hints class used to prepare it for a new Type 2 |
413 |
/* Type 2 hints recording session. */ |
* hints recording session. |
414 |
/* */ |
* |
415 |
/* @input: */ |
* @input: |
416 |
/* hints :: A handle to the Type 2 hints recorder. */ |
* hints :: |
417 |
/* */ |
* A handle to the Type 2 hints recorder. |
418 |
/* @note: */ |
* |
419 |
/* You should always call the @T2_Hints_CloseFunc method in order to */ |
* @note: |
420 |
/* close an opened recording session. */ |
* You should always call the @T2_Hints_CloseFunc method in order to |
421 |
/* */ |
* close an opened recording session. |
422 |
|
* |
423 |
|
*/ |
424 |
typedef void |
typedef void |
425 |
(*T2_Hints_OpenFunc)( T2_Hints hints ); |
(*T2_Hints_OpenFunc)( T2_Hints hints ); |
426 |
|
|
427 |
|
|
428 |
/*************************************************************************/ |
/************************************************************************* |
429 |
/* */ |
* |
430 |
/* @functype: */ |
* @functype: |
431 |
/* T2_Hints_StemsFunc */ |
* T2_Hints_StemsFunc |
432 |
/* */ |
* |
433 |
/* @description: */ |
* @description: |
434 |
/* A method of the @T2_Hints class used to set the table of stems in */ |
* A method of the @T2_Hints class used to set the table of stems in |
435 |
/* either the vertical or horizontal dimension. Equivalent to the */ |
* either the vertical or horizontal dimension. Equivalent to the |
436 |
/* "hstem", "vstem", "hstemhm", and "vstemhm" Type 2 operators. */ |
* `hstem', `vstem', `hstemhm', and `vstemhm' Type 2 operators. |
437 |
/* */ |
* |
438 |
/* @input: */ |
* @input: |
439 |
/* hints :: A handle to the Type 2 hints recorder. */ |
* hints :: |
440 |
/* */ |
* A handle to the Type 2 hints recorder. |
441 |
/* dimension :: 0 for horizontal stems (hstem), 1 for vertical ones */ |
* |
442 |
/* (vstem). */ |
* dimension :: |
443 |
/* */ |
* 0 for horizontal stems (hstem), 1 for vertical ones (vstem). |
444 |
/* count :: The number of stems. */ |
* |
445 |
/* */ |
* count :: |
446 |
/* coords :: An array of "count" (position,length) pairs. */ |
* The number of stems. |
447 |
/* */ |
* |
448 |
/* @note: */ |
* coords :: |
449 |
/* Use vertical coordinates (y) for horizontal stems (dim=0). Use */ |
* An array of `count' (position,length) pairs. |
450 |
/* horizontal coordinates (x) for vertical stems (dim=1). */ |
* |
451 |
/* */ |
* @note: |
452 |
/* There are "2*count" elements in the "coords" aray. Each even */ |
* Use vertical coordinates (y) for horizontal stems (dim=0). Use |
453 |
/* element is an absolute position in font units, each odd element is */ |
* horizontal coordinates (x) for vertical stems (dim=1). |
454 |
/* a length in font units. */ |
* |
455 |
/* */ |
* There are `2*count' elements in the `coords' aray. Each even element |
456 |
/* A length can be negative, in which case it must be either -20 or */ |
* is an absolute position in font units, each odd element is a length |
457 |
/* -21. It will be interpreted as a "ghost" stem, according to the */ |
* in font units. |
458 |
/* Type 1 specification. */ |
* |
459 |
/* */ |
* A length can be negative, in which case it must be either -20 or |
460 |
|
* -21. It is interpreted as a `ghost' stem, according to the Type 1 |
461 |
|
* specification. |
462 |
|
* |
463 |
|
*/ |
464 |
typedef void |
typedef void |
465 |
(*T2_Hints_StemsFunc)( T2_Hints hints, |
(*T2_Hints_StemsFunc)( T2_Hints hints, |
466 |
FT_UInt dimension, |
FT_UInt dimension, |
468 |
FT_Fixed* coordinates ); |
FT_Fixed* coordinates ); |
469 |
|
|
470 |
|
|
471 |
/*************************************************************************/ |
/************************************************************************* |
472 |
/* */ |
* |
473 |
/* @functype: */ |
* @functype: |
474 |
/* T2_Hints_MaskFunc */ |
* T2_Hints_MaskFunc |
475 |
/* */ |
* |
476 |
/* @description: */ |
* @description: |
477 |
/* A method of the @T2_Hints class used to set a given hintmask */ |
* A method of the @T2_Hints class used to set a given hintmask (this |
478 |
/* (this corresponds to the "hintmask" Type 2 operator). */ |
* corresponds to the `hintmask' Type 2 operator). |
479 |
/* */ |
* |
480 |
/* @input: */ |
* @input: |
481 |
/* hints :: A handle to the Type 2 hints recorder. */ |
* hints :: |
482 |
/* */ |
* A handle to the Type 2 hints recorder. |
483 |
/* end_point :: The glyph index of the last point to which the */ |
* |
484 |
/* previously defined/activated hints apply. */ |
* end_point :: |
485 |
/* */ |
* The glyph index of the last point to which the previously defined |
486 |
/* bit_count :: The number of bits in the hint mask. */ |
* or activated hints apply. |
487 |
/* */ |
* |
488 |
/* bytes :: An array of bytes modelling the hint mask. */ |
* bit_count :: |
489 |
/* */ |
* The number of bits in the hint mask. |
490 |
/* @note: */ |
* |
491 |
/* If the hintmask starts the charstring (before any glyph point */ |
* bytes :: |
492 |
/* definition), the value of "end_point" should be 0. */ |
* An array of bytes modelling the hint mask. |
493 |
/* */ |
* |
494 |
/* "bit_count" is the number of meaningful bits in the "bytes" array; */ |
* @note: |
495 |
/* it must be equal to the total number of hints defined so far */ |
* If the hintmask starts the charstring (before any glyph point |
496 |
/* (i.e. horizontal+verticals). */ |
* definition), the value of `end_point' should be 0. |
497 |
/* */ |
* |
498 |
/* The "bytes" array can come directly from the Type 2 charstring and */ |
* `bit_count' is the number of meaningful bits in the `bytes' array; it |
499 |
/* respects the same format. */ |
* must be equal to the total number of hints defined so far (i.e., |
500 |
/* */ |
* horizontal+verticals). |
501 |
|
* |
502 |
|
* The `bytes' array can come directly from the Type 2 charstring and |
503 |
|
* respects the same format. |
504 |
|
* |
505 |
|
*/ |
506 |
typedef void |
typedef void |
507 |
(*T2_Hints_MaskFunc)( T2_Hints hints, |
(*T2_Hints_MaskFunc)( T2_Hints hints, |
508 |
FT_UInt end_point, |
FT_UInt end_point, |
510 |
const FT_Byte* bytes ); |
const FT_Byte* bytes ); |
511 |
|
|
512 |
|
|
513 |
/*************************************************************************/ |
/************************************************************************* |
514 |
/* */ |
* |
515 |
/* @functype: */ |
* @functype: |
516 |
/* T2_Hints_CounterFunc */ |
* T2_Hints_CounterFunc |
517 |
/* */ |
* |
518 |
/* @description: */ |
* @description: |
519 |
/* A method of the @T2_Hints class used to set a given counter mask */ |
* A method of the @T2_Hints class used to set a given counter mask |
520 |
/* (this corresponds to the "hintmask" Type 2 operator). */ |
* (this corresponds to the `hintmask' Type 2 operator). |
521 |
/* */ |
* |
522 |
/* @input: */ |
* @input: |
523 |
/* hints :: A handle to the Type 2 hints recorder. */ |
* hints :: |
524 |
/* */ |
* A handle to the Type 2 hints recorder. |
525 |
/* end_point :: A glyph index of the last point to which the */ |
* |
526 |
/* previously defined/active hints apply. */ |
* end_point :: |
527 |
/* */ |
* A glyph index of the last point to which the previously defined or |
528 |
/* bit_count :: The number of bits in the hint mask. */ |
* active hints apply. |
529 |
/* */ |
* |
530 |
/* bytes :: An array of bytes modelling the hint mask. */ |
* bit_count :: |
531 |
/* */ |
* The number of bits in the hint mask. |
532 |
/* @note: */ |
* |
533 |
/* If the hintmask starts the charstring (before any glyph point */ |
* bytes :: |
534 |
/* definition), the value of "end_point" should be 0. */ |
* An array of bytes modelling the hint mask. |
535 |
/* */ |
* |
536 |
/* "bit_count" is the number of meaningful bits in the "bytes" array; */ |
* @note: |
537 |
/* it must be equal to the total number of hints defined so far */ |
* If the hintmask starts the charstring (before any glyph point |
538 |
/* (i.e. horizontal+verticals). */ |
* definition), the value of `end_point' should be 0. |
539 |
/* */ |
* |
540 |
/* The "bytes" array can come directly from the Type 2 charstring and */ |
* `bit_count' is the number of meaningful bits in the `bytes' array; it |
541 |
/* respects the same format. */ |
* must be equal to the total number of hints defined so far (i.e., |
542 |
/* */ |
* horizontal+verticals). |
543 |
|
* |
544 |
|
* The "bytes" array can come directly from the Type 2 charstring and |
545 |
|
* respects the same format. |
546 |
|
* |
547 |
|
*/ |
548 |
typedef void |
typedef void |
549 |
(*T2_Hints_CounterFunc)( T2_Hints hints, |
(*T2_Hints_CounterFunc)( T2_Hints hints, |
550 |
FT_UInt bit_count, |
FT_UInt bit_count, |
551 |
const FT_Byte* bytes ); |
const FT_Byte* bytes ); |
552 |
|
|
553 |
|
|
554 |
/*************************************************************************/ |
/************************************************************************* |
555 |
/* */ |
* |
556 |
/* @functype: */ |
* @functype: |
557 |
/* T2_Hints_CloseFunc */ |
* T2_Hints_CloseFunc |
558 |
/* */ |
* |
559 |
/* @description: */ |
* @description: |
560 |
/* A method of the @T2_Hints class used to close a hint recording */ |
* A method of the @T2_Hints class used to close a hint recording |
561 |
/* session. */ |
* session. |
562 |
/* */ |
* |
563 |
/* @input: */ |
* @input: |
564 |
/* hints :: A handle to the Type 2 hints recorder. */ |
* hints :: |
565 |
/* */ |
* A handle to the Type 2 hints recorder. |
566 |
/* end_point :: The index of the last point in the input glyph. */ |
* |
567 |
/* */ |
* end_point :: |
568 |
/* @return: */ |
* The index of the last point in the input glyph. |
569 |
/* FreeType error code. 0 means success. */ |
* |
570 |
/* */ |
* @return: |
571 |
/* @note: */ |
* FreeType error code. 0 means success. |
572 |
/* The error code will be set to indicate that an error occured */ |
* |
573 |
/* during the recording session. */ |
* @note: |
574 |
/* */ |
* The error code is set to indicate that an error occurred during the |
575 |
|
* recording session. |
576 |
|
* |
577 |
|
*/ |
578 |
typedef FT_Error |
typedef FT_Error |
579 |
(*T2_Hints_CloseFunc)( T2_Hints hints, |
(*T2_Hints_CloseFunc)( T2_Hints hints, |
580 |
FT_UInt end_point ); |
FT_UInt end_point ); |
581 |
|
|
582 |
|
|
583 |
/*************************************************************************/ |
/************************************************************************* |
584 |
/* */ |
* |
585 |
/* @functype: */ |
* @functype: |
586 |
/* T2_Hints_ApplyFunc */ |
* T2_Hints_ApplyFunc |
587 |
/* */ |
* |
588 |
/* @description: */ |
* @description: |
589 |
/* A method of the @T2_Hints class used to apply hints to the */ |
* A method of the @T2_Hints class used to apply hints to the |
590 |
/* corresponding glyph outline. Must be called after the "close" */ |
* corresponding glyph outline. Must be called after the `close' |
591 |
/* method. */ |
* method. |
592 |
/* */ |
* |
593 |
/* @input: */ |
* @input: |
594 |
/* hints :: A handle to the Type 2 hints recorder. */ |
* hints :: |
595 |
/* */ |
* A handle to the Type 2 hints recorder. |
596 |
/* outline :: A pointer to the target outline descriptor. */ |
* |
597 |
/* */ |
* outline :: |
598 |
/* globals :: The hinter globals for this font. */ |
* A pointer to the target outline descriptor. |
599 |
/* */ |
* |
600 |
/* hint_mode :: Hinting information. */ |
* globals :: |
601 |
/* */ |
* The hinter globals for this font. |
602 |
/* @return: */ |
* |
603 |
/* FreeType error code. 0 means success. */ |
* hint_mode :: |
604 |
/* */ |
* Hinting information. |
605 |
/* @note: */ |
* |
606 |
/* On input, all points within the outline are in font coordinates. */ |
* @return: |
607 |
/* On output, they are in 1/64th of pixels. */ |
* FreeType error code. 0 means success. |
608 |
/* */ |
* |
609 |
/* The scaling transformation is taken from the "globals" object */ |
* @note: |
610 |
/* which must correspond to the same font than the glyph. */ |
* On input, all points within the outline are in font coordinates. On |
611 |
/* */ |
* output, they are in 1/64th of pixels. |
612 |
|
* |
613 |
|
* The scaling transformation is taken from the `globals' object which |
614 |
|
* must correspond to the same font than the glyph. |
615 |
|
* |
616 |
|
*/ |
617 |
typedef FT_Error |
typedef FT_Error |
618 |
(*T2_Hints_ApplyFunc)( T2_Hints hints, |
(*T2_Hints_ApplyFunc)( T2_Hints hints, |
619 |
FT_Outline* outline, |
FT_Outline* outline, |
621 |
FT_Render_Mode hint_mode ); |
FT_Render_Mode hint_mode ); |
622 |
|
|
623 |
|
|
624 |
/*************************************************************************/ |
/************************************************************************* |
625 |
/* */ |
* |
626 |
/* @struct: */ |
* @struct: |
627 |
/* T2_Hints_FuncsRec */ |
* T2_Hints_FuncsRec |
628 |
/* */ |
* |
629 |
/* @description: */ |
* @description: |
630 |
/* The structure used to provide the API to @T2_Hints objects. */ |
* The structure used to provide the API to @T2_Hints objects. |
631 |
/* */ |
* |
632 |
/* @fields: */ |
* @fields: |
633 |
/* hints :: A handle to the T2 hints recorder object. */ |
* hints :: |
634 |
/* */ |
* A handle to the T2 hints recorder object. |
635 |
/* open :: The function to open a recording session. */ |
* |
636 |
/* */ |
* open :: |
637 |
/* close :: The function to close a recording session. */ |
* The function to open a recording session. |
638 |
/* */ |
* |
639 |
/* stems :: The function to set the dimension's stems table. */ |
* close :: |
640 |
/* */ |
* The function to close a recording session. |
641 |
/* hintmask :: The function to set hint masks. */ |
* |
642 |
/* */ |
* stems :: |
643 |
/* counter :: The function to set counter masks. */ |
* The function to set the dimension's stems table. |
644 |
/* */ |
* |
645 |
/* apply :: The function to apply the hints on the corresponding */ |
* hintmask :: |
646 |
/* glyph outline. */ |
* The function to set hint masks. |
647 |
/* */ |
* |
648 |
|
* counter :: |
649 |
|
* The function to set counter masks. |
650 |
|
* |
651 |
|
* apply :: |
652 |
|
* The function to apply the hints on the corresponding glyph outline. |
653 |
|
* |
654 |
|
*/ |
655 |
typedef struct T2_Hints_FuncsRec_ |
typedef struct T2_Hints_FuncsRec_ |
656 |
{ |
{ |
657 |
T2_Hints hints; |
T2_Hints hints; |