ReactOS 0.4.16-dev-250-g3ecd236
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 }
Definition: inflate.c:139

◆ 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 }
#define NULL
Definition: types.h:112

◆ cff_cmap_encoding_init()

cff_cmap_encoding_init ( CFF_CMapStd  cmap,
FT_Pointer  pointer 
)

Definition at line 36 of file cffcmap.c.

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

◆ 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 }
FT_Service_PsCMaps psnames
Definition: cfftypes.h:383

◆ 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 }

◆ 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 }
#define FT_FREE(ptr)
Definition: ftmemory.h:329
#define FT_FACE_MEMORY(x)
Definition: ftobjs.h:636
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
static char memory[1024 *256]
Definition: process.c:116
FT_UInt num_maps
Definition: svpscmap.h:67
PS_UniMap * maps
Definition: svpscmap.h:68

◆ 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
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,
167 (PS_GetGlyphNameFunc)&cff_sid_to_glyph_name,
169 (FT_Pointer)face );
170 }
CFF_Charset charset
Definition: cffcmap.c:138
#define FT_THROW(e)
Definition: ftdebug.h:213
FT_UShort * sids
Definition: cfftypes.h:98
CFF_CharsetRec charset
Definition: cfftypes.h:355
FT_UInt num_glyphs
Definition: cfftypes.h:340
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

◆ 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

Definition at line 138 of file cffcmap.c.

Referenced by add_charset(), add_font_to_fonttbl(), cff_charset_cid_to_gindex(), cff_charset_compute_cids(), cff_charset_done(), cff_charset_free_cids(), cff_charset_load(), cff_cmap_unicode_init(), cff_encoding_load(), cff_get_name_index(), CFn_FitCharSet(), CFn_WMCommand(), CFn_WMInitDialog(), cp_from_charset_string(), D3DXCreateFontA(), D3DXCreateFontW(), find_nls(), get_document_charset(), get_glyph_indices(), get_opentype_script(), GetKerningPairsA(), is_cjk(), ITextRange_fnMoveEndUntil(), ITextRange_fnMoveEndWhile(), ITextRange_fnMoveStartUntil(), ITextRange_fnMoveStartWhile(), ITextRange_fnMoveUntil(), ITextRange_fnMoveWhile(), ITextSelection_fnMoveEndUntil(), ITextSelection_fnMoveEndWhile(), ITextSelection_fnMoveStartUntil(), ITextSelection_fnMoveStartWhile(), ITextSelection_fnMoveUntil(), ITextSelection_fnMoveWhile(), load_nls(), font::MakeFont(), map_font(), METADC_ExtTextOut(), MFDRV_ExtTextOut(), MimeInternat_FindCharset(), MimeInternat_GetCharsetInfo(), MimeInternat_Release(), MimeOleFindCharset(), MimeOleGetDefaultCharset(), mlang_getcsetinfo(), nsChannel_SetContentCharset(), nsIOService_NewURI(), OLEFontImpl_put_Charset(), parse_content_type(), RTFCharSetToCodePage(), sic_open(), test_bitmap_font_glyph_index(), test_east_asian_font_selection(), test_font_charset(), test_GdiGetCodePage(), test_GetCharsetInfo_other(), test_margins_default(), test_margins_usefontinfo(), test_nonexistent_font(), test_oemcharset(), and test_stock_fonts().

◆ idx

FT_UInt idx
Initial value:
{
CFF_Font cff = (CFF_Font)face->extra.data

Definition at line 135 of file cffcmap.c.

◆ sid