ReactOS  0.4.14-dev-50-g13bb5e2
cffobjs.c
Go to the documentation of this file.
1 /***************************************************************************/
2 /* */
3 /* cffobjs.c */
4 /* */
5 /* OpenType objects manager (body). */
6 /* */
7 /* Copyright 1996-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 #include <ft2build.h>
20 
21 #include FT_INTERNAL_DEBUG_H
22 #include FT_INTERNAL_CALC_H
23 #include FT_INTERNAL_STREAM_H
24 #include FT_ERRORS_H
25 #include FT_TRUETYPE_IDS_H
26 #include FT_TRUETYPE_TAGS_H
27 #include FT_INTERNAL_SFNT_H
28 #include FT_DRIVER_H
29 
30 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
31 #include FT_MULTIPLE_MASTERS_H
32 #include FT_SERVICE_MULTIPLE_MASTERS_H
33 #include FT_SERVICE_METRICS_VARIATIONS_H
34 #endif
35 
36 #include FT_INTERNAL_CFF_OBJECTS_TYPES_H
37 #include "cffobjs.h"
38 #include "cffload.h"
39 #include "cffcmap.h"
40 #include "cffpic.h"
41 
42 #include "cfferrs.h"
43 
44 #include FT_INTERNAL_POSTSCRIPT_AUX_H
45 #include FT_SERVICE_CFF_TABLE_LOAD_H
46 
47 
48  /*************************************************************************/
49  /* */
50  /* The macro FT_COMPONENT is used in trace mode. It is an implicit */
51  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
52  /* messages during execution. */
53  /* */
54 #undef FT_COMPONENT
55 #define FT_COMPONENT trace_cffobjs
56 
57 
58  /*************************************************************************/
59  /* */
60  /* SIZE FUNCTIONS */
61  /* */
62  /*************************************************************************/
63 
64 
65  static PSH_Globals_Funcs
67  {
68  CFF_Face face = (CFF_Face)size->root.face;
69  CFF_Font font = (CFF_Font)face->extra.data;
70  PSHinter_Service pshinter = font->pshinter;
72 
73 
74  module = FT_Get_Module( size->root.face->driver->root.library,
75  "pshinter" );
76  return ( module && pshinter && pshinter->get_globals_funcs )
77  ? pshinter->get_globals_funcs( module )
78  : 0;
79  }
80 
81 
82  FT_LOCAL_DEF( void )
83  cff_size_done( FT_Size cffsize ) /* CFF_Size */
84  {
85  FT_Memory memory = cffsize->face->memory;
86  CFF_Size size = (CFF_Size)cffsize;
87  CFF_Face face = (CFF_Face)size->root.face;
88  CFF_Font font = (CFF_Font)face->extra.data;
89  CFF_Internal internal = (CFF_Internal)cffsize->internal->module_data;
90 
91 
92  if ( internal )
93  {
95 
96 
98  if ( funcs )
99  {
100  FT_UInt i;
101 
102 
103  funcs->destroy( internal->topfont );
104 
105  for ( i = font->num_subfonts; i > 0; i-- )
106  funcs->destroy( internal->subfonts[i - 1] );
107  }
108 
109  FT_FREE( internal );
110  }
111  }
112 
113 
114  /* CFF and Type 1 private dictionaries have slightly different */
115  /* structures; we need to synthesize a Type 1 dictionary on the fly */
116 
117  static void
119  PS_Private priv )
120  {
121  CFF_Private cpriv = &subfont->private_dict;
122  FT_UInt n, count;
123 
124 
125  FT_ZERO( priv );
126 
127  count = priv->num_blue_values = cpriv->num_blue_values;
128  for ( n = 0; n < count; n++ )
129  priv->blue_values[n] = (FT_Short)cpriv->blue_values[n];
130 
131  count = priv->num_other_blues = cpriv->num_other_blues;
132  for ( n = 0; n < count; n++ )
133  priv->other_blues[n] = (FT_Short)cpriv->other_blues[n];
134 
135  count = priv->num_family_blues = cpriv->num_family_blues;
136  for ( n = 0; n < count; n++ )
137  priv->family_blues[n] = (FT_Short)cpriv->family_blues[n];
138 
140  for ( n = 0; n < count; n++ )
142 
143  priv->blue_scale = cpriv->blue_scale;
144  priv->blue_shift = (FT_Int)cpriv->blue_shift;
145  priv->blue_fuzz = (FT_Int)cpriv->blue_fuzz;
146 
147  priv->standard_width[0] = (FT_UShort)cpriv->standard_width;
148  priv->standard_height[0] = (FT_UShort)cpriv->standard_height;
149 
150  count = priv->num_snap_widths = cpriv->num_snap_widths;
151  for ( n = 0; n < count; n++ )
152  priv->snap_widths[n] = (FT_Short)cpriv->snap_widths[n];
153 
154  count = priv->num_snap_heights = cpriv->num_snap_heights;
155  for ( n = 0; n < count; n++ )
156  priv->snap_heights[n] = (FT_Short)cpriv->snap_heights[n];
157 
158  priv->force_bold = cpriv->force_bold;
159  priv->language_group = cpriv->language_group;
160  priv->lenIV = cpriv->lenIV;
161  }
162 
163 
165  cff_size_init( FT_Size cffsize ) /* CFF_Size */
166  {
167  CFF_Size size = (CFF_Size)cffsize;
170 
171 
172  if ( funcs )
173  {
174  CFF_Face face = (CFF_Face)cffsize->face;
175  CFF_Font font = (CFF_Font)face->extra.data;
176  CFF_Internal internal = NULL;
177 
178  PS_PrivateRec priv;
179  FT_Memory memory = cffsize->face->memory;
180 
181  FT_UInt i;
182 
183 
184  if ( FT_NEW( internal ) )
185  goto Exit;
186 
187  cff_make_private_dict( &font->top_font, &priv );
188  error = funcs->create( cffsize->face->memory, &priv,
189  &internal->topfont );
190  if ( error )
191  goto Exit;
192 
193  for ( i = font->num_subfonts; i > 0; i-- )
194  {
195  CFF_SubFont sub = font->subfonts[i - 1];
196 
197 
198  cff_make_private_dict( sub, &priv );
199  error = funcs->create( cffsize->face->memory, &priv,
200  &internal->subfonts[i - 1] );
201  if ( error )
202  goto Exit;
203  }
204 
205  cffsize->internal->module_data = internal;
206  }
207 
208  size->strike_index = 0xFFFFFFFFUL;
209 
210  Exit:
211  return error;
212  }
213 
214 
215 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
216 
218  cff_size_select( FT_Size size,
219  FT_ULong strike_index )
220  {
221  CFF_Size cffsize = (CFF_Size)size;
223 
224 
225  cffsize->strike_index = strike_index;
226 
227  FT_Select_Metrics( size->face, strike_index );
228 
229  funcs = cff_size_get_globals_funcs( cffsize );
230 
231  if ( funcs )
232  {
233  CFF_Face face = (CFF_Face)size->face;
234  CFF_Font font = (CFF_Font)face->extra.data;
235  CFF_Internal internal = (CFF_Internal)size->internal->module_data;
236 
237  FT_Long top_upm = (FT_Long)font->top_font.font_dict.units_per_em;
238  FT_UInt i;
239 
240 
241  funcs->set_scale( internal->topfont,
242  size->metrics.x_scale, size->metrics.y_scale,
243  0, 0 );
244 
245  for ( i = font->num_subfonts; i > 0; i-- )
246  {
247  CFF_SubFont sub = font->subfonts[i - 1];
248  FT_Long sub_upm = (FT_Long)sub->font_dict.units_per_em;
249  FT_Pos x_scale, y_scale;
250 
251 
252  if ( top_upm != sub_upm )
253  {
254  x_scale = FT_MulDiv( size->metrics.x_scale, top_upm, sub_upm );
255  y_scale = FT_MulDiv( size->metrics.y_scale, top_upm, sub_upm );
256  }
257  else
258  {
259  x_scale = size->metrics.x_scale;
260  y_scale = size->metrics.y_scale;
261  }
262 
263  funcs->set_scale( internal->subfonts[i - 1],
264  x_scale, y_scale, 0, 0 );
265  }
266  }
267 
268  return FT_Err_Ok;
269  }
270 
271 #endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
272 
273 
276  FT_Size_Request req )
277  {
278  CFF_Size cffsize = (CFF_Size)size;
280 
281 
282 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
283 
284  if ( FT_HAS_FIXED_SIZES( size->face ) )
285  {
286  CFF_Face cffface = (CFF_Face)size->face;
287  SFNT_Service sfnt = (SFNT_Service)cffface->sfnt;
288  FT_ULong strike_index;
289 
290 
291  if ( sfnt->set_sbit_strike( cffface, req, &strike_index ) )
292  cffsize->strike_index = 0xFFFFFFFFUL;
293  else
294  return cff_size_select( size, strike_index );
295  }
296 
297 #endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
298 
299  FT_Request_Metrics( size->face, req );
300 
301  funcs = cff_size_get_globals_funcs( cffsize );
302 
303  if ( funcs )
304  {
305  CFF_Face cffface = (CFF_Face)size->face;
306  CFF_Font font = (CFF_Font)cffface->extra.data;
307  CFF_Internal internal = (CFF_Internal)size->internal->module_data;
308 
309  FT_Long top_upm = (FT_Long)font->top_font.font_dict.units_per_em;
310  FT_UInt i;
311 
312 
313  funcs->set_scale( internal->topfont,
314  size->metrics.x_scale, size->metrics.y_scale,
315  0, 0 );
316 
317  for ( i = font->num_subfonts; i > 0; i-- )
318  {
319  CFF_SubFont sub = font->subfonts[i - 1];
320  FT_Long sub_upm = (FT_Long)sub->font_dict.units_per_em;
321  FT_Pos x_scale, y_scale;
322 
323 
324  if ( top_upm != sub_upm )
325  {
326  x_scale = FT_MulDiv( size->metrics.x_scale, top_upm, sub_upm );
327  y_scale = FT_MulDiv( size->metrics.y_scale, top_upm, sub_upm );
328  }
329  else
330  {
331  x_scale = size->metrics.x_scale;
332  y_scale = size->metrics.y_scale;
333  }
334 
335  funcs->set_scale( internal->subfonts[i - 1],
336  x_scale, y_scale, 0, 0 );
337  }
338  }
339 
340  return FT_Err_Ok;
341  }
342 
343 
344  /*************************************************************************/
345  /* */
346  /* SLOT FUNCTIONS */
347  /* */
348  /*************************************************************************/
349 
350  FT_LOCAL_DEF( void )
352  {
353  slot->internal->glyph_hints = NULL;
354  }
355 
356 
359  {
360  CFF_Face face = (CFF_Face)slot->face;
361  CFF_Font font = (CFF_Font)face->extra.data;
362  PSHinter_Service pshinter = font->pshinter;
363 
364 
365  if ( pshinter )
366  {
368 
369 
370  module = FT_Get_Module( slot->face->driver->root.library,
371  "pshinter" );
372  if ( module )
373  {
375 
376 
377  funcs = pshinter->get_t2_funcs( module );
378  slot->internal->glyph_hints = (void*)funcs;
379  }
380  }
381 
382  return FT_Err_Ok;
383  }
384 
385 
386  /*************************************************************************/
387  /* */
388  /* FACE FUNCTIONS */
389  /* */
390  /*************************************************************************/
391 
392  static FT_String*
394  const FT_String* source )
395  {
396  FT_Error error;
397  FT_String* result;
398 
399 
401 
402  FT_UNUSED( error );
403 
404  return result;
405  }
406 
407 
408  /* Strip all subset prefixes of the form `ABCDEF+'. Usually, there */
409  /* is only one, but font names like `APCOOG+JFABTD+FuturaBQ-Bold' */
410  /* have been seen in the wild. */
411 
412  static void
414  {
415  FT_Int32 idx = 0;
416  FT_Int32 length = (FT_Int32)ft_strlen( name ) + 1;
417  FT_Bool continue_search = 1;
418 
419 
420  while ( continue_search )
421  {
422  if ( length >= 7 && name[6] == '+' )
423  {
424  for ( idx = 0; idx < 6; idx++ )
425  {
426  /* ASCII uppercase letters */
427  if ( !( 'A' <= name[idx] && name[idx] <= 'Z' ) )
428  continue_search = 0;
429  }
430 
431  if ( continue_search )
432  {
433  for ( idx = 7; idx < length; idx++ )
434  name[idx - 7] = name[idx];
435  length -= 7;
436  }
437  }
438  else
439  continue_search = 0;
440  }
441  }
442 
443 
444  /* Remove the style part from the family name (if present). */
445 
446  static void
448  const FT_String* style_name )
449  {
450  FT_Int32 family_name_length, style_name_length;
451 
452 
453  family_name_length = (FT_Int32)ft_strlen( family_name );
454  style_name_length = (FT_Int32)ft_strlen( style_name );
455 
456  if ( family_name_length > style_name_length )
457  {
458  FT_Int idx;
459 
460 
461  for ( idx = 1; idx <= style_name_length; idx++ )
462  {
463  if ( family_name[family_name_length - idx] !=
464  style_name[style_name_length - idx] )
465  break;
466  }
467 
468  if ( idx > style_name_length )
469  {
470  /* family_name ends with style_name; remove it */
471  idx = family_name_length - style_name_length - 1;
472 
473  /* also remove special characters */
474  /* between real family name and style */
475  while ( idx > 0 &&
476  ( family_name[idx] == '-' ||
477  family_name[idx] == ' ' ||
478  family_name[idx] == '_' ||
479  family_name[idx] == '+' ) )
480  idx--;
481 
482  if ( idx > 0 )
483  family_name[idx + 1] = '\0';
484  }
485  }
486  }
487 
488 
491  FT_Face cffface, /* CFF_Face */
492  FT_Int face_index,
493  FT_Int num_params,
495  {
496  CFF_Face face = (CFF_Face)cffface;
497  FT_Error error;
499  FT_Service_PsCMaps psnames;
500  PSHinter_Service pshinter;
501  PSAux_Service psaux;
502  FT_Service_CFFLoad cffload;
503  FT_Bool pure_cff = 1;
504  FT_Bool cff2 = 0;
505  FT_Bool sfnt_format = 0;
506  FT_Library library = cffface->driver->root.library;
507 
508 
510  "sfnt" );
511  if ( !sfnt )
512  {
513  FT_ERROR(( "cff_face_init: cannot access `sfnt' module\n" ));
514  error = FT_THROW( Missing_Module );
515  goto Exit;
516  }
517 
518  FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS );
519 
521  "pshinter" );
522 
524  "psaux" );
525  if ( !psaux )
526  {
527  FT_ERROR(( "cff_face_init: cannot access `psaux' module\n" ));
528  error = FT_THROW( Missing_Module );
529  goto Exit;
530  }
531  face->psaux = psaux;
532 
533  FT_FACE_FIND_GLOBAL_SERVICE( face, cffload, CFF_LOAD );
534 
535  FT_TRACE2(( "CFF driver\n" ));
536 
537  /* create input stream from resource */
538  if ( FT_STREAM_SEEK( 0 ) )
539  goto Exit;
540 
541  /* check whether we have a valid OpenType file */
542  FT_TRACE2(( " " ));
543  error = sfnt->init_face( stream, face, face_index, num_params, params );
544  if ( !error )
545  {
546  if ( face->format_tag != TTAG_OTTO ) /* `OTTO'; OpenType/CFF font */
547  {
548  FT_TRACE2(( " not an OpenType/CFF font\n" ));
549  error = FT_THROW( Unknown_File_Format );
550  goto Exit;
551  }
552 
553  /* if we are performing a simple font format check, exit immediately */
554  if ( face_index < 0 )
555  return FT_Err_Ok;
556 
557  sfnt_format = 1;
558 
559  /* now, the font can be either an OpenType/CFF font, or an SVG CEF */
560  /* font; in the latter case it doesn't have a `head' table */
561  error = face->goto_table( face, TTAG_head, stream, 0 );
562  if ( !error )
563  {
564  pure_cff = 0;
565 
566  /* load font directory */
567  error = sfnt->load_face( stream, face, face_index,
568  num_params, params );
569  if ( error )
570  goto Exit;
571  }
572  else
573  {
574  /* load the `cmap' table explicitly */
575  error = sfnt->load_cmap( face, stream );
576  if ( error )
577  goto Exit;
578  }
579 
580  /* now load the CFF part of the file; */
581  /* give priority to CFF2 */
582  error = face->goto_table( face, TTAG_CFF2, stream, 0 );
583  if ( !error )
584  {
585  cff2 = 1;
586  face->is_cff2 = cff2;
587  }
588 
589  if ( FT_ERR_EQ( error, Table_Missing ) )
590  error = face->goto_table( face, TTAG_CFF, stream, 0 );
591 
592  if ( error )
593  goto Exit;
594  }
595  else
596  {
597  /* rewind to start of file; we are going to load a pure-CFF font */
598  if ( FT_STREAM_SEEK( 0 ) )
599  goto Exit;
600  error = FT_Err_Ok;
601  }
602 
603  /* now load and parse the CFF table in the file */
604  {
605  CFF_Font cff = NULL;
606  CFF_FontRecDict dict;
607  FT_Memory memory = cffface->memory;
608  FT_Int32 flags;
609  FT_UInt i;
610 
611 
612  if ( FT_NEW( cff ) )
613  goto Exit;
614 
615  face->extra.data = cff;
617  stream,
618  face_index,
619  cff,
620  face,
621  pure_cff,
622  cff2 );
623  if ( error )
624  goto Exit;
625 
626  /* if we are performing a simple font format check, exit immediately */
627  /* (this is here for pure CFF) */
628  if ( face_index < 0 )
629  {
630  cffface->num_faces = (FT_Long)cff->num_faces;
631  return FT_Err_Ok;
632  }
633 
634  cff->pshinter = pshinter;
635  cff->psnames = psnames;
636  cff->cffload = cffload;
637 
638  cffface->face_index = face_index & 0xFFFF;
639 
640  /* Complement the root flags with some interesting information. */
641  /* Note that this is only necessary for pure CFF and CEF fonts; */
642  /* SFNT based fonts use the `name' table instead. */
643 
644  cffface->num_glyphs = (FT_Long)cff->num_glyphs;
645 
646  dict = &cff->top_font.font_dict;
647 
648  /* we need the `PSNames' module for CFF and CEF formats */
649  /* which aren't CID-keyed */
650  if ( dict->cid_registry == 0xFFFFU && !psnames )
651  {
652  FT_ERROR(( "cff_face_init:"
653  " cannot open CFF & CEF fonts\n"
654  " "
655  " without the `PSNames' module\n" ));
656  error = FT_THROW( Missing_Module );
657  goto Exit;
658  }
659 
660 #ifdef FT_DEBUG_LEVEL_TRACE
661  {
662  FT_UInt idx;
663  FT_String* s;
664 
665 
666  FT_TRACE4(( "SIDs\n" ));
667 
668  /* dump string index, including default strings for convenience */
669  for ( idx = 0; idx <= 390; idx++ )
670  {
672  if ( s )
673  FT_TRACE4(( " %5d %s\n", idx, s ));
674  }
675 
676  /* In Multiple Master CFFs, two SIDs hold the Normalize Design */
677  /* Vector (NDV) and Convert Design Vector (CDV) charstrings, */
678  /* which may contain NULL bytes in the middle of the data, too. */
679  /* We thus access `cff->strings' directly. */
680  for ( idx = 1; idx < cff->num_strings; idx++ )
681  {
682  FT_Byte* s1 = cff->strings[idx - 1];
683  FT_Byte* s2 = cff->strings[idx];
684  FT_PtrDist s1len = s2 - s1 - 1; /* without the final NULL byte */
685  FT_PtrDist l;
686 
687 
688  FT_TRACE4(( " %5d ", idx + 390 ));
689  for ( l = 0; l < s1len; l++ )
690  FT_TRACE4(( "%c", s1[l] ));
691  FT_TRACE4(( "\n" ));
692  }
693 
694  /* print last element */
695  if ( cff->num_strings )
696  {
697  FT_Byte* s1 = cff->strings[cff->num_strings - 1];
699  FT_PtrDist s1len = s2 - s1 - 1;
700  FT_PtrDist l;
701 
702 
703  FT_TRACE4(( " %5d ", cff->num_strings + 390 ));
704  for ( l = 0; l < s1len; l++ )
705  FT_TRACE4(( "%c", s1[l] ));
706  FT_TRACE4(( "\n" ));
707  }
708  }
709 #endif /* FT_DEBUG_LEVEL_TRACE */
710 
711 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
712  {
713  FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
714  FT_Service_MetricsVariations var = (FT_Service_MetricsVariations)face->var;
715 
716  FT_UInt instance_index = (FT_UInt)face_index >> 16;
717 
718 
719  if ( FT_HAS_MULTIPLE_MASTERS( cffface ) &&
720  mm &&
721  instance_index > 0 )
722  {
723  error = mm->set_instance( cffface, instance_index );
724  if ( error )
725  goto Exit;
726 
727  if ( var )
728  var->metrics_adjust( cffface );
729  }
730  }
731 #endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
732 
733  if ( !dict->has_font_matrix )
734  dict->units_per_em = pure_cff ? 1000 : face->root.units_per_EM;
735 
736  /* Normalize the font matrix so that `matrix->yy' is 1; if */
737  /* it is zero, we use `matrix->yx' instead. The scaling is */
738  /* done with `units_per_em' then (at this point, it already */
739  /* contains the scaling factor, but without normalization */
740  /* of the matrix). */
741  /* */
742  /* Note that the offsets must be expressed in integer font */
743  /* units. */
744 
745  {
746  FT_Matrix* matrix = &dict->font_matrix;
747  FT_Vector* offset = &dict->font_offset;
748  FT_ULong* upm = &dict->units_per_em;
749  FT_Fixed temp;
750 
751 
752  temp = matrix->yy ? FT_ABS( matrix->yy )
753  : FT_ABS( matrix->yx );
754 
755  if ( temp != 0x10000L )
756  {
757  *upm = (FT_ULong)FT_DivFix( (FT_Long)*upm, temp );
758 
759  matrix->xx = FT_DivFix( matrix->xx, temp );
760  matrix->yx = FT_DivFix( matrix->yx, temp );
761  matrix->xy = FT_DivFix( matrix->xy, temp );
762  matrix->yy = FT_DivFix( matrix->yy, temp );
763  offset->x = FT_DivFix( offset->x, temp );
764  offset->y = FT_DivFix( offset->y, temp );
765  }
766 
767  offset->x >>= 16;
768  offset->y >>= 16;
769  }
770 
771  for ( i = cff->num_subfonts; i > 0; i-- )
772  {
773  CFF_FontRecDict sub = &cff->subfonts[i - 1]->font_dict;
775 
776  FT_Matrix* matrix;
777  FT_Vector* offset;
778  FT_ULong* upm;
779  FT_Fixed temp;
780 
781 
782  if ( sub->has_font_matrix )
783  {
784  FT_Long scaling;
785 
786 
787  /* if we have a top-level matrix, */
788  /* concatenate the subfont matrix */
789 
790  if ( top->has_font_matrix )
791  {
792  if ( top->units_per_em > 1 && sub->units_per_em > 1 )
793  scaling = (FT_Long)FT_MIN( top->units_per_em,
794  sub->units_per_em );
795  else
796  scaling = 1;
797 
798  FT_Matrix_Multiply_Scaled( &top->font_matrix,
799  &sub->font_matrix,
800  scaling );
802  &top->font_matrix,
803  scaling );
804 
805  sub->units_per_em = (FT_ULong)
807  (FT_Long)top->units_per_em,
808  scaling );
809  }
810  }
811  else
812  {
813  sub->font_matrix = top->font_matrix;
814  sub->font_offset = top->font_offset;
815 
816  sub->units_per_em = top->units_per_em;
817  }
818 
819  matrix = &sub->font_matrix;
820  offset = &sub->font_offset;
821  upm = &sub->units_per_em;
822 
823  temp = matrix->yy ? FT_ABS( matrix->yy )
824  : FT_ABS( matrix->yx );
825 
826 
827  if ( temp != 0x10000L )
828  {
829  *upm = (FT_ULong)FT_DivFix( (FT_Long)*upm, temp );
830 
831  matrix->xx = FT_DivFix( matrix->xx, temp );
832  matrix->yx = FT_DivFix( matrix->yx, temp );
833  matrix->xy = FT_DivFix( matrix->xy, temp );
834  matrix->yy = FT_DivFix( matrix->yy, temp );
835  offset->x = FT_DivFix( offset->x, temp );
836  offset->y = FT_DivFix( offset->y, temp );
837  }
838 
839  offset->x >>= 16;
840  offset->y >>= 16;
841  }
842 
843  if ( pure_cff )
844  {
845  char* style_name = NULL;
846 
847 
848  /* set up num_faces */
849  cffface->num_faces = (FT_Long)cff->num_faces;
850 
851  /* compute number of glyphs */
852  if ( dict->cid_registry != 0xFFFFU )
853  cffface->num_glyphs = (FT_Long)( cff->charset.max_cid + 1 );
854  else
855  cffface->num_glyphs = (FT_Long)cff->charstrings_index.count;
856 
857  /* set global bbox, as well as EM size */
858  cffface->bbox.xMin = dict->font_bbox.xMin >> 16;
859  cffface->bbox.yMin = dict->font_bbox.yMin >> 16;
860  /* no `U' suffix here to 0xFFFF! */
861  cffface->bbox.xMax = ( dict->font_bbox.xMax + 0xFFFF ) >> 16;
862  cffface->bbox.yMax = ( dict->font_bbox.yMax + 0xFFFF ) >> 16;
863 
864  cffface->units_per_EM = (FT_UShort)( dict->units_per_em );
865 
866  cffface->ascender = (FT_Short)( cffface->bbox.yMax );
867  cffface->descender = (FT_Short)( cffface->bbox.yMin );
868 
869  cffface->height = (FT_Short)( ( cffface->units_per_EM * 12 ) / 10 );
870  if ( cffface->height < cffface->ascender - cffface->descender )
871  cffface->height = (FT_Short)( cffface->ascender -
872  cffface->descender );
873 
874  cffface->underline_position =
875  (FT_Short)( dict->underline_position >> 16 );
876  cffface->underline_thickness =
877  (FT_Short)( dict->underline_thickness >> 16 );
878 
879  /* retrieve font family & style name */
880  if ( dict->family_name )
881  {
882  char* family_name;
883 
884 
886  if ( family_name )
887  cffface->family_name = cff_strcpy( memory, family_name );
888  }
889 
890  if ( !cffface->family_name )
891  {
892  cffface->family_name = cff_index_get_name(
893  cff,
894  (FT_UInt)( face_index & 0xFFFF ) );
895  if ( cffface->family_name )
896  remove_subset_prefix( cffface->family_name );
897  }
898 
899  if ( cffface->family_name )
900  {
901  char* full = cff_index_get_sid_string( cff,
902  dict->full_name );
903  char* fullp = full;
904  char* family = cffface->family_name;
905 
906 
907  /* We try to extract the style name from the full name. */
908  /* We need to ignore spaces and dashes during the search. */
909  if ( full && family )
910  {
911  while ( *fullp )
912  {
913  /* skip common characters at the start of both strings */
914  if ( *fullp == *family )
915  {
916  family++;
917  fullp++;
918  continue;
919  }
920 
921  /* ignore spaces and dashes in full name during comparison */
922  if ( *fullp == ' ' || *fullp == '-' )
923  {
924  fullp++;
925  continue;
926  }
927 
928  /* ignore spaces and dashes in family name during comparison */
929  if ( *family == ' ' || *family == '-' )
930  {
931  family++;
932  continue;
933  }
934 
935  if ( !*family && *fullp )
936  {
937  /* The full name begins with the same characters as the */
938  /* family name, with spaces and dashes removed. In this */
939  /* case, the remaining string in `fullp' will be used as */
940  /* the style name. */
941  style_name = cff_strcpy( memory, fullp );
942 
943  /* remove the style part from the family name (if present) */
944  remove_style( cffface->family_name, style_name );
945  }
946  break;
947  }
948  }
949  }
950  else
951  {
952  char *cid_font_name =
954  dict->cid_font_name );
955 
956 
957  /* do we have a `/FontName' for a CID-keyed font? */
958  if ( cid_font_name )
959  cffface->family_name = cff_strcpy( memory, cid_font_name );
960  }
961 
962  if ( style_name )
963  cffface->style_name = style_name;
964  else
965  /* assume "Regular" style if we don't know better */
966  cffface->style_name = cff_strcpy( memory, (char *)"Regular" );
967 
968  /*******************************************************************/
969  /* */
970  /* Compute face flags. */
971  /* */
972  flags = FT_FACE_FLAG_SCALABLE | /* scalable outlines */
973  FT_FACE_FLAG_HORIZONTAL | /* horizontal data */
974  FT_FACE_FLAG_HINTER; /* has native hinter */
975 
976  if ( sfnt_format )
978 
979  /* fixed width font? */
980  if ( dict->is_fixed_pitch )
982 
983  /* XXX: WE DO NOT SUPPORT KERNING METRICS IN THE GPOS TABLE FOR NOW */
984 #if 0
985  /* kerning available? */
986  if ( face->kern_pairs )
988 #endif
989 
990  cffface->face_flags |= flags;
991 
992  /*******************************************************************/
993  /* */
994  /* Compute style flags. */
995  /* */
996  flags = 0;
997 
998  if ( dict->italic_angle )
1000 
1001  {
1003  dict->weight );
1004 
1005 
1006  if ( weight )
1007  if ( !ft_strcmp( weight, "Bold" ) ||
1008  !ft_strcmp( weight, "Black" ) )
1010  }
1011 
1012  /* double check */
1013  if ( !(flags & FT_STYLE_FLAG_BOLD) && cffface->style_name )
1014  if ( !ft_strncmp( cffface->style_name, "Bold", 4 ) ||
1015  !ft_strncmp( cffface->style_name, "Black", 5 ) )
1017 
1018  cffface->style_flags = flags;
1019  }
1020 
1021 #ifndef FT_CONFIG_OPTION_NO_GLYPH_NAMES
1022  /* CID-keyed CFF fonts don't have glyph names -- the SFNT loader */
1023  /* has unset this flag because of the 3.0 `post' table. */
1024  if ( dict->cid_registry == 0xFFFFU )
1025  cffface->face_flags |= FT_FACE_FLAG_GLYPH_NAMES;
1026 #endif
1027 
1028  if ( dict->cid_registry != 0xFFFFU && pure_cff )
1029  cffface->face_flags |= FT_FACE_FLAG_CID_KEYED;
1030 
1031  /*******************************************************************/
1032  /* */
1033  /* Compute char maps. */
1034  /* */
1035 
1036  /* Try to synthesize a Unicode charmap if there is none available */
1037  /* already. If an OpenType font contains a Unicode "cmap", we */
1038  /* will use it, whatever be in the CFF part of the file. */
1039  {
1040  FT_CharMapRec cmaprec;
1041  FT_CharMap cmap;
1042  FT_UInt nn;
1044 
1045 
1046  for ( nn = 0; nn < (FT_UInt)cffface->num_charmaps; nn++ )
1047  {
1048  cmap = cffface->charmaps[nn];
1049 
1050  /* Windows Unicode? */
1051  if ( cmap->platform_id == TT_PLATFORM_MICROSOFT &&
1052  cmap->encoding_id == TT_MS_ID_UNICODE_CS )
1053  goto Skip_Unicode;
1054 
1055  /* Apple Unicode platform id? */
1056  if ( cmap->platform_id == TT_PLATFORM_APPLE_UNICODE )
1057  goto Skip_Unicode; /* Apple Unicode */
1058  }
1059 
1060  /* since CID-keyed fonts don't contain glyph names, we can't */
1061  /* construct a cmap */
1062  if ( pure_cff && cff->top_font.font_dict.cid_registry != 0xFFFFU )
1063  goto Exit;
1064 
1065  /* we didn't find a Unicode charmap -- synthesize one */
1066  cmaprec.face = cffface;
1068  cmaprec.encoding_id = TT_MS_ID_UNICODE_CS;
1069  cmaprec.encoding = FT_ENCODING_UNICODE;
1070 
1071  nn = (FT_UInt)cffface->num_charmaps;
1072 
1074  &cmaprec, NULL );
1075  if ( error &&
1076  FT_ERR_NEQ( error, No_Unicode_Glyph_Name ) )
1077  goto Exit;
1078  error = FT_Err_Ok;
1079 
1080  /* if no Unicode charmap was previously selected, select this one */
1081  if ( !cffface->charmap && nn != (FT_UInt)cffface->num_charmaps )
1082  cffface->charmap = cffface->charmaps[nn];
1083 
1084  Skip_Unicode:
1085  if ( encoding->count > 0 )
1086  {
1087  FT_CMap_Class clazz;
1088 
1089 
1090  cmaprec.face = cffface;
1091  cmaprec.platform_id = TT_PLATFORM_ADOBE; /* Adobe platform id */
1092 
1093  if ( encoding->offset == 0 )
1094  {
1096  cmaprec.encoding = FT_ENCODING_ADOBE_STANDARD;
1098  }
1099  else if ( encoding->offset == 1 )
1100  {
1101  cmaprec.encoding_id = TT_ADOBE_ID_EXPERT;
1102  cmaprec.encoding = FT_ENCODING_ADOBE_EXPERT;
1104  }
1105  else
1106  {
1107  cmaprec.encoding_id = TT_ADOBE_ID_CUSTOM;
1108  cmaprec.encoding = FT_ENCODING_ADOBE_CUSTOM;
1110  }
1111 
1112  error = FT_CMap_New( clazz, NULL, &cmaprec, NULL );
1113  }
1114  }
1115  }
1116 
1117  Exit:
1118  return error;
1119  }
1120 
1121 
1122  FT_LOCAL_DEF( void )
1123  cff_face_done( FT_Face cffface ) /* CFF_Face */
1124  {
1125  CFF_Face face = (CFF_Face)cffface;
1126  FT_Memory memory;
1128 
1129 
1130  if ( !face )
1131  return;
1132 
1133  memory = cffface->memory;
1134  sfnt = (SFNT_Service)face->sfnt;
1135 
1136  if ( sfnt )
1137  sfnt->done_face( face );
1138 
1139  {
1140  CFF_Font cff = (CFF_Font)face->extra.data;
1141 
1142 
1143  if ( cff )
1144  {
1145  cff_font_done( cff );
1146  FT_FREE( face->extra.data );
1147  }
1148  }
1149 
1150 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
1151  cff_done_blend( face );
1152  face->blend = NULL;
1153 #endif
1154  }
1155 
1156 
1158  cff_driver_init( FT_Module module ) /* CFF_Driver */
1159  {
1161 
1162  FT_UInt32 seed;
1163 
1164 
1165  /* set default property values, cf. `ftcffdrv.h' */
1166 #ifdef CFF_CONFIG_OPTION_OLD_ENGINE
1167  driver->hinting_engine = FT_HINTING_FREETYPE;
1168 #else
1169  driver->hinting_engine = FT_HINTING_ADOBE;
1170 #endif
1171 
1172  driver->no_stem_darkening = TRUE;
1173 
1182 
1183  /* compute random seed from some memory addresses */
1184  seed = (FT_UInt32)( (FT_Offset)(char*)&seed ^
1185  (FT_Offset)(char*)&module ^
1186  (FT_Offset)(char*)module->memory );
1187  seed = seed ^ ( seed >> 10 ) ^ ( seed >> 20 );
1188 
1189  driver->random_seed = (FT_Int32)seed;
1190  if ( driver->random_seed < 0 )
1191  driver->random_seed = -driver->random_seed;
1192  else if ( driver->random_seed == 0 )
1193  driver->random_seed = 123456789;
1194 
1195  return FT_Err_Ok;
1196  }
1197 
1198 
1199  FT_LOCAL_DEF( void )
1200  cff_driver_done( FT_Module module ) /* CFF_Driver */
1201  {
1202  FT_UNUSED( module );
1203  }
1204 
1205 
1206 /* END */
FT_Byte num_family_blues
Definition: cfftypes.h:244
cff_font_done(CFF_Font font)
Definition: cffload.c:2499
#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1
Definition: ftoption.h:777
cff_face_init(FT_Stream stream, FT_Face cffface, FT_Int face_index, FT_Int num_params, FT_Parameter *params)
Definition: cffobjs.c:490
#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3
Definition: ftoption.h:783
int FT_Error
Definition: fttypes.h:300
FT_ULong string_pool_size
Definition: cfftypes.h:371
PSH_Globals_Funcs(* get_globals_funcs)(FT_Module module)
Definition: pshints.h:674
FT_DivFix(FT_Long a, FT_Long b)
Definition: ftcalc.c:608
ft_ptrdiff_t FT_PtrDist
Definition: fttypes.h:337
FT_Face face
Definition: freetype.h:842
cff_index_get_name(CFF_Font font, FT_UInt element)
Definition: cffload.c:611
TT_Done_Face_Func done_face
Definition: sfnt.h:568
struct S2 s2
signed long FT_Long
Definition: fttypes.h:242
#define TRUE
Definition: types.h:120
SFNT_Interface * SFNT_Service
Definition: sfnt.h:628
#define ft_strncmp
Definition: ftstdlib.h:89
#define CFF_CMAP_UNICODE_CLASS_REC_GET
Definition: cffpic.h:38
HMODULE module
Definition: main.cpp:47
unsigned long FT_ULong
Definition: fttypes.h:253
FT_UShort encoding_id
Definition: freetype.h:845
#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2
Definition: ftoption.h:781
FT_BEGIN_HEADER typedef signed long FT_Pos
Definition: ftimage.h:58
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define FT_HINTING_FREETYPE
Definition: ftdriver.h:345
#define error(str)
Definition: mkdosfs.c:1605
FT_Long language_group
Definition: t1tables.h:171
CFF_FontRecDictRec font_dict
Definition: cfftypes.h:300
FT_BEGIN_HEADER typedef TT_Face CFF_Face
Definition: cffotypes.h:33
FT_Select_Metrics(FT_Face face, FT_ULong strike_index)
Definition: ftobjs.c:2993
#define TT_ADOBE_ID_STANDARD
Definition: ttnameid.h:281
FT_UInt cid_registry
Definition: cfftypes.h:210
Definition: mk_font.cpp:20
FT_UInt max_cid
Definition: cfftypes.h:101
FT_Pos blue_values[14]
Definition: cfftypes.h:247
#define FT_FACE_FLAG_CID_KEYED
Definition: freetype.h:1250
FT_Pos other_blues[10]
Definition: cfftypes.h:248
signed int FT_Int
Definition: fttypes.h:220
GLuint GLenum matrix
Definition: glext.h:9407
FT_Byte num_snap_heights
Definition: cfftypes.h:259
SFNT_Service sfnt
Definition: ttdriver.c:206
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define FT_ABS(a)
Definition: ftobjs.h:74
FT_Bool is_fixed_pitch
Definition: cfftypes.h:188
cff_size_init(FT_Size cffsize)
Definition: cffobjs.c:165
GLintptr offset
Definition: glext.h:5920
#define FT_FACE_FLAG_SCALABLE
Definition: freetype.h:1238
FT_Byte num_family_other_blues
Definition: t1tables.h:146
GLdouble n
Definition: glext.h:7729
FT_Int blue_fuzz
Definition: t1tables.h:156
FT_Pos blue_shift
Definition: cfftypes.h:253
#define TTAG_CFF
Definition: tttags.h:45
FT_UInt num_subfonts
Definition: cfftypes.h:374
#define FT_MIN(a, b)
Definition: ftobjs.h:71
FT_Byte num_blue_values
Definition: t1tables.h:143
FT_Pos snap_widths[13]
Definition: cfftypes.h:260
#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2
Definition: ftoption.h:780
PSHinter_Interface * PSHinter_Service
Definition: pshints.h:680
#define TT_MS_ID_UNICODE_CS
Definition: font.c:1181
#define FT_FACE_FIND_GLOBAL_SERVICE(face, ptr, id)
Definition: ftserv.h:125
FT_Library library
Definition: cffdrivr.c:654
return FT_Err_Ok
Definition: ftbbox.c:511
#define TTAG_OTTO
Definition: tttags.h:88
static char memory[1024 *256]
Definition: process.c:116
FT_Int lenIV
Definition: t1tables.h:141
static void remove_style(FT_String *family_name, const FT_String *style_name)
Definition: cffobjs.c:447
FT_Fixed blue_scale
Definition: cfftypes.h:252
static void cff_make_private_dict(CFF_SubFont subfont, PS_Private priv)
Definition: cffobjs.c:118
FT_BEGIN_HEADER struct PS_DriverRec_ * PS_Driver
GLuint GLuint GLfloat weight
Definition: glext.h:11719
#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4
Definition: ftoption.h:786
FT_Fixed underline_position
Definition: cfftypes.h:190
cff_font_load(FT_Library library, FT_Stream stream, FT_Int face_index, CFF_Font font, CFF_Face face, FT_Bool pure_cff, FT_Bool cff2)
Definition: cffload.c:2151
FT_Pos blue_fuzz
Definition: cfftypes.h:254
FT_UInt cid_font_name
Definition: cfftypes.h:221
return cff_index_get_sid_string(cff, sid)
#define TT_PLATFORM_MICROSOFT
Definition: font.c:1174
FT_Pos family_blues[14]
Definition: cfftypes.h:249
FT_Byte num_other_blues
Definition: t1tables.h:144
FT_BEGIN_HEADER typedef unsigned char FT_Bool
Definition: fttypes.h:108
FT_Pos standard_width
Definition: cfftypes.h:255
TT_Load_Table_Func load_cmap
Definition: sfnt.h:577
TT_Init_Face_Func init_face
Definition: sfnt.h:566
FT_ULong units_per_em
Definition: cfftypes.h:196
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
FT_Service_PsCMaps psnames
Definition: cfftypes.h:383
FT_Int lenIV
Definition: cfftypes.h:264
FT_Short blue_values[14]
Definition: t1tables.h:148
FT_Pos snap_heights[13]
Definition: cfftypes.h:261
#define FT_ERROR(varformat)
Definition: ftdebug.h:181
cff_driver_done(FT_Module module)
Definition: cffobjs.c:1200
GLenum const GLfloat * params
Definition: glext.h:5645
#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1
Definition: ftoption.h:778
FT_Fixed underline_thickness
Definition: cfftypes.h:191
FT_Fixed blue_scale
Definition: t1tables.h:154
unsigned char FT_Byte
Definition: fttypes.h:154
#define FT_THROW(e)
Definition: ftdebug.h:213
FT_Byte num_family_other_blues
Definition: cfftypes.h:245
#define FT_HINTING_ADOBE
Definition: ftdriver.h:346
#define FT_STYLE_FLAG_BOLD
Definition: freetype.h:1518
const void * cffload
Definition: cfftypes.h:386
#define FT_TRACE4(varformat)
Definition: ftdebug.h:161
#define TT_PLATFORM_APPLE_UNICODE
Definition: font.c:1172
FT_Bool force_bold
Definition: cfftypes.h:262
FT_Bool has_font_matrix
Definition: cfftypes.h:195
FT_Int language_group
Definition: cfftypes.h:265
struct @1605::@1606 driver
unsigned int idx
Definition: utils.c:41
CFF_IndexRec charstrings_index
Definition: cfftypes.h:357
FT_Short other_blues[10]
Definition: t1tables.h:149
#define TT_ADOBE_ID_CUSTOM
Definition: ttnameid.h:283
FT_UShort standard_height[1]
Definition: t1tables.h:159
smooth NULL
Definition: ftsmooth.c:416
FT_Pos yMax
Definition: ftimage.h:118
FT_UInt family_name
Definition: cfftypes.h:186
PSHinter_Service pshinter
Definition: cfftypes.h:380
FT_Fixed italic_angle
Definition: cfftypes.h:189
CFF_Font cff
Definition: cffdrivr.c:695
#define FT_FREE(ptr)
Definition: ftmemory.h:329
CFF_PrivateRec private_dict
Definition: cfftypes.h:301
#define FT_FACE_FLAG_SFNT
Definition: freetype.h:1241
#define FT_FACE_FLAG_FIXED_WIDTH
Definition: freetype.h:1240
cff_driver_init(FT_Module module)
Definition: cffobjs.c:1158
#define FT_LOCAL_DEF(x)
Definition: ftconfig.h:388
#define TTAG_CFF2
Definition: tttags.h:46
FT_Short snap_widths[13]
Definition: t1tables.h:166
FT_Request_Metrics(FT_Face face, FT_Size_Request req)
Definition: ftobjs.c:3028
r l[0]
Definition: byte_order.h:167
FT_MulDiv(FT_Long a, FT_Long b, FT_Long c)
Definition: ftcalc.c:416
#define TT_ADOBE_ID_EXPERT
Definition: ttnameid.h:282
char FT_String
Definition: fttypes.h:187
FT_UShort standard_width[1]
Definition: t1tables.h:158
GLsizeiptr size
Definition: glext.h:5919
#define FT_ZERO(p)
Definition: ftmemory.h:237
#define FT_HAS_FIXED_SIZES(face)
Definition: freetype.h:1361
#define FT_FACE_FLAG_HORIZONTAL
Definition: freetype.h:1242
FT_Pos xMin
Definition: ftimage.h:117
if(!(yy_init))
Definition: macro.lex.yy.c:714
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
struct PSAux_ServiceRec_ * PSAux_Service
struct S1 s1
static void Exit(void)
Definition: sock.c:1331
FT_UInt num_faces
Definition: cfftypes.h:339
#define FT_TRACE2(varformat)
Definition: ftdebug.h:159
#define TT_PLATFORM_ADOBE
Definition: ttnameid.h:91
#define FT_ERR_EQ(x, e)
Definition: fttypes.h:591
FT_Matrix font_matrix
Definition: cfftypes.h:194
FT_Pos xMax
Definition: ftimage.h:118
static struct __wine_debug_functions funcs
Definition: debug.c:59
TT_Set_SBit_Strike_Func set_sbit_strike
Definition: sfnt.h:616
FT_Byte num_snap_widths
Definition: cfftypes.h:258
cff_slot_init(FT_GlyphSlot slot)
Definition: cffobjs.c:358
#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4
Definition: ftoption.h:787
FT_ULong strike_index
Definition: cffotypes.h:47
GLbitfield flags
Definition: glext.h:7161
#define FT_ERR_NEQ(x, e)
Definition: fttypes.h:593
FT_Encoding encoding
Definition: freetype.h:843
Definition: parse.h:22
signed short FT_Short
Definition: fttypes.h:198
FT_Byte num_other_blues
Definition: cfftypes.h:243
FT_Byte num_family_blues
Definition: t1tables.h:145
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
GLdouble s
Definition: gl.h:2039
#define FT_FACE_FLAG_HINTER
Definition: freetype.h:1249
FT_Short family_other_blues[10]
Definition: t1tables.h:152
FT_FaceRec root
Definition: tttypes.h:1393
FT_UInt num_strings
Definition: cfftypes.h:368
FT_Vector_Transform_Scaled(FT_Vector *vector, const FT_Matrix *matrix, FT_Long scaling)
Definition: ftcalc.c:751
#define FT_STREAM_SEEK(position)
Definition: ftstream.h:489
FT_Pos standard_height
Definition: cfftypes.h:256
ed encoding
Definition: write.c:2839
Definition: vfat.h:184
TT_Load_Face_Func load_face
Definition: sfnt.h:567
struct CFF_FontRec_ * CFF_Font
Definition: cfftypes.h:152
FT_CMap_New(FT_CMap_Class clazz, FT_Pointer init_data, FT_CharMap charmap, FT_CMap *acmap)
Definition: ftobjs.c:3614
FT_Byte num_snap_widths
Definition: t1tables.h:161
#define FT_HAS_MULTIPLE_MASTERS(face)
Definition: freetype.h:1402
FT_UInt num_glyphs
Definition: cfftypes.h:340
#define CFF_CMAP_ENCODING_CLASS_REC_GET
Definition: cffpic.h:37
FT_UShort platform_id
Definition: freetype.h:844
signed long FT_Fixed
Definition: fttypes.h:288
T2_Hints_Funcs(* get_t2_funcs)(FT_Module module)
Definition: pshints.h:676
static calc_node_t temp
Definition: rpn_ieee.c:38
unsigned int FT_UInt
Definition: fttypes.h:231
cff_slot_done(FT_GlyphSlot slot)
Definition: cffobjs.c:351
static PSH_Globals_Funcs cff_size_get_globals_funcs(CFF_Size size)
Definition: cffobjs.c:66
FT_Byte num_snap_heights
Definition: t1tables.h:162
static FT_String * cff_strcpy(FT_Memory memory, const FT_String *source)
Definition: cffobjs.c:393
FT_Pos yMin
Definition: ftimage.h:117
CFF_EncodingRec encoding
Definition: cfftypes.h:354
FT_Matrix_Multiply_Scaled(const FT_Matrix *a, FT_Matrix *b, FT_Long scaling)
Definition: ftcalc.c:720
#define FT_FACE_FLAG_KERNING
Definition: freetype.h:1244
ios_base &_STLP_CALL internal(ios_base &__s)
Definition: _ios_base.h:311
FT_Get_Module(FT_Library library, const char *module_name)
Definition: ftobjs.c:4837
FT_Int blue_shift
Definition: t1tables.h:155
CFF_SubFont subfonts[CFF_MAX_CID_FONTS]
Definition: cfftypes.h:375
cff_size_done(FT_Size cffsize)
Definition: cffobjs.c:83
Definition: name.c:36
#define TTAG_head
Definition: tttags.h:67
struct CFF_InternalRec_ * CFF_Internal
FT_Short snap_heights[13]
Definition: t1tables.h:167
FT_Get_Module_Interface(FT_Library library, const char *mod_name)
Definition: ftobjs.c:4865
cff_size_request(FT_Size size, FT_Size_Request req)
Definition: cffobjs.c:275
#define FT_STRDUP(dst, str)
Definition: ftmemory.h:364
#define FT_NEW(ptr)
Definition: ftmemory.h:331
FT_Byte ** strings
Definition: cfftypes.h:369
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
T1_FIELD_DICT_FONTDICT family_name
Definition: t1tokens.h:30
#define FT_STYLE_FLAG_ITALIC
Definition: freetype.h:1517
static void remove_subset_prefix(FT_String *name)
Definition: cffobjs.c:413
unsigned short FT_UShort
Definition: fttypes.h:209
cff_face_done(FT_Face cffface)
Definition: cffobjs.c:1123
FT_Pos family_other_blues[10]
Definition: cfftypes.h:250
struct CFF_SizeRec_ * CFF_Size
#define FT_FACE_FLAG_GLYPH_NAMES
Definition: freetype.h:1247
GLuint64EXT * result
Definition: glext.h:11304
#define FT_UNUSED(arg)
Definition: ftconfig.h:101
CFF_CharsetRec charset
Definition: cfftypes.h:355
#define UL
Definition: tui.h:83
#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3
Definition: ftoption.h:784
FT_Vector font_offset
Definition: cfftypes.h:197
#define ft_strlen
Definition: ftstdlib.h:88
FT_Bool force_bold
Definition: t1tables.h:163
FT_Short family_blues[14]
Definition: t1tables.h:151
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
FT_Byte * string_pool
Definition: cfftypes.h:370
FT_Byte num_blue_values
Definition: cfftypes.h:242
size_t FT_Offset
Definition: fttypes.h:324
CFF_SubFontRec top_font
Definition: cfftypes.h:373
#define ft_strcmp
Definition: ftstdlib.h:86