Visualization Library 2.0.0-b5

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
cffdrivr.c
Go to the documentation of this file.
1 /***************************************************************************/
2 /* */
3 /* cffdrivr.c */
4 /* */
5 /* OpenType font driver implementation (body). */
6 /* */
7 /* Copyright 1996-2013 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 #include FT_FREETYPE_H
21 #include FT_INTERNAL_DEBUG_H
22 #include FT_INTERNAL_STREAM_H
23 #include FT_INTERNAL_SFNT_H
24 #include FT_SERVICE_CID_H
25 #include FT_SERVICE_POSTSCRIPT_INFO_H
26 #include FT_SERVICE_POSTSCRIPT_NAME_H
27 #include FT_SERVICE_TT_CMAP_H
28 
29 #include "cffdrivr.h"
30 #include "cffgload.h"
31 #include "cffload.h"
32 #include "cffcmap.h"
33 #include "cffparse.h"
34 
35 #include "cfferrs.h"
36 #include "cffpic.h"
37 
38 #include FT_SERVICE_XFREE86_NAME_H
39 #include FT_SERVICE_GLYPH_DICT_H
40 #include FT_SERVICE_PROPERTIES_H
41 
42 
43  /*************************************************************************/
44  /* */
45  /* The macro FT_COMPONENT is used in trace mode. It is an implicit */
46  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
47  /* messages during execution. */
48  /* */
49 #undef FT_COMPONENT
50 #define FT_COMPONENT trace_cffdriver
51 
52 
53  /*************************************************************************/
54  /*************************************************************************/
55  /*************************************************************************/
56  /**** ****/
57  /**** ****/
58  /**** F A C E S ****/
59  /**** ****/
60  /**** ****/
61  /*************************************************************************/
62  /*************************************************************************/
63  /*************************************************************************/
64 
65 
66 #undef PAIR_TAG
67 #define PAIR_TAG( left, right ) ( ( (FT_ULong)left << 16 ) | \
68  (FT_ULong)right )
69 
70 
71  /*************************************************************************/
72  /* */
73  /* <Function> */
74  /* cff_get_kerning */
75  /* */
76  /* <Description> */
77  /* A driver method used to return the kerning vector between two */
78  /* glyphs of the same face. */
79  /* */
80  /* <Input> */
81  /* face :: A handle to the source face object. */
82  /* */
83  /* left_glyph :: The index of the left glyph in the kern pair. */
84  /* */
85  /* right_glyph :: The index of the right glyph in the kern pair. */
86  /* */
87  /* <Output> */
88  /* kerning :: The kerning vector. This is in font units for */
89  /* scalable formats, and in pixels for fixed-sizes */
90  /* formats. */
91  /* */
92  /* <Return> */
93  /* FreeType error code. 0 means success. */
94  /* */
95  /* <Note> */
96  /* Only horizontal layouts (left-to-right & right-to-left) are */
97  /* supported by this function. Other layouts, or more sophisticated */
98  /* kernings, are out of scope of this method (the basic driver */
99  /* interface is meant to be simple). */
100  /* */
101  /* They can be implemented by format-specific interfaces. */
102  /* */
104  cff_get_kerning( FT_Face ttface, /* TT_Face */
105  FT_UInt left_glyph,
106  FT_UInt right_glyph,
107  FT_Vector* kerning )
108  {
109  TT_Face face = (TT_Face)ttface;
110  SFNT_Service sfnt = (SFNT_Service)face->sfnt;
111 
112 
113  kerning->x = 0;
114  kerning->y = 0;
115 
116  if ( sfnt )
117  kerning->x = sfnt->get_kerning( face, left_glyph, right_glyph );
118 
119  return FT_Err_Ok;
120  }
121 
122 
123 #undef PAIR_TAG
124 
125 
126  /*************************************************************************/
127  /* */
128  /* <Function> */
129  /* cff_glyph_load */
130  /* */
131  /* <Description> */
132  /* A driver method used to load a glyph within a given glyph slot. */
133  /* */
134  /* <Input> */
135  /* slot :: A handle to the target slot object where the glyph */
136  /* will be loaded. */
137  /* */
138  /* size :: A handle to the source face size at which the glyph */
139  /* must be scaled, loaded, etc. */
140  /* */
141  /* glyph_index :: The index of the glyph in the font file. */
142  /* */
143  /* load_flags :: A flag indicating what to load for this glyph. The */
144  /* FT_LOAD_??? constants can be used to control the */
145  /* glyph loading process (e.g., whether the outline */
146  /* should be scaled, whether to load bitmaps or not, */
147  /* whether to hint the outline, etc). */
148  /* */
149  /* <Return> */
150  /* FreeType error code. 0 means success. */
151  /* */
153  cff_glyph_load( FT_GlyphSlot cffslot, /* CFF_GlyphSlot */
154  FT_Size cffsize, /* CFF_Size */
155  FT_UInt glyph_index,
156  FT_Int32 load_flags )
157  {
158  FT_Error error;
159  CFF_GlyphSlot slot = (CFF_GlyphSlot)cffslot;
160  CFF_Size size = (CFF_Size)cffsize;
161 
162 
163  if ( !slot )
164  return FT_THROW( Invalid_Slot_Handle );
165 
166  /* check whether we want a scaled outline or bitmap */
167  if ( !size )
168  load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING;
169 
170  /* reset the size object if necessary */
171  if ( load_flags & FT_LOAD_NO_SCALE )
172  size = NULL;
173 
174  if ( size )
175  {
176  /* these two objects must have the same parent */
177  if ( cffsize->face != cffslot->face )
178  return FT_THROW( Invalid_Face_Handle );
179  }
180 
181  /* now load the glyph outline if necessary */
182  error = cff_slot_load( slot, size, glyph_index, load_flags );
183 
184  /* force drop-out mode to 2 - irrelevant now */
185  /* slot->outline.dropout_mode = 2; */
186 
187  return error;
188  }
189 
190 
193  FT_UInt start,
194  FT_UInt count,
195  FT_Int32 flags,
196  FT_Fixed* advances )
197  {
198  FT_UInt nn;
200  FT_GlyphSlot slot = face->glyph;
201 
202 
204 
205  for ( nn = 0; nn < count; nn++ )
206  {
207  error = cff_glyph_load( slot, face->size, start + nn, flags );
208  if ( error )
209  break;
210 
211  advances[nn] = ( flags & FT_LOAD_VERTICAL_LAYOUT )
212  ? slot->linearVertAdvance
213  : slot->linearHoriAdvance;
214  }
215 
216  return error;
217  }
218 
219 
220  /*
221  * GLYPH DICT SERVICE
222  *
223  */
224 
225  static FT_Error
226  cff_get_glyph_name( CFF_Face face,
227  FT_UInt glyph_index,
229  FT_UInt buffer_max )
230  {
231  CFF_Font font = (CFF_Font)face->extra.data;
232  FT_String* gname;
233  FT_UShort sid;
234  FT_Error error;
235 
236 
237  if ( !font->psnames )
238  {
239  FT_ERROR(( "cff_get_glyph_name:"
240  " cannot get glyph name from CFF & CEF fonts\n"
241  " "
242  " without the `PSNames' module\n" ));
243  error = FT_THROW( Missing_Module );
244  goto Exit;
245  }
246 
247  /* first, locate the sid in the charset table */
248  sid = font->charset.sids[glyph_index];
249 
250  /* now, lookup the name itself */
251  gname = cff_index_get_sid_string( font, sid );
252 
253  if ( gname )
254  FT_STRCPYN( buffer, gname, buffer_max );
255 
256  error = FT_Err_Ok;
257 
258  Exit:
259  return error;
260  }
261 
262 
263  static FT_UInt
264  cff_get_name_index( CFF_Face face,
265  FT_String* glyph_name )
266  {
267  CFF_Font cff;
269  FT_Service_PsCMaps psnames;
270  FT_String* name;
271  FT_UShort sid;
272  FT_UInt i;
273 
274 
275  cff = (CFF_FontRec *)face->extra.data;
276  charset = &cff->charset;
277 
278  FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS );
279  if ( !psnames )
280  return 0;
281 
282  for ( i = 0; i < cff->num_glyphs; i++ )
283  {
284  sid = charset->sids[i];
285 
286  if ( sid > 390 )
287  name = cff_index_get_string( cff, sid - 391 );
288  else
289  name = (FT_String *)psnames->adobe_std_strings( sid );
290 
291  if ( !name )
292  continue;
293 
294  if ( !ft_strcmp( glyph_name, name ) )
295  return i;
296  }
297 
298  return 0;
299  }
300 
301 
303  cff_service_glyph_dict,
304  (FT_GlyphDict_GetNameFunc) cff_get_glyph_name,
305  (FT_GlyphDict_NameIndexFunc)cff_get_name_index
306  )
307 
308 
309  /*
310  * POSTSCRIPT INFO SERVICE
311  *
312  */
313 
314  static FT_Int
315  cff_ps_has_glyph_names( FT_Face face )
316  {
317  return ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES ) > 0;
318  }
319 
320 
321  static FT_Error
322  cff_ps_get_font_info( CFF_Face face,
323  PS_FontInfoRec* afont_info )
324  {
325  CFF_Font cff = (CFF_Font)face->extra.data;
327 
328 
329  if ( cff && cff->font_info == NULL )
330  {
331  CFF_FontRecDict dict = &cff->top_font.font_dict;
332  PS_FontInfoRec *font_info = NULL;
333  FT_Memory memory = face->root.memory;
334 
335 
336  if ( FT_ALLOC( font_info, sizeof ( *font_info ) ) )
337  goto Fail;
338 
339  font_info->version = cff_index_get_sid_string( cff,
340  dict->version );
341  font_info->notice = cff_index_get_sid_string( cff,
342  dict->notice );
343  font_info->full_name = cff_index_get_sid_string( cff,
344  dict->full_name );
345  font_info->family_name = cff_index_get_sid_string( cff,
346  dict->family_name );
347  font_info->weight = cff_index_get_sid_string( cff,
348  dict->weight );
349  font_info->italic_angle = dict->italic_angle;
350  font_info->is_fixed_pitch = dict->is_fixed_pitch;
351  font_info->underline_position = (FT_Short)dict->underline_position;
352  font_info->underline_thickness = (FT_Short)dict->underline_thickness;
353 
354  cff->font_info = font_info;
355  }
356 
357  if ( cff )
358  *afont_info = *cff->font_info;
359 
360  Fail:
361  return error;
362  }
363 
364 
366  cff_service_ps_info,
367  (PS_GetFontInfoFunc) cff_ps_get_font_info,
369  (PS_HasGlyphNamesFunc) cff_ps_has_glyph_names,
370  (PS_GetFontPrivateFunc)NULL, /* unsupported with CFF fonts */
371  (PS_GetFontValueFunc) NULL /* not implemented */
372  )
373 
374 
375  /*
376  * POSTSCRIPT NAME SERVICE
377  *
378  */
379 
380  static const char*
381  cff_get_ps_name( CFF_Face face )
382  {
383  CFF_Font cff = (CFF_Font)face->extra.data;
384 
385 
386  return (const char*)cff->font_name;
387  }
388 
389 
391  cff_service_ps_name,
392  (FT_PsName_GetFunc)cff_get_ps_name
393  )
394 
395 
396  /*
397  * TT CMAP INFO
398  *
399  * If the charmap is a synthetic Unicode encoding cmap or
400  * a Type 1 standard (or expert) encoding cmap, hide TT CMAP INFO
401  * service defined in SFNT module.
402  *
403  * Otherwise call the service function in the sfnt module.
404  *
405  */
406  static FT_Error
407  cff_get_cmap_info( FT_CharMap charmap,
409  {
410  FT_CMap cmap = FT_CMAP( charmap );
412 
413  FT_Face face = FT_CMAP_FACE( cmap );
415 
416 
417  cmap_info->language = 0;
418  cmap_info->format = 0;
419 
422  {
423  FT_Module sfnt = FT_Get_Module( library, "sfnt" );
424  FT_Service_TTCMaps service =
425  (FT_Service_TTCMaps)ft_module_get_service( sfnt,
427 
428 
429  if ( service && service->get_cmap_info )
430  error = service->get_cmap_info( charmap, cmap_info );
431  }
432 
433  return error;
434  }
435 
436 
438  cff_service_get_cmap_info,
439  (TT_CMap_Info_GetFunc)cff_get_cmap_info
440  )
441 
442 
443  /*
444  * CID INFO SERVICE
445  *
446  */
447  static FT_Error
448  cff_get_ros( CFF_Face face,
449  const char* *registry,
450  const char* *ordering,
451  FT_Int *supplement )
452  {
453  FT_Error error = FT_Err_Ok;
455 
456 
457  if ( cff )
458  {
459  CFF_FontRecDict dict = &cff->top_font.font_dict;
460 
461 
462  if ( dict->cid_registry == 0xFFFFU )
463  {
464  error = FT_THROW( Invalid_Argument );
465  goto Fail;
466  }
467 
468  if ( registry )
469  {
470  if ( cff->registry == NULL )
472  dict->cid_registry );
473  *registry = cff->registry;
474  }
475 
476  if ( ordering )
477  {
478  if ( cff->ordering == NULL )
480  dict->cid_ordering );
481  *ordering = cff->ordering;
482  }
483 
484  /*
485  * XXX: According to Adobe TechNote #5176, the supplement in CFF
486  * can be a real number. We truncate it to fit public API
487  * since freetype-2.3.6.
488  */
489  if ( supplement )
490  {
491  if ( dict->cid_supplement < FT_INT_MIN ||
492  dict->cid_supplement > FT_INT_MAX )
493  FT_TRACE1(( "cff_get_ros: too large supplement %d is truncated\n",
494  dict->cid_supplement ));
495  *supplement = (FT_Int)dict->cid_supplement;
496  }
497  }
498 
499  Fail:
500  return error;
501  }
502 
503 
504  static FT_Error
505  cff_get_is_cid( CFF_Face face,
506  FT_Bool *is_cid )
507  {
508  FT_Error error = FT_Err_Ok;
509  CFF_Font cff = (CFF_Font)face->extra.data;
510 
511 
512  *is_cid = 0;
513 
514  if ( cff )
515  {
516  CFF_FontRecDict dict = &cff->top_font.font_dict;
517 
518 
519  if ( dict->cid_registry != 0xFFFFU )
520  *is_cid = 1;
521  }
522 
523  return error;
524  }
525 
526 
527  static FT_Error
528  cff_get_cid_from_glyph_index( CFF_Face face,
529  FT_UInt glyph_index,
530  FT_UInt *cid )
531  {
532  FT_Error error = FT_Err_Ok;
533  CFF_Font cff;
534 
535 
536  cff = (CFF_Font)face->extra.data;
537 
538  if ( cff )
539  {
540  FT_UInt c;
541  CFF_FontRecDict dict = &cff->top_font.font_dict;
542 
543 
544  if ( dict->cid_registry == 0xFFFFU )
545  {
546  error = FT_THROW( Invalid_Argument );
547  goto Fail;
548  }
549 
550  if ( glyph_index > cff->num_glyphs )
551  {
552  error = FT_THROW( Invalid_Argument );
553  goto Fail;
554  }
555 
556  c = cff->charset.sids[glyph_index];
557 
558  if ( cid )
559  *cid = c;
560  }
561 
562  Fail:
563  return error;
564  }
565 
566 
568  cff_service_cid_info,
570  (FT_CID_GetIsInternallyCIDKeyedFunc) cff_get_is_cid,
571  (FT_CID_GetCIDFromGlyphIndexFunc) cff_get_cid_from_glyph_index
572  )
573 
574 
575  /*
576  * PROPERTY SERVICE
577  *
578  */
579  static FT_Error
580  cff_property_set( FT_Module module, /* CFF_Driver */
581  const char* property_name,
582  const void* value )
583  {
584  FT_Error error = FT_Err_Ok;
586 
587 
588  if ( !ft_strcmp( property_name, "hinting-engine" ) )
589  {
590  FT_UInt* hinting_engine = (FT_UInt*)value;
591 
592 
593  driver->hinting_engine = *hinting_engine;
594 
595  return error;
596  }
597  else if ( !ft_strcmp( property_name, "no-stem-darkening" ) )
598  {
599  FT_Bool* no_stem_darkening = (FT_Bool*)value;
600 
601 
602  driver->no_stem_darkening = *no_stem_darkening;
603 
604  return error;
605  }
606 
607  FT_TRACE0(( "cff_property_set: missing property `%s'\n",
608  property_name ));
609  return FT_THROW( Missing_Property );
610  }
611 
612 
613  static FT_Error
614  cff_property_get( FT_Module module, /* CFF_Driver */
615  const char* property_name,
616  const void* value )
617  {
618  FT_Error error = FT_Err_Ok;
619  CFF_Driver driver = (CFF_Driver)module;
620 
621  FT_UInt hinting_engine = driver->hinting_engine;
622  FT_Bool no_stem_darkening = driver->no_stem_darkening;
623 
624 
625  if ( !ft_strcmp( property_name, "hinting-engine" ) )
626  {
627  FT_UInt* val = (FT_UInt*)value;
628 
629 
630  *val = hinting_engine;
631 
632  return error;
633  }
634  else if ( !ft_strcmp( property_name, "no-stem-darkening" ) )
635  {
636  FT_Bool* val = (FT_Bool*)value;
637 
638 
639  *val = no_stem_darkening;
640 
641  return error;
642  }
643 
644  FT_TRACE0(( "cff_property_get: missing property `%s'\n",
645  property_name ));
646  return FT_THROW( Missing_Property );
647  }
648 
649 
651  cff_service_properties,
652  (FT_Properties_SetFunc)cff_property_set,
653  (FT_Properties_GetFunc)cff_property_get )
654 
655 
656  /*************************************************************************/
657  /*************************************************************************/
658  /*************************************************************************/
659  /**** ****/
660  /**** ****/
661  /**** D R I V E R I N T E R F A C E ****/
662  /**** ****/
663  /**** ****/
664  /*************************************************************************/
665  /*************************************************************************/
666  /*************************************************************************/
667 
668 #ifndef FT_CONFIG_OPTION_NO_GLYPH_NAMES
670  cff_services,
678  )
679 #else
681  cff_services,
688  )
689 #endif
690 
691 
693  cff_get_interface( FT_Module driver, /* CFF_Driver */
694  const char* module_interface )
695  {
697  FT_Module sfnt;
699 
700 
701  /* CFF_SERVICES_GET derefers `library' in PIC mode */
702 #ifdef FT_CONFIG_OPTION_PIC
703  if ( !driver )
704  return NULL;
705  library = driver->library;
706  if ( !library )
707  return NULL;
708 #endif
709 
710  result = ft_service_list_lookup( CFF_SERVICES_GET, module_interface );
711  if ( result != NULL )
712  return result;
713 
714  /* `driver' is not yet evaluated in non-PIC mode */
715 #ifndef FT_CONFIG_OPTION_PIC
716  if ( !driver )
717  return NULL;
718  library = driver->library;
719  if ( !library )
720  return NULL;
721 #endif
722 
723  /* we pass our request to the `sfnt' module */
724  sfnt = FT_Get_Module( library, "sfnt" );
725 
726  return sfnt ? sfnt->clazz->get_interface( sfnt, module_interface ) : 0;
727  }
728 
729 
730  /* The FT_DriverInterface structure is defined in ftdriver.h. */
731 
732 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
733 #define CFF_SIZE_SELECT cff_size_select
734 #else
735 #define CFF_SIZE_SELECT 0
736 #endif
737 
739  cff_driver_class,
740 
744 
745  sizeof ( CFF_DriverRec ),
746  "cff",
747  0x10000L,
748  0x20000L,
749 
750  0, /* module-specific interface */
751 
755 
756  /* now the specific driver fields */
757  sizeof ( TT_FaceRec ),
758  sizeof ( CFF_SizeRec ),
759  sizeof ( CFF_GlyphSlotRec ),
760 
767 
768  ft_stub_set_char_sizes, /* FT_CONFIG_OPTION_OLD_INTERNALS */
769  ft_stub_set_pixel_sizes, /* FT_CONFIG_OPTION_OLD_INTERNALS */
770 
772 
774  0, /* FT_Face_AttachFunc */
776 
778 
780  )
781 
782 
783 /* END */
#define FT_ALLOC(ptr, size)
Definition: ftmemory.h:260
FT_DEFINE_SERVICE_PROPERTIESREC(cff_service_properties,(FT_Properties_SetFunc) cff_property_set,(FT_Properties_GetFunc) cff_property_get) FT_DEFINE_SERVICEDESCREC7(cff_services
FT_String * registry
Definition: cfftypes.h:270
cff_face_init(FT_Stream stream, FT_Face cffface, FT_Int face_index, FT_Int num_params, FT_Parameter *params)
Definition: cffobjs.c:482
ft_service_list_lookup(FT_ServiceDesc service_descriptors, const char *service_id)
Definition: ftobjs.c:58
int FT_Error
Definition: fttypes.h:296
#define FT_LOAD_VERTICAL_LAYOUT
Definition: freetype.h:2553
void * sfnt
Definition: tttypes.h:1298
FT_SERVICE_ID_TT_CMAP
Definition: cffdrivr.c:671
SFNT_Interface * SFNT_Service
Definition: sfnt.h:754
#define CFF_CMAP_UNICODE_CLASS_REC_GET
Definition: cffpic.h:38
FT_Error(* FT_CID_GetIsInternallyCIDKeyedFunc)(FT_Face face, FT_Bool *is_cid)
Definition: svcid.h:35
CFF_Charset charset
Definition: cffcmap.c:129
#define FT_CMAP_FACE(x)
Definition: ftobjs.h:145
FT_SERVICE_ID_POSTSCRIPT_INFO
Definition: cffdrivr.c:671
#define NULL
Definition: ftobjs.h:61
signed int FT_Int
Definition: fttypes.h:216
FT_String * ordering
Definition: cfftypes.h:271
& CFF_SERVICE_PS_NAME_GET
Definition: cffdrivr.c:671
FT_Module_Class * clazz
Definition: ftobjs.h:475
FT_Fixed underline_position
Definition: cfftypes.h:115
cff_size_init(FT_Size cffsize)
Definition: cffobjs.c:157
#define FT_LOAD_NO_HINTING
Definition: freetype.h:2550
FT_SERVICE_ID_GLYPH_DICT
Definition: cffdrivr.c:671
return FT_THROW(Missing_Property)
cff_index_get_string(CFF_Font font, FT_UInt element)
Definition: cffload.c:612
FT_UInt sid
Definition: cffcmap.c:130
PS_FontInfoRec * font_info
Definition: cfftypes.h:267
struct CFF_FontRec_ * CFF_Font
GLuint start
unsigned int FT_UInt32
Definition: ftconfig.h:133
FT_Fixed linearHoriAdvance
Definition: freetype.h:1621
FT_Long cid_supplement
Definition: cfftypes.h:137
#define FT_FACE_FIND_GLOBAL_SERVICE(face, ptr, id)
Definition: ftserv.h:133
FT_Library library
Definition: cffdrivr.c:414
#define FT_MODULE_DRIVER_SCALABLE
Definition: ftmodapi.h:87
FT_Fixed underline_thickness
Definition: cfftypes.h:116
FT_SERVICE_ID_XF86_NAME
Definition: cffdrivr.c:671
cff_get_advances(FT_Face face, FT_UInt start, FT_UInt count, FT_Int32 flags, FT_Fixed *advances)
Definition: cffdrivr.c:192
return FT_Err_Ok
Definition: ftbbox.c:645
#define FT_LOAD_ADVANCE_ONLY
Definition: freetype.h:2567
return cff_index_get_sid_string(cff, sid)
png_uint_32 i
Definition: png.h:2640
#define FT_CMAP(x)
Definition: ftobjs.h:139
FT_BEGIN_HEADER typedef unsigned char FT_Bool
Definition: fttypes.h:104
#define FT_LOAD_NO_SCALE
Definition: freetype.h:2549
FT_Service_PsCMaps psnames
Definition: cfftypes.h:264
FT_DEFINE_SERVICE_PSINFOREC(cff_service_ps_info,(PS_GetFontInfoFunc) cff_ps_get_font_info,(PS_GetFontExtraFunc) NULL,(PS_HasGlyphNamesFunc) cff_ps_has_glyph_names,(PS_GetFontPrivateFunc) NULL,(PS_GetFontValueFunc) NULL) static const char *cff_get_ps_name(CFF_Face face)
Definition: cffdrivr.c:365
FT_DEFINE_SERVICE_GLYPHDICTREC(cff_service_glyph_dict,(FT_GlyphDict_GetNameFunc) cff_get_glyph_name,(FT_GlyphDict_NameIndexFunc) cff_get_name_index) static FT_Int cff_ps_has_glyph_names(FT_Face face)
Definition: cffdrivr.c:302
& CFF_SERVICE_GET_CMAP_INFO_GET
Definition: cffdrivr.c:671
#define FT_TRACE1(varformat)
Definition: ftdebug.h:158
GLenum GLuint GLint GLenum face
FT_XF86_FORMAT_CFF
Definition: cffdrivr.c:671
#define const
Definition: zconf.h:91
TT_CMapInfo * cmap_info
Definition: cffdrivr.c:409
#define FT_ERROR(varformat)
Definition: ftdebug.h:181
cff_driver_done(FT_Module module)
Definition: cffobjs.c:1067
struct CFF_GlyphSlotRec_ * CFF_GlyphSlot
#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_, old_set_char_sizes_, old_set_pixel_sizes_, load_glyph_, get_kerning_, attach_file_, get_advances_, request_size_, select_size_)
Definition: ftdriver.h:293
CFF_FontRecDictRec font_dict
Definition: cfftypes.h:207
#define FT_MODULE_DRIVER_HAS_HINTER
Definition: ftmodapi.h:91
CFF_Font cff
Definition: cffdrivr.c:454
FT_DEFINE_SERVICE_CIDREC(cff_service_cid_info,(FT_CID_GetRegistryOrderingSupplementFunc) cff_get_ros,(FT_CID_GetIsInternallyCIDKeyedFunc) cff_get_is_cid,(FT_CID_GetCIDFromGlyphIndexFunc) cff_get_cid_from_glyph_index) static FT_Error cff_property_set(FT_Module module
const char ** registry
Definition: cffdrivr.c:449
ft_module_get_service(FT_Module module, const char *service_id)
Definition: ftobjs.c:4352
cff_driver_init(FT_Module module)
Definition: cffobjs.c:1053
TT_CMap_Info_GetFunc tt_get_cmap_info const char * module_interface
Definition: sfdriver.c:429
struct TT_FaceRec_ * TT_Face
Definition: tttypes.h:951
FT_Long(* PS_GetFontValueFunc)(FT_Face face, PS_Dict_Keys key, FT_UInt idx, void *value, FT_Long value_len)
Definition: svpsinfo.h:48
cff_glyph_load(FT_GlyphSlot cffslot, FT_Size cffsize, FT_UInt glyph_index, FT_Int32 load_flags)
Definition: cffdrivr.c:153
FT_Error(* FT_CID_GetRegistryOrderingSupplementFunc)(FT_Face face, const char **registry, const char **ordering, FT_Int *supplement)
Definition: svcid.h:30
TT_Face_GetKerningFunc get_kerning
Definition: sfnt.h:733
& CFF_SERVICE_GLYPH_DICT_GET
Definition: cffdrivr.c:671
#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:256
FT_Error error
Definition: cffdrivr.c:411
FT_UInt(* FT_GlyphDict_NameIndexFunc)(FT_Face face, FT_String *glyph_name)
Definition: svgldict.h:44
char FT_String
Definition: fttypes.h:183
void * FT_Pointer
Definition: fttypes.h:307
FT_UInt family_name
Definition: cfftypes.h:111
GLbitfield flags
#define FT_INT_MIN
Definition: ftstdlib.h:65
FT_DEFINE_SERVICE_PSFONTNAMEREC(cff_service_ps_name,(FT_PsName_GetFunc) cff_get_ps_name) static FT_Error cff_get_cmap_info(FT_CharMap charmap
CFF_SubFontRec top_font
Definition: cfftypes.h:254
FT_Pointer FT_Module_Interface
Definition: ftmodapi.h:106
GLuint GLfloat * val
& CFF_SERVICE_CID_INFO_GET
Definition: cffdrivr.c:671
GLuint buffer
const GLubyte * c
signed int FT_Int32
Definition: ftconfig.h:132
cff_slot_init(FT_GlyphSlot slot)
Definition: cffobjs.c:350
#define FT_CALLBACK_DEF(x)
Definition: ftconfig.h:323
#define CFF_SERVICES_GET
Definition: cffpic.h:36
FT_Long format
Definition: svttcmap.h:62
#define FT_MODULE_FONT_DRIVER
Definition: ftmodapi.h:82
cff_slot_load(CFF_GlyphSlot glyph, CFF_Size size, FT_UInt glyph_index, FT_Int32 load_flags)
Definition: cffgload.c:2598
FT_SERVICE_ID_POSTSCRIPT_FONT_NAME
Definition: cffdrivr.c:671
FT_SERVICE_ID_CID
Definition: cffdrivr.c:671
struct CFF_SizeRec_ * CFF_Size
GLsizei const GLfloat * value
cff_get_kerning(FT_Face ttface, FT_UInt left_glyph, FT_UInt right_glyph, FT_Vector *kerning)
Definition: cffdrivr.c:104
FT_Error(* PS_GetFontExtraFunc)(FT_Face face, PS_FontExtraRec *afont_extra)
Definition: svpsinfo.h:37
signed short FT_Short
Definition: fttypes.h:194
FT_Long face_flags
Definition: freetype.h:924
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
&CFF_SERVICE_PROPERTIES_GET cff_get_interface(FT_Module driver, const char *module_interface)
Definition: cffdrivr.c:693
FT_FaceRec root
Definition: tttypes.h:1260
CFF_Driver driver
Definition: cffdrivr.c:585
GLuint const GLchar * name
void * data
Definition: fttypes.h:457
FT_Error(* TT_CMap_Info_GetFunc)(FT_CharMap charmap, TT_CMapInfo *cmap_info)
Definition: svttcmap.h:68
const char *(* FT_PsName_GetFunc)(FT_Face face)
Definition: svpostnm.h:41
FT_Generic extra
Definition: tttypes.h:1382
FT_String * font_name
Definition: cfftypes.h:244
#define CFF_CMAP_ENCODING_CLASS_REC_GET
Definition: cffpic.h:37
FT_Fixed italic_angle
Definition: cfftypes.h:114
signed long FT_Fixed
Definition: fttypes.h:284
FT_Bool is_fixed_pitch
Definition: cfftypes.h:113
FT_UInt cid_ordering
Definition: cfftypes.h:136
FT_Error(* FT_Properties_SetFunc)(FT_Module module, const char *property_name, const void *value)
Definition: svprop.h:30
GLuint64EXT * result
typedefFT_BEGIN_HEADER struct CFF_DriverRec_ * CFF_Driver
Definition: cffobjs.h:42
unsigned int FT_UInt
Definition: fttypes.h:227
cff_slot_done(FT_GlyphSlot slot)
Definition: cffobjs.c:343
FT_ULong language
Definition: svttcmap.h:61
& CFF_SERVICE_PS_INFO_GET
Definition: cffdrivr.c:671
FT_DEFINE_SERVICE_TTCMAPSREC(cff_service_get_cmap_info,(TT_CMap_Info_GetFunc) cff_get_cmap_info) static FT_Error cff_get_ros(CFF_Face face
#define CFF_SIZE_SELECT
Definition: cffdrivr.c:735
FT_Fixed linearVertAdvance
Definition: freetype.h:1622
FT_Get_Module(FT_Library library, const char *module_name)
Definition: ftobjs.c:4309
cff_size_done(FT_Size cffsize)
Definition: cffobjs.c:76
GLuint GLuint GLsizei count
FT_BEGIN_HEADER struct PS_FontInfoRec_ PS_FontInfoRec
#define FT_INT_MAX
Definition: ftstdlib.h:64
#define FT_DEFINE_SERVICEDESCREC7(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, serv_id_7, serv_data_7)
Definition: ftserv.h:274
cff_size_request(FT_Size size, FT_Size_Request req)
Definition: cffobjs.c:267
FT_Error(* FT_Properties_GetFunc)(FT_Module module, const char *property_name, void *value)
Definition: svprop.h:35
const char * property_name
Definition: cffdrivr.c:581
FT_Int(* PS_HasGlyphNamesFunc)(FT_Face face)
Definition: svpsinfo.h:41
#define CFF_SERVICE_PROPERTIES_GET
Definition: cffpic.h:35
FT_Error(* PS_GetFontPrivateFunc)(FT_Face face, PS_PrivateRec *afont_private)
Definition: svpsinfo.h:44
FT_TRACE0(("cff_property_set: missing property `%s'\, property_name))
#define FT_STRCPYN(dst, src, size)
Definition: ftmemory.h:369
FT_UInt num_glyphs
Definition: cfftypes.h:224
FT_SERVICE_ID_PROPERTIES
Definition: cffdrivr.c:671
FT_CMap_Class clazz
Definition: ftobjs.h:134
FT_UShort * sids
Definition: cfftypes.h:96
if(cmap->clazz !=&CFF_CMAP_ENCODING_CLASS_REC_GET &&cmap->clazz !=&CFF_CMAP_UNICODE_CLASS_REC_GET)
Definition: cffdrivr.c:420
#define FT_FACE_LIBRARY(x)
Definition: ftobjs.h:562
unsigned short FT_UShort
Definition: fttypes.h:205
cff_face_done(FT_Face cffface)
Definition: cffobjs.c:1023
const char const char FT_Int * supplement
Definition: cffdrivr.c:452
FT_Error(* FT_GlyphDict_GetNameFunc)(FT_Face face, FT_UInt glyph_index, FT_Pointer buffer, FT_UInt buffer_max)
Definition: svgldict.h:38
FT_Module_Requester get_interface
Definition: ftmodapi.h:198
#define FT_FACE_FLAG_GLYPH_NAMES
Definition: freetype.h:1085
GLsizeiptr size
FT_Error(* PS_GetFontInfoFunc)(FT_Face face, PS_FontInfoRec *afont_info)
Definition: svpsinfo.h:33
FT_Error(* FT_CID_GetCIDFromGlyphIndexFunc)(FT_Face face, FT_UInt glyph_index, FT_UInt *cid)
Definition: svcid.h:38
FT_UInt cid_registry
Definition: cfftypes.h:135
CFF_CharsetRec charset
Definition: cfftypes.h:237
const char const char ** ordering
Definition: cffdrivr.c:449
FT_Memory memory
Definition: freetype.h:963
#define ft_strcmp
Definition: ftstdlib.h:85