zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ftcid.c
Go to the documentation of this file.
1 /***************************************************************************/
2 /* */
3 /* ftcid.c */
4 /* */
5 /* FreeType API for accessing CID font information. */
6 /* */
7 /* Copyright 2007, 2009 by Derek Clegg, Michael Toftdal. */
8 /* */
9 /* This file is part of the FreeType project, and may only be used, */
10 /* modified, and distributed under the terms of the FreeType project */
11 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
12 /* this file you indicate that you have read the license and */
13 /* understand and accept it fully. */
14 /* */
15 /***************************************************************************/
16 
17 
18 #include <ft2build.h>
19 #include FT_CID_H
20 #include FT_INTERNAL_OBJECTS_H
21 #include FT_SERVICE_CID_H
22 
23 
24  /* documentation is in ftcid.h */
25 
28  const char* *registry,
29  const char* *ordering,
31  {
33  const char* r = NULL;
34  const char* o = NULL;
35  FT_Int s = 0;
36 
37 
39 
40  if ( face )
41  {
42  FT_Service_CID service;
43 
44 
45  FT_FACE_FIND_SERVICE( face, service, CID );
46 
47  if ( service && service->get_ros )
48  error = service->get_ros( face, &r, &o, &s );
49  }
50 
51  if ( registry )
52  *registry = r;
53 
54  if ( ordering )
55  *ordering = o;
56 
57  if ( supplement )
58  *supplement = s;
59 
60  return error;
61  }
62 
63 
66  FT_Bool *is_cid )
67  {
69  FT_Bool ic = 0;
70 
71 
72  if ( face )
73  {
74  FT_Service_CID service;
75 
76 
77  FT_FACE_FIND_SERVICE( face, service, CID );
78 
79  if ( service && service->get_is_cid )
80  error = service->get_is_cid( face, &ic);
81  }
82 
83  if ( is_cid )
84  *is_cid = ic;
85 
86  return error;
87  }
88 
89 
92  FT_UInt glyph_index,
93  FT_UInt *cid )
94  {
96  FT_UInt c = 0;
97 
98 
99  if ( face )
100  {
101  FT_Service_CID service;
102 
103 
104  FT_FACE_FIND_SERVICE( face, service, CID );
105 
106  if ( service && service->get_cid_from_glyph_index )
107  error = service->get_cid_from_glyph_index( face, glyph_index, &c);
108  }
109 
110  if ( cid )
111  *cid = c;
112 
113  return error;
114  }
115 
116 
117 /* END */
int FT_Error
Definition: fttypes.h:296
GLdouble s
Definition: glew.h:1376
#define NULL
Definition: ftobjs.h:61
signed int FT_Int
Definition: fttypes.h:216
return FT_Err_Invalid_Argument
Definition: ftbbox.c:584
FT_Get_CID_Is_Internally_CID_Keyed(FT_Face face, FT_Bool *is_cid)
Definition: ftcid.c:65
FT_Get_CID_From_Glyph_Index(FT_Face face, FT_UInt glyph_index, FT_UInt *cid)
Definition: ftcid.c:91
FT_BEGIN_HEADER typedef unsigned char FT_Bool
Definition: fttypes.h:104
const char ** registry
Definition: cffdrivr.c:443
FT_Error error
Definition: cffdrivr.c:407
GLenum face
Definition: gl2ext.h:1490
const GLfloat * c
Definition: glew.h:14913
FT_BEGIN_HEADER FT_Get_CID_Registry_Ordering_Supplement(FT_Face face, const char **registry, const char **ordering, FT_Int *supplement)
Definition: ftcid.c:27
#define const
Definition: zconf.h:91
#define FT_EXPORT_DEF(x)
Definition: ftconfig.h:511
unsigned int FT_UInt
Definition: fttypes.h:227
GLdouble GLdouble GLdouble r
Definition: glew.h:1392
#define FT_FACE_FIND_SERVICE(face, ptr, id)
Definition: ftserv.h:83
const char const char FT_Int * supplement
Definition: cffdrivr.c:446
const char const char ** ordering
Definition: cffdrivr.c:443