w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

ttdriver.c
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * ttdriver.c
4  *
5  * TrueType font driver implementation (body).
6  *
7  * Copyright (C) 1996-2020 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 #include <freetype/internal/ftdebug.h>
20 #include <freetype/internal/ftstream.h>
21 #include <freetype/internal/sfnt.h>
22 #include <freetype/internal/services/svfntfmt.h>
23 
24 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
25 #include <freetype/ftmm.h>
26 #include <freetype/internal/services/svmm.h>
27 #include <freetype/internal/services/svmetric.h>
28 #endif
29 
30 #include <freetype/internal/services/svtteng.h>
31 #include <freetype/internal/services/svttglyf.h>
32 #include <freetype/internal/services/svprop.h>
33 #include <freetype/ftdriver.h>
34 
35 #include "ttdriver.h"
36 #include "ttgload.h"
37 #include "ttpload.h"
38 
39 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
40 #include "ttgxvar.h"
41 #endif
42 
43 #include "tterrors.h"
44 
45 
46  /**************************************************************************
47  *
48  * The macro FT_COMPONENT is used in trace mode. It is an implicit
49  * parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
50  * messages during execution.
51  */
52 #undef FT_COMPONENT
53 #define FT_COMPONENT ttdriver
54 
55 
56  /*
57  * PROPERTY SERVICE
58  *
59  */
60  static FT_Error
61  tt_property_set( FT_Module module, /* TT_Driver */
62  const char* property_name,
63  const void* value,
64  FT_Bool value_is_string )
65  {
67  TT_Driver driver = (TT_Driver)module;
68 
69 #ifndef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
70  FT_UNUSED( value_is_string );
71 #endif
72 
73 
74  if ( !ft_strcmp( property_name, "interpreter-version" ) )
75  {
76  FT_UInt interpreter_version;
77 
78 
79 #ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
80  if ( value_is_string )
81  {
82  const char* s = (const char*)value;
83 
84 
85  interpreter_version = (FT_UInt)ft_strtol( s, NULL, 10 );
86  }
87  else
88 #endif
89  {
90  FT_UInt* iv = (FT_UInt*)value;
91 
92 
93  interpreter_version = *iv;
94  }
95 
96  if ( interpreter_version == TT_INTERPRETER_VERSION_35
98  || interpreter_version == TT_INTERPRETER_VERSION_38
99 #endif
101  || interpreter_version == TT_INTERPRETER_VERSION_40
102 #endif
103  )
104  driver->interpreter_version = interpreter_version;
105  else
106  error = FT_ERR( Unimplemented_Feature );
107 
108  return error;
109  }
110 
111  FT_TRACE0(( "tt_property_set: missing property `%s'\n",
112  property_name ));
113  return FT_THROW( Missing_Property );
114  }
115 
116 
117  static FT_Error
118  tt_property_get( FT_Module module, /* TT_Driver */
119  const char* property_name,
120  const void* value )
121  {
123  TT_Driver driver = (TT_Driver)module;
124 
125  FT_UInt interpreter_version = driver->interpreter_version;
126 
127 
128  if ( !ft_strcmp( property_name, "interpreter-version" ) )
129  {
130  FT_UInt* val = (FT_UInt*)value;
131 
132 
133  *val = interpreter_version;
134 
135  return error;
136  }
137 
138  FT_TRACE0(( "tt_property_get: missing property `%s'\n",
139  property_name ));
140  return FT_THROW( Missing_Property );
141  }
142 
143 
145  tt_service_properties,
146 
147  (FT_Properties_SetFunc)tt_property_set, /* set_property */
148  (FT_Properties_GetFunc)tt_property_get /* get_property */
149  )
150 
151 
152  /*************************************************************************/
153  /*************************************************************************/
154  /*************************************************************************/
155  /**** ****/
156  /**** ****/
157  /**** F A C E S ****/
158  /**** ****/
159  /**** ****/
160  /*************************************************************************/
161  /*************************************************************************/
162  /*************************************************************************/
163 
164 
165  /**************************************************************************
166  *
167  * @Function:
168  * tt_get_kerning
169  *
170  * @Description:
171  * A driver method used to return the kerning vector between two
172  * glyphs of the same face.
173  *
174  * @Input:
175  * face ::
176  * A handle to the source face object.
177  *
178  * left_glyph ::
179  * The index of the left glyph in the kern pair.
180  *
181  * right_glyph ::
182  * The index of the right glyph in the kern pair.
183  *
184  * @Output:
185  * kerning ::
186  * The kerning vector. This is in font units for
187  * scalable formats, and in pixels for fixed-sizes
188  * formats.
189  *
190  * @Return:
191  * FreeType error code. 0 means success.
192  *
193  * @Note:
194  * Only horizontal layouts (left-to-right & right-to-left) are
195  * supported by this function. Other layouts, or more sophisticated
196  * kernings, are out of scope of this method (the basic driver
197  * interface is meant to be simple).
198  *
199  * They can be implemented by format-specific interfaces.
200  */
201  static FT_Error
202  tt_get_kerning( FT_Face ttface, /* TT_Face */
206  {
207  TT_Face face = (TT_Face)ttface;
209 
210 
211  kerning->x = 0;
212  kerning->y = 0;
213 
214  if ( sfnt )
215  kerning->x = sfnt->get_kerning( face, left_glyph, right_glyph );
216 
217  return 0;
218  }
219 
220 
221  static FT_Error
222  tt_get_advances( FT_Face ttface,
223  FT_UInt start,
224  FT_UInt count,
225  FT_Int32 flags,
226  FT_Fixed *advances )
227  {
228  FT_UInt nn;
229  TT_Face face = (TT_Face)ttface;
230 
231 
232  /* XXX: TODO: check for sbits */
233 
235  {
236 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
237  /* no fast retrieval for blended MM fonts without VVAR table */
238  if ( ( FT_IS_NAMED_INSTANCE( ttface ) || FT_IS_VARIATION( ttface ) ) &&
239  !( face->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) )
240  return FT_THROW( Unimplemented_Feature );
241 #endif
242 
243  for ( nn = 0; nn < count; nn++ )
244  {
245  FT_Short tsb;
246  FT_UShort ah;
247 
248 
249  /* since we don't need `tsb', we use zero for `yMax' parameter */
250  TT_Get_VMetrics( face, start + nn, 0, &tsb, &ah );
251  advances[nn] = ah;
252  }
253  }
254  else
255  {
256 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
257  /* no fast retrieval for blended MM fonts without HVAR table */
258  if ( ( FT_IS_NAMED_INSTANCE( ttface ) || FT_IS_VARIATION( ttface ) ) &&
259  !( face->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) )
260  return FT_THROW( Unimplemented_Feature );
261 #endif
262 
263  for ( nn = 0; nn < count; nn++ )
264  {
265  FT_Short lsb;
266  FT_UShort aw;
267 
268 
269  TT_Get_HMetrics( face, start + nn, &lsb, &aw );
270  advances[nn] = aw;
271  }
272  }
273 
274  return FT_Err_Ok;
275  }
276 
277 
278  /*************************************************************************/
279  /*************************************************************************/
280  /*************************************************************************/
281  /**** ****/
282  /**** ****/
283  /**** S I Z E S ****/
284  /**** ****/
285  /**** ****/
286  /*************************************************************************/
287  /*************************************************************************/
288  /*************************************************************************/
289 
290 
291 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
292 
293  static FT_Error
294  tt_size_select( FT_Size size,
295  FT_ULong strike_index )
296  {
297  TT_Face ttface = (TT_Face)size->face;
298  TT_Size ttsize = (TT_Size)size;
300 
301 
302  ttsize->strike_index = strike_index;
303 
304  if ( FT_IS_SCALABLE( size->face ) )
305  {
306  /* use the scaled metrics, even when tt_size_reset fails */
307  FT_Select_Metrics( size->face, strike_index );
308 
309  tt_size_reset( ttsize, 0 ); /* ignore return value */
310  }
311  else
312  {
313  SFNT_Service sfnt = (SFNT_Service)ttface->sfnt;
314  FT_Size_Metrics* size_metrics = &size->metrics;
315 
316 
317  error = sfnt->load_strike_metrics( ttface,
318  strike_index,
319  size_metrics );
320  if ( error )
321  ttsize->strike_index = 0xFFFFFFFFUL;
322  }
323 
324  return error;
325  }
326 
327 #endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
328 
329 
330  static FT_Error
332  FT_Size_Request req )
333  {
334  TT_Size ttsize = (TT_Size)size;
336 
337 
338 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
339 
340  if ( FT_HAS_FIXED_SIZES( size->face ) )
341  {
342  TT_Face ttface = (TT_Face)size->face;
343  SFNT_Service sfnt = (SFNT_Service)ttface->sfnt;
344  FT_ULong strike_index;
345 
346 
347  error = sfnt->set_sbit_strike( ttface, req, &strike_index );
348 
349  if ( error )
350  ttsize->strike_index = 0xFFFFFFFFUL;
351  else
352  return tt_size_select( size, strike_index );
353  }
354 
355 #endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
356 
357  FT_Request_Metrics( size->face, req );
358 
359  if ( FT_IS_SCALABLE( size->face ) )
360  {
361  error = tt_size_reset( ttsize, 0 );
362 
363 #ifdef TT_USE_BYTECODE_INTERPRETER
364  /* for the `MPS' bytecode instruction we need the point size */
365  if ( !error )
366  {
368  ttsize->metrics->x_ppem > ttsize->metrics->y_ppem
369  ? req->horiResolution
370  : req->vertResolution;
371 
372 
373  /* if we don't have a resolution value, assume 72dpi */
374  if ( req->type == FT_SIZE_REQUEST_TYPE_SCALES ||
375  !resolution )
376  resolution = 72;
377 
378  ttsize->point_size = FT_MulDiv( ttsize->ttmetrics.ppem,
379  64 * 72,
380  resolution );
381  }
382 #endif
383  }
384 
385  return error;
386  }
387 
388 
389  /**************************************************************************
390  *
391  * @Function:
392  * tt_glyph_load
393  *
394  * @Description:
395  * A driver method used to load a glyph within a given glyph slot.
396  *
397  * @Input:
398  * slot ::
399  * A handle to the target slot object where the glyph
400  * will be loaded.
401  *
402  * size ::
403  * A handle to the source face size at which the glyph
404  * must be scaled, loaded, etc.
405  *
406  * glyph_index ::
407  * The index of the glyph in the font file.
408  *
409  * load_flags ::
410  * A flag indicating what to load for this glyph. The
411  * FT_LOAD_XXX constants can be used to control the
412  * glyph loading process (e.g., whether the outline
413  * should be scaled, whether to load bitmaps or not,
414  * whether to hint the outline, etc).
415  *
416  * @Return:
417  * FreeType error code. 0 means success.
418  */
419  static FT_Error
420  tt_glyph_load( FT_GlyphSlot ttslot, /* TT_GlyphSlot */
421  FT_Size ttsize, /* TT_Size */
423  FT_Int32 load_flags )
424  {
425  TT_GlyphSlot slot = (TT_GlyphSlot)ttslot;
426  TT_Size size = (TT_Size)ttsize;
427  FT_Face face = ttslot->face;
428  FT_Error error;
429 
430 
431  if ( !slot )
432  return FT_THROW( Invalid_Slot_Handle );
433 
434  if ( !size )
435  return FT_THROW( Invalid_Size_Handle );
436 
437  if ( !face )
438  return FT_THROW( Invalid_Face_Handle );
439 
440 #ifdef FT_CONFIG_OPTION_INCREMENTAL
441  if ( glyph_index >= (FT_UInt)face->num_glyphs &&
442  !face->internal->incremental_interface )
443 #else
444  if ( glyph_index >= (FT_UInt)face->num_glyphs )
445 #endif
446  return FT_THROW( Invalid_Argument );
447 
448  if ( load_flags & FT_LOAD_NO_HINTING )
449  {
450  /* both FT_LOAD_NO_HINTING and FT_LOAD_NO_AUTOHINT */
451  /* are necessary to disable hinting for tricky fonts */
452 
453  if ( FT_IS_TRICKY( face ) )
454  load_flags &= ~~FT_LOAD_NO_HINTING;
455 
456  if ( load_flags & FT_LOAD_NO_AUTOHINT )
457  load_flags |= FT_LOAD_NO_HINTING;
458  }
459 
460  if ( load_flags & ( FT_LOAD_NO_RECURSE | FT_LOAD_NO_SCALE ) )
461  {
462  load_flags |= FT_LOAD_NO_BITMAP | FT_LOAD_NO_SCALE;
463 
464  if ( !FT_IS_TRICKY( face ) )
465  load_flags |= FT_LOAD_NO_HINTING;
466  }
467 
468  /* use hinted metrics only if we load a glyph with hinting */
469  size->metrics = ( load_flags & FT_LOAD_NO_HINTING )
470  ? &ttsize->metrics
471  : &size->hinted_metrics;
472 
473  /* now fill in the glyph slot with outline/bitmap/layered */
474  error = TT_Load_Glyph( size, slot, glyph_index, load_flags );
475 
476  /* force drop-out mode to 2 - irrelevant now */
477  /* slot->outline.dropout_mode = 2; */
478 
479  return error;
480  }
481 
482 
483  /*************************************************************************/
484  /*************************************************************************/
485  /*************************************************************************/
486  /**** ****/
487  /**** ****/
488  /**** D R I V E R I N T E R F A C E ****/
489  /**** ****/
490  /**** ****/
491  /*************************************************************************/
492  /*************************************************************************/
493  /*************************************************************************/
494 
495 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
496 
498  tt_service_gx_multi_masters,
499 
500  (FT_Get_MM_Func) NULL, /* get_mm */
501  (FT_Set_MM_Design_Func) NULL, /* set_mm_design */
502  (FT_Set_MM_Blend_Func) TT_Set_MM_Blend, /* set_mm_blend */
503  (FT_Get_MM_Blend_Func) TT_Get_MM_Blend, /* get_mm_blend */
504  (FT_Get_MM_Var_Func) TT_Get_MM_Var, /* get_mm_var */
505  (FT_Set_Var_Design_Func) TT_Set_Var_Design, /* set_var_design */
506  (FT_Get_Var_Design_Func) TT_Get_Var_Design, /* get_var_design */
507  (FT_Set_Instance_Func) TT_Set_Named_Instance, /* set_instance */
508  (FT_Set_MM_WeightVector_Func)NULL, /* set_mm_weightvector */
509  (FT_Get_MM_WeightVector_Func)NULL, /* get_mm_weightvector */
510 
511  (FT_Get_Var_Blend_Func) tt_get_var_blend, /* get_var_blend */
512  (FT_Done_Blend_Func) tt_done_blend /* done_blend */
513  )
514 
516  tt_service_metrics_variations,
517 
518  (FT_HAdvance_Adjust_Func)tt_hadvance_adjust, /* hadvance_adjust */
519  (FT_LSB_Adjust_Func) NULL, /* lsb_adjust */
520  (FT_RSB_Adjust_Func) NULL, /* rsb_adjust */
521 
522  (FT_VAdvance_Adjust_Func)tt_vadvance_adjust, /* vadvance_adjust */
523  (FT_TSB_Adjust_Func) NULL, /* tsb_adjust */
524  (FT_BSB_Adjust_Func) NULL, /* bsb_adjust */
525  (FT_VOrg_Adjust_Func) NULL, /* vorg_adjust */
526 
527  (FT_Metrics_Adjust_Func) tt_apply_mvar /* metrics_adjust */
528  )
529 
530 #endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
531 
532 
533  static const FT_Service_TrueTypeEngineRec tt_service_truetype_engine =
534  {
535 #ifdef TT_USE_BYTECODE_INTERPRETER
536 
538 
539 #else /* !TT_USE_BYTECODE_INTERPRETER */
540 
542 
543 #endif /* TT_USE_BYTECODE_INTERPRETER */
544  };
545 
546 
549 
551  )
552 
553 
554 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
556  tt_services,
557 
559  FT_SERVICE_ID_MULTI_MASTERS, &tt_service_gx_multi_masters,
560  FT_SERVICE_ID_METRICS_VARIATIONS, &tt_service_metrics_variations,
563  FT_SERVICE_ID_PROPERTIES, &tt_service_properties )
564 #else
566  tt_services,
567 
571  FT_SERVICE_ID_PROPERTIES, &tt_service_properties )
572 #endif
573 
574 
576  tt_get_interface( FT_Module driver, /* TT_Driver */
577  const char* tt_interface )
578  {
581  FT_Module sfntd;
583 
584 
585  result = ft_service_list_lookup( tt_services, tt_interface );
586  if ( result )
587  return result;
588 
589  if ( !driver )
590  return NULL;
591  library = driver->library;
592  if ( !library )
593  return NULL;
594 
595  /* only return the default interface from the SFNT module */
596  sfntd = FT_Get_Module( library, "sfnt" );
597  if ( sfntd )
598  {
599  sfnt = (SFNT_Service)( sfntd->clazz->module_interface );
600  if ( sfnt )
601  return sfnt->get_interface( driver, tt_interface );
602  }
603 
604  return 0;
605  }
606 
607 
608  /* The FT_DriverInterface structure is defined in ftdriver.h. */
609 
610 #ifdef TT_USE_BYTECODE_INTERPRETER
611 #define TT_HINTER_FLAG FT_MODULE_DRIVER_HAS_HINTER
612 #else
613 #define TT_HINTER_FLAG 0
614 #endif
615 
616 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
617 #define TT_SIZE_SELECT tt_size_select
618 #else
619 #define TT_SIZE_SELECT 0
620 #endif
621 
623  tt_driver_class,
624 
628 
629  sizeof ( TT_DriverRec ),
630 
631  "truetype", /* driver name */
632  0x10000L, /* driver version == 1.0 */
633  0x20000L, /* driver requires FreeType 2.0 or above */
634 
635  NULL, /* module-specific interface */
636 
637  tt_driver_init, /* FT_Module_Constructor module_init */
638  tt_driver_done, /* FT_Module_Destructor module_done */
639  tt_get_interface, /* FT_Module_Requester get_interface */
640 
641  sizeof ( TT_FaceRec ),
642  sizeof ( TT_SizeRec ),
643  sizeof ( FT_GlyphSlotRec ),
644 
645  tt_face_init, /* FT_Face_InitFunc init_face */
646  tt_face_done, /* FT_Face_DoneFunc done_face */
647  tt_size_init, /* FT_Size_InitFunc init_size */
648  tt_size_done, /* FT_Size_DoneFunc done_size */
649  tt_slot_init, /* FT_Slot_InitFunc init_slot */
650  NULL, /* FT_Slot_DoneFunc done_slot */
651 
652  tt_glyph_load, /* FT_Slot_LoadFunc load_glyph */
653 
654  tt_get_kerning, /* FT_Face_GetKerningFunc get_kerning */
655  NULL, /* FT_Face_AttachFunc attach_file */
656  tt_get_advances, /* FT_Face_GetAdvancesFunc get_advances */
657 
658  tt_size_request, /* FT_Size_RequestFunc request_size */
659  TT_SIZE_SELECT /* FT_Size_SelectFunc select_size */
660  )
661 
662 
663 /* END */
#define count(a)
Definition: aptex-macros.h:781
#define error(a)
Definition: dviinfo.c:48
#define s
Definition: afcover.h:80
#define TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
Definition: ftoption.h:958
#define TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
Definition: ftoption.h:954
#define ft_strcmp
Definition: ftstdlib.h:86
#define ft_strtol
Definition: ftstdlib.h:155
#define FT_UNUSED(arg)
#define FT_LOAD_VERTICAL_LAYOUT
Definition: freetype.h:3026
#define FT_LOAD_NO_BITMAP
Definition: freetype.h:3025
@ FT_SIZE_REQUEST_TYPE_SCALES
Definition: freetype.h:2556
#define FT_LOAD_NO_SCALE
Definition: freetype.h:3022
#define FT_LOAD_NO_RECURSE
Definition: freetype.h:3031
#define FT_LOAD_NO_HINTING
Definition: freetype.h:3023
#define FT_HAS_FIXED_SIZES(face)
Definition: freetype.h:1320
#define FT_IS_SCALABLE(face)
Definition: freetype.h:1271
#define FT_IS_VARIATION(face)
Definition: freetype.h:1401
#define FT_IS_NAMED_INSTANCE(face)
Definition: freetype.h:1383
#define FT_LOAD_NO_AUTOHINT
Definition: freetype.h:3035
#define FT_IS_TRICKY(face)
Definition: freetype.h:1432
FT_MulDiv(FT_Long a, FT_Long b, FT_Long c)
Definition: ftcalc.c:415
#define TT_INTERPRETER_VERSION_38
Definition: ftdriver.h:744
#define TT_INTERPRETER_VERSION_40
Definition: ftdriver.h:745
#define TT_INTERPRETER_VERSION_35
Definition: ftdriver.h:743
#define FT_MODULE_FONT_DRIVER
Definition: ftmodapi.h:109
@ FT_TRUETYPE_ENGINE_TYPE_NONE
Definition: ftmodapi.h:746
@ FT_TRUETYPE_ENGINE_TYPE_PATENTED
Definition: ftmodapi.h:748
FT_Get_Module(FT_Library library, const char *module_name)
Definition: ftobjs.c:4984
FT_Pointer FT_Module_Interface
Definition: ftmodapi.h:136
#define FT_MODULE_DRIVER_SCALABLE
Definition: ftmodapi.h:114
FT_BEGIN_HEADER typedef unsigned char FT_Bool
Definition: fttypes.h:108
unsigned long FT_ULong
Definition: fttypes.h:253
signed long FT_Fixed
Definition: fttypes.h:287
int FT_Error
Definition: fttypes.h:299
#define FT_ERR(e)
Definition: fttypes.h:599
unsigned short FT_UShort
Definition: fttypes.h:209
signed short FT_Short
Definition: fttypes.h:198
unsigned int FT_UInt
Definition: fttypes.h:231
#define FT_CALLBACK_DEF(x)
#define FT_TRACE0(varformat)
Definition: ftdebug.h:187
#define FT_THROW(e)
Definition: ftdebug.h:243
#define FT_DEFINE_DRIVER( class_, flags_, size_, name_, version_, requires_, interface_, init_, done_, get_interface_, face_object_size_, size_object_size_, slot_object_size_, init_face_, done_face_, init_size_, done_size_, init_slot_, done_slot_, load_glyph_, get_kerning_, attach_file_, get_advances_, request_size_, select_size_)
Definition: ftdrv.h:220
#define NULL
Definition: ftobjs.h:61
void FT_Select_Metrics(FT_Face face, FT_ULong strike_index)
Definition: ftobjs.c:3057
void FT_Request_Metrics(FT_Face face, FT_Size_Request req)
Definition: ftobjs.c:3092
#define FT_DEFINE_SERVICEDESCREC6(class_, serv_id_1, serv_data_1, serv_id_2, serv_data_2, serv_id_3, serv_data_3, serv_id_4, serv_data_4, serv_id_5, serv_data_5, serv_id_6, serv_data_6)
Definition: ftserv.h:243
#define FT_DEFINE_SERVICEDESCREC4(class_, serv_id_1, serv_data_1, serv_id_2, serv_data_2, serv_id_3, serv_data_3, serv_id_4, serv_data_4)
Definition: ftserv.h:213
FT_Pointer ft_service_list_lookup(FT_ServiceDesc service_descriptors, const char *service_id)
Definition: ftobjs.c:109
FT_Error(* FT_HAdvance_Adjust_Func)(FT_Face face, FT_UInt gindex, FT_Int *avalue)
Definition: svmetric.h:39
void(* FT_Metrics_Adjust_Func)(FT_Face face)
Definition: svmetric.h:78
FT_Error(* FT_VOrg_Adjust_Func)(FT_Face face, FT_UInt gindex, FT_Int *avalue)
Definition: svmetric.h:71
#define FT_SERVICE_ID_METRICS_VARIATIONS
Definition: svmetric.h:33
FT_Error(* FT_LSB_Adjust_Func)(FT_Face face, FT_UInt gindex, FT_Int *avalue)
Definition: svmetric.h:44
FT_Error(* FT_TSB_Adjust_Func)(FT_Face face, FT_UInt gindex, FT_Int *avalue)
Definition: svmetric.h:61
FT_Error(* FT_RSB_Adjust_Func)(FT_Face face, FT_UInt gindex, FT_Int *avalue)
Definition: svmetric.h:49
FT_Error(* FT_VAdvance_Adjust_Func)(FT_Face face, FT_UInt gindex, FT_Int *avalue)
Definition: svmetric.h:56
#define FT_DEFINE_SERVICE_METRICSVARIATIONSREC(class_, hadvance_adjust_, lsb_adjust_, rsb_adjust_, vadvance_adjust_, tsb_adjust_, bsb_adjust_, vorg_adjust_, metrics_adjust_)
Definition: svmetric.h:96
FT_Error(* FT_BSB_Adjust_Func)(FT_Face face, FT_UInt gindex, FT_Int *avalue)
Definition: svmetric.h:66
FT_Error(* FT_Set_Instance_Func)(FT_Face face, FT_UInt instance_index)
Definition: svmm.h:71
FT_Error(* FT_Set_MM_Blend_Func)(FT_Face face, FT_UInt num_coords, FT_Long *coords)
Definition: svmm.h:61
FT_Error(* FT_Get_MM_Func)(FT_Face face, FT_Multi_Master *master)
Definition: svmm.h:39
FT_Error(* FT_Set_MM_Design_Func)(FT_Face face, FT_UInt num_coords, FT_Long *coords)
Definition: svmm.h:47
FT_Error(* FT_Get_MM_Var_Func)(FT_Face face, FT_MM_Var **master)
Definition: svmm.h:43
FT_Error(* FT_Get_MM_Blend_Func)(FT_Face face, FT_UInt num_coords, FT_Long *coords)
Definition: svmm.h:75
#define FT_SERVICE_ID_MULTI_MASTERS
Definition: svmm.h:35
void(* FT_Done_Blend_Func)(FT_Face)
Definition: svmm.h:87
FT_Error(* FT_Get_Var_Blend_Func)(FT_Face face, FT_UInt *num_coords, FT_Fixed **coords, FT_Fixed **normalizedcoords, FT_MM_Var **mm_var)
Definition: svmm.h:80
#define FT_DEFINE_SERVICE_MULTIMASTERSREC(class_, get_mm_, set_mm_design_, set_mm_blend_, get_mm_blend_, get_mm_var_, set_var_design_, get_var_design_, set_instance_, set_weightvector_, get_weightvector_, get_var_blend_, done_blend_)
Definition: svmm.h:119
FT_Error(* FT_Get_Var_Design_Func)(FT_Face face, FT_UInt num_coords, FT_Fixed *coords)
Definition: svmm.h:66
FT_Error(* FT_Get_MM_WeightVector_Func)(FT_Face face, FT_UInt *len, FT_Fixed *weight_vector)
Definition: svmm.h:95
FT_Error(* FT_Set_MM_WeightVector_Func)(FT_Face face, FT_UInt len, FT_Fixed *weight_vector)
Definition: svmm.h:90
FT_Error(* FT_Set_Var_Design_Func)(FT_Face face, FT_UInt num_coords, FT_Fixed *coords)
Definition: svmm.h:54
FT_Error(* FT_Properties_GetFunc)(FT_Module module, const char *property_name, void *value)
Definition: svprop.h:36
FT_Error(* FT_Properties_SetFunc)(FT_Module module, const char *property_name, const void *value, FT_Bool value_is_string)
Definition: svprop.h:30
FT_ULong(* TT_Glyf_GetLocationFunc)(FT_Face face, FT_UInt gindex, FT_ULong *psize)
Definition: svttglyf.h:32
SFNT_Interface * SFNT_Service
Definition: sfnt.h:784
#define TT_FACE_FLAG_VAR_HADVANCE
Definition: tttypes.h:1135
struct TT_FaceRec_ * TT_Face
Definition: tttypes.h:988
struct TT_SizeRec_ * TT_Size
Definition: tttypes.h:1722
#define TT_FACE_FLAG_VAR_VADVANCE
Definition: tttypes.h:1140
return FT_Err_Ok
Definition: ftbbox.c:526
FT_Face face
Definition: cffdrivr.c:659
FT_Library library
Definition: cffdrivr.c:660
#define const
Definition: ftzconf.h:91
FT_UInt FT_UInt FT_Vector * kerning
Definition: ttdriver.c:206
&tt_service_properties tt_get_interface(FT_Module driver, const char *tt_interface)
Definition: ttdriver.c:576
#define TT_HINTER_FLAG
Definition: ttdriver.c:613
FT_UInt left_glyph
Definition: ttdriver.c:203
FT_SERVICE_ID_TRUETYPE_ENGINE
Definition: ttdriver.c:569
FT_FONT_FORMAT_TRUETYPE
Definition: ttdriver.c:568
#define TT_SIZE_SELECT
Definition: ttdriver.c:619
FT_SERVICE_ID_TT_GLYF
Definition: ttdriver.c:570
static FT_Error tt_size_request(FT_Size size, FT_Size_Request req)
Definition: ttdriver.c:331
FT_SERVICE_ID_PROPERTIES
Definition: ttdriver.c:571
if(sfnt)
Definition: ttdriver.c:214
FT_DEFINE_SERVICE_PROPERTIESREC(tt_service_properties,(FT_Properties_SetFunc) tt_property_set,(FT_Properties_GetFunc) tt_property_get) static FT_Error tt_get_kerning(FT_Face ttface
static FT_Error tt_property_set(FT_Module module, const char *property_name, const void *value, FT_Bool value_is_string)
Definition: ttdriver.c:61
static const FT_Service_TrueTypeEngineRec tt_service_truetype_engine
Definition: ttdriver.c:533
static FT_Error tt_glyph_load(FT_GlyphSlot ttslot, FT_Size ttsize, FT_UInt glyph_index, FT_Int32 load_flags)
Definition: ttdriver.c:420
static FT_Error tt_property_get(FT_Module module, const char *property_name, const void *value)
Definition: ttdriver.c:118
SFNT_Service sfnt
Definition: ttdriver.c:208
FT_UInt FT_UInt right_glyph
Definition: ttdriver.c:204
& tt_service_truetype_glyf
Definition: ttdriver.c:570
FT_SERVICE_ID_FONT_FORMAT
Definition: ttdriver.c:568
FT_DEFINE_SERVICE_TTGLYFREC(tt_service_truetype_glyf,(TT_Glyf_GetLocationFunc) tt_face_get_location) FT_DEFINE_SERVICEDESCREC4(tt_services
TT_Load_Glyph(TT_Size size, TT_GlyphSlot glyph, FT_UInt glyph_index, FT_Int32 load_flags)
Definition: ttgload.c:2807
TT_Get_HMetrics(TT_Face face, FT_UInt idx, FT_Short *lsb, FT_UShort *aw)
Definition: ttgload.c:99
TT_Get_VMetrics(TT_Face face, FT_UInt idx, FT_Pos yMax, FT_Short *tsb, FT_UShort *ah)
Definition: ttgload.c:117
tt_face_init(FT_Stream stream, FT_Face ttface, FT_Int face_index, FT_Int num_params, FT_Parameter *params)
Definition: ttobjs.c:605
tt_size_init(FT_Size ttsize)
Definition: ttobjs.c:1239
tt_size_done(FT_Size ttsize)
Definition: ttobjs.c:1270
tt_slot_init(FT_GlyphSlot slot)
Definition: ttobjs.c:1470
tt_size_reset(TT_Size size, FT_Bool only_height)
Definition: ttobjs.c:1302
tt_driver_init(FT_Module ttdriver)
Definition: ttobjs.c:1410
tt_face_done(FT_Face ttface)
Definition: ttobjs.c:768
tt_driver_done(FT_Module ttdriver)
Definition: ttobjs.c:1448
typedefFT_BEGIN_HEADER struct TT_DriverRec_ * TT_Driver
Definition: ttobjs.h:38
FT_GlyphSlot TT_GlyphSlot
Definition: ttobjs.h:53
tt_face_get_location(TT_Face face, FT_UInt gindex, FT_UInt *asize)
Definition: ttpload.c:196
integer resolution
Definition: pbmtopk.c:45
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro pixld1_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl else error unsupported endif endm macro pixld2_s mem_operand if mov asr add asl add asl mov asr sub UNIT_X add asl mov asr add asl add asl mov asr add UNIT_X add asl else pixld1_s mem_operand pixld1_s mem_operand endif endm macro pixld0_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl endif endm macro pixld_s_internal mem_operand if mem_operand pixld2_s mem_operand pixdeinterleave basereg elseif mem_operand elseif mem_operand elseif mem_operand elseif mem_operand pixld0_s mem_operand else pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else error unsupported mem_operand if bpp mem_operand endif endm macro vuzp8 reg2 vuzp d d &reg2 endm macro vzip8 reg2 vzip d d &reg2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld[DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld endif[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro fetch_mask_pixblock pixld mask_basereg pixblock_size MASK endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp skip1 beq endif SRC MASK if dst_r_bpp DST_R else add endif PF add sub src_basereg pixdeinterleave mask_basereg pixdeinterleave dst_r_basereg process_pixblock_head pixblock_size cache_preload_simple process_pixblock_tail pixinterleave dst_w_basereg irp beq endif process_pixblock_tail_head tst beq irp if pixblock_size chunk_size tst beq pixld_src SRC pixld MASK if DST_R else pixld DST_R endif if
integer nn[24]
Definition: pmxab.c:90
integer iv
Definition: pmxab.c:86
static int size
Definition: ppmlabel.c:24
#define flags
slotref slot
Definition: opcodes.h:237
#define glyph_index()
FT_Long num_glyphs
Definition: freetype.h:1036
FT_Face_Internal internal
Definition: freetype.h:1080
FT_Module_Class * clazz
Definition: ftobjs.h:500
const void * module_interface
Definition: ftmodapi.h:240
FT_Size_Metrics metrics
Definition: freetype.h:1636
FT_UShort x_ppem
Definition: freetype.h:1597
FT_UShort y_ppem
Definition: freetype.h:1598
FT_UInt horiResolution
Definition: freetype.h:2607
FT_Size_Request_Type type
Definition: freetype.h:2604
FT_UInt vertResolution
Definition: freetype.h:2608
FT_Pos x
Definition: ftimage.h:77
FT_Pos y
Definition: ftimage.h:78
void * sfnt
Definition: tttypes.h:1499
FT_Size_Metrics * metrics
Definition: ttobjs.h:280
TT_Size_Metrics ttmetrics
Definition: ttobjs.h:283
FT_ULong strike_index
Definition: ttobjs.h:285
FT_UShort ppem
Definition: ttobjs.h:256
Definition: obx.h:117
Definition: sfnt.h:76
Definition: strexpr.c:21
Definition: obx.h:51
@ start
Definition: preamble.c:52