ReactOS  0.4.13-dev-249-gcba1a2f
cffcmap.c File Reference
#include <ft2build.h>
#include "cffcmap.h"
#include "cffload.h"
#include "cfferrs.h"
Include dependency graph for cffcmap.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 cff_cmap_encoding_init (CFF_CMapStd cmap, FT_Pointer pointer)
 
 cff_cmap_encoding_done (CFF_CMapStd cmap)
 
 cff_cmap_encoding_char_index (CFF_CMapStd cmap, FT_UInt32 char_code)
 
 cff_cmap_encoding_char_next (CFF_CMapStd cmap, FT_UInt32 *pchar_code)
 
 FT_DEFINE_CMAP_CLASS (cff_cmap_encoding_class_rec, sizeof(CFF_CMapStdRec),(FT_CMap_InitFunc) cff_cmap_encoding_init,(FT_CMap_DoneFunc) cff_cmap_encoding_done,(FT_CMap_CharIndexFunc) cff_cmap_encoding_char_index,(FT_CMap_CharNextFunc) cff_cmap_encoding_char_next,(FT_CMap_CharVarIndexFunc) NULL,(FT_CMap_CharVarIsDefaultFunc) NULL,(FT_CMap_VariantListFunc) NULL,(FT_CMap_CharVariantListFunc) NULL,(FT_CMap_VariantCharListFunc) NULL) cff_sid_to_glyph_name(TT_Face face
 
return cff_index_get_sid_string (cff, sid)
 
 cff_cmap_unicode_init (PS_Unicodes unicodes, FT_Pointer pointer)
 
 cff_cmap_unicode_done (PS_Unicodes unicodes)
 
 cff_cmap_unicode_char_index (PS_Unicodes unicodes, FT_UInt32 char_code)
 
 cff_cmap_unicode_char_next (PS_Unicodes unicodes, FT_UInt32 *pchar_code)
 

Variables

FT_UInt idx
 
CFF_Charset charset = &cff->charset
 
FT_UInt sid = charset->sids[idx]
 

Function Documentation

◆ cff_cmap_encoding_char_index()

cff_cmap_encoding_char_index ( CFF_CMapStd  cmap,
FT_UInt32  char_code 
)

Definition at line 60 of file cffcmap.c.

62  {
63  FT_UInt result = 0;
64 
65 
66  if ( char_code < 256 )
67  result = cmap->gids[char_code];
68 
69  return result;
70  }
unsigned int FT_UInt
Definition: fttypes.h:231
GLuint64EXT * result
Definition: glext.h:11304

◆ cff_cmap_encoding_char_next()

cff_cmap_encoding_char_next ( CFF_CMapStd  cmap,
FT_UInt32 *  pchar_code 
)

Definition at line 74 of file cffcmap.c.

76  {
77  FT_UInt result = 0;
78  FT_UInt32 char_code = *pchar_code;
79 
80 
81  *pchar_code = 0;
82 
83  if ( char_code < 255 )
84  {
85  FT_UInt code = (FT_UInt)(char_code + 1);
86 
87 
88  for (;;)
89  {
90  if ( code >= 256 )
91  break;
92 
93  result = cmap->gids[code];
94  if ( result != 0 )
95  {
96  *pchar_code = code;
97  break;
98  }
99 
100  code++;
101  }
102  }
103  return result;
104  }
int code
Definition: i386-dis.c:3591
unsigned int FT_UInt
Definition: fttypes.h:231
GLuint64EXT * result
Definition: glext.h:11304

◆ cff_cmap_encoding_done()

cff_cmap_encoding_done ( CFF_CMapStd  cmap)

Definition at line 53 of file cffcmap.c.

54  {
55  cmap->gids = NULL;
56  }
smooth NULL
Definition: ftsmooth.c:416

◆ cff_cmap_encoding_init()

cff_cmap_encoding_init ( CFF_CMapStd  cmap,
FT_Pointer  pointer 
)

Definition at line 36 of file cffcmap.c.

38  {
39  TT_Face face = (TT_Face)FT_CMAP_FACE( cmap );
40  CFF_Font cff = (CFF_Font)face->extra.data;
42 
43  FT_UNUSED( pointer );
44 
45 
46  cmap->gids = encoding->codes;
47 
48  return 0;
49  }
#define FT_CMAP_FACE(x)
Definition: ftobjs.h:165
GLsizei const GLvoid * pointer
Definition: glext.h:5848
CFF_Font cff
Definition: cffdrivr.c:695
struct TT_FaceRec_ * TT_Face
Definition: tttypes.h:973
ed encoding
Definition: write.c:2847
struct CFF_FontRec_ * CFF_Font
Definition: cfftypes.h:152
CFF_EncodingRec encoding
Definition: cfftypes.h:354
#define FT_UNUSED(arg)
Definition: ftconfig.h:101
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

◆ cff_cmap_unicode_char_index()

cff_cmap_unicode_char_index ( PS_Unicodes  unicodes,
FT_UInt32  char_code 
)

Definition at line 186 of file cffcmap.c.

188  {
189  TT_Face face = (TT_Face)FT_CMAP_FACE( unicodes );
190  CFF_Font cff = (CFF_Font)face->extra.data;
191  FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)cff->psnames;
192 
193 
194  return psnames->unicodes_char_index( unicodes, char_code );
195  }
#define FT_CMAP_FACE(x)
Definition: ftobjs.h:165
FT_Service_PsCMaps psnames
Definition: cfftypes.h:383
CFF_Font cff
Definition: cffdrivr.c:695
struct TT_FaceRec_ * TT_Face
Definition: tttypes.h:973
struct CFF_FontRec_ * CFF_Font
Definition: cfftypes.h:152
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

◆ cff_cmap_unicode_char_next()

cff_cmap_unicode_char_next ( PS_Unicodes  unicodes,
FT_UInt32 *  pchar_code 
)

Definition at line 199 of file cffcmap.c.

201  {
202  TT_Face face = (TT_Face)FT_CMAP_FACE( unicodes );
203  CFF_Font cff = (CFF_Font)face->extra.data;
204  FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)cff->psnames;
205 
206 
207  return psnames->unicodes_char_next( unicodes, pchar_code );
208  }
#define FT_CMAP_FACE(x)
Definition: ftobjs.h:165
FT_Service_PsCMaps psnames
Definition: cfftypes.h:383
CFF_Font cff
Definition: cffdrivr.c:695
struct TT_FaceRec_ * TT_Face
Definition: tttypes.h:973
struct CFF_FontRec_ * CFF_Font
Definition: cfftypes.h:152
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

◆ cff_cmap_unicode_done()

cff_cmap_unicode_done ( PS_Unicodes  unicodes)

Definition at line 174 of file cffcmap.c.

175  {
176  FT_Face face = FT_CMAP_FACE( unicodes );
178 
179 
180  FT_FREE( unicodes->maps );
181  unicodes->num_maps = 0;
182  }
FT_UInt num_maps
Definition: svpscmap.h:67
#define FT_CMAP_FACE(x)
Definition: ftobjs.h:165
static char memory[1024 *256]
Definition: process.c:116
PS_UniMap * maps
Definition: svpscmap.h:68
#define FT_FREE(ptr)
Definition: ftmemory.h:329
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
#define FT_FACE_MEMORY(x)
Definition: ftobjs.h:636
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

◆ cff_cmap_unicode_init()

cff_cmap_unicode_init ( PS_Unicodes  unicodes,
FT_Pointer  pointer 
)

Definition at line 147 of file cffcmap.c.

149  {
150  TT_Face face = (TT_Face)FT_CMAP_FACE( unicodes );
152  CFF_Font cff = (CFF_Font)face->extra.data;
154  FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)cff->psnames;
155 
156  FT_UNUSED( pointer );
157 
158 
159  /* can't build Unicode map for CID-keyed font */
160  /* because we don't know glyph names. */
161  if ( !charset->sids )
162  return FT_THROW( No_Unicode_Glyph_Name );
163 
164  return psnames->unicodes_init( memory,
165  unicodes,
166  cff->num_glyphs,
167  (PS_GetGlyphNameFunc)&cff_sid_to_glyph_name,
169  (FT_Pointer)face );
170  }
CFF_Charset charset
Definition: cffcmap.c:138
#define FT_CMAP_FACE(x)
Definition: ftobjs.h:165
GLsizei const GLvoid * pointer
Definition: glext.h:5848
static char memory[1024 *256]
Definition: process.c:116
FT_Service_PsCMaps psnames
Definition: cfftypes.h:383
#define FT_THROW(e)
Definition: ftdebug.h:213
smooth NULL
Definition: ftsmooth.c:416
CFF_Font cff
Definition: cffdrivr.c:695
struct TT_FaceRec_ * TT_Face
Definition: tttypes.h:973
const char *(* PS_GetGlyphNameFunc)(FT_Pointer data, FT_UInt string_index)
Definition: svpscmap.h:78
void(* PS_FreeGlyphNameFunc)(FT_Pointer data, const char *name)
Definition: svpscmap.h:86
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
FT_UShort * sids
Definition: cfftypes.h:98
#define FT_FACE_MEMORY(x)
Definition: ftobjs.h:636
struct CFF_FontRec_ * CFF_Font
Definition: cfftypes.h:152
FT_UInt num_glyphs
Definition: cfftypes.h:340
#define FT_UNUSED(arg)
Definition: ftconfig.h:101
CFF_CharsetRec charset
Definition: cfftypes.h:355
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

◆ cff_index_get_sid_string()

return cff_index_get_sid_string ( cff  ,
sid   
)

◆ FT_DEFINE_CMAP_CLASS()

FT_DEFINE_CMAP_CLASS ( cff_cmap_encoding_class_rec  ,
sizeof(CFF_CMapStdRec ,
(FT_CMap_InitFunc cff_cmap_encoding_init,
(FT_CMap_DoneFunc cff_cmap_encoding_done,
(FT_CMap_CharIndexFunc cff_cmap_encoding_char_index,
(FT_CMap_CharNextFunc cff_cmap_encoding_char_next,
(FT_CMap_CharVarIndexFunc NULL,
(FT_CMap_CharVarIsDefaultFunc NULL,
(FT_CMap_VariantListFunc NULL,
(FT_CMap_CharVariantListFunc NULL,
(FT_CMap_VariantCharListFunc NULL 
)

Variable Documentation

◆ charset

CFF_Charset charset = &cff->charset

◆ idx

FT_UInt idx
Initial value:
{
CFF_Font cff = (CFF_Font)face->extra.data
CFF_Font cff
Definition: cffdrivr.c:695
struct CFF_FontRec_ * CFF_Font
Definition: cfftypes.h:152
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

Definition at line 136 of file cffcmap.c.

◆ sid

FT_UInt sid = charset->sids[idx]