ReactOS 0.4.16-dev-2354-g16de117
cffdecode.h File Reference
Include dependency graph for cffdecode.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

FT_BEGIN_HEADER cff_decoder_init (CFF_Decoder *decoder, TT_Face face, CFF_Size size, CFF_GlyphSlot slot, FT_Bool hinting, FT_Render_Mode hint_mode, CFF_Decoder_Get_Glyph_Callback get_callback, CFF_Decoder_Free_Glyph_Callback free_callback)
 
 cff_decoder_prepare (CFF_Decoder *decoder, CFF_Size size, FT_UInt glyph_index)
 
 cff_lookup_glyph_by_stdcharcode (CFF_Font cff, FT_Int charcode)
 

Function Documentation

◆ cff_decoder_init()

FT_BEGIN_HEADER cff_decoder_init ( CFF_Decoder decoder,
TT_Face  face,
CFF_Size  size,
CFF_GlyphSlot  slot,
FT_Bool  hinting,
FT_Render_Mode  hint_mode,
CFF_Decoder_Get_Glyph_Callback  get_callback,
CFF_Decoder_Free_Glyph_Callback  free_callback 
)

Definition at line 2329 of file cffdecode.c.

2337 {
2338 CFF_Font cff = (CFF_Font)face->extra.data;
2339
2340
2341 /* clear everything */
2342 FT_ZERO( decoder );
2343
2344 /* initialize builder */
2345 cff_builder_init( &decoder->builder, face, size, slot, hinting );
2346
2347 /* initialize Type2 decoder */
2348 decoder->cff = cff;
2349 decoder->num_globals = cff->global_subrs_index.count;
2350 decoder->globals = cff->global_subrs;
2351 decoder->globals_bias = cff_compute_bias(
2353 decoder->num_globals );
2354
2355 decoder->hint_mode = hint_mode;
2356
2357 decoder->get_glyph_callback = get_callback;
2358 decoder->free_glyph_callback = free_callback;
2359 }
static HRESULT get_callback(IBindCtx *pbc, IBindStatusCallback **callback)
Definition: binding.c:1411
static FT_Int cff_compute_bias(FT_Int in_charstring_type, FT_UInt num_subrs)
Definition: cffdecode.c:401
CFF_Font cff
Definition: cffdrivr.c:701
struct CFF_FontRec_ * CFF_Font
Definition: cfftypes.h:156
#define FT_ZERO(p)
Definition: ftmemory.h:246
GLsizeiptr size
Definition: glext.h:5919
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
cff_builder_init(CFF_Builder *builder, TT_Face face, CFF_Size size, CFF_GlyphSlot glyph, FT_Bool hinting)
Definition: psobjs.c:1840
FT_Int charstring_type
Definition: cfftypes.h:197
FT_Byte ** global_subrs
Definition: cfftypes.h:369
CFF_SubFontRec top_font
Definition: cfftypes.h:377
CFF_IndexRec global_subrs_index
Definition: cfftypes.h:356
CFF_FontRecDictRec font_dict
Definition: cfftypes.h:304
Definition: vfat.h:185

◆ cff_decoder_prepare()

cff_decoder_prepare ( CFF_Decoder decoder,
CFF_Size  size,
FT_UInt  glyph_index 
)

Definition at line 2365 of file cffdecode.c.

2368 {
2369 CFF_Builder *builder = &decoder->builder;
2370 CFF_Font cff = (CFF_Font)builder->face->extra.data;
2371 CFF_SubFont sub = &cff->top_font;
2373
2374 FT_Service_CFFLoad cffload = (FT_Service_CFFLoad)cff->cffload;
2375
2376
2377 /* manage CID fonts */
2378 if ( cff->num_subfonts )
2379 {
2380 FT_Byte fd_index = cffload->fd_select_get( &cff->fd_select,
2381 glyph_index );
2382
2383
2384 if ( fd_index >= cff->num_subfonts )
2385 {
2386 FT_TRACE4(( "cff_decoder_prepare: invalid CID subfont index\n" ));
2387 error = FT_THROW( Invalid_File_Format );
2388 goto Exit;
2389 }
2390
2391 FT_TRACE3(( " in subfont %d:\n", fd_index ));
2392
2393 sub = cff->subfonts[fd_index];
2394
2395 if ( builder->hints_funcs && size )
2396 {
2397 FT_Size ftsize = FT_SIZE( size );
2399
2400
2401 /* for CFFs without subfonts, this value has already been set */
2402 builder->hints_globals = (void *)internal->subfonts[fd_index];
2403 }
2404 }
2405
2406 decoder->num_locals = sub->local_subrs_index.count;
2407 decoder->locals = sub->local_subrs;
2408 decoder->locals_bias = cff_compute_bias(
2409 decoder->cff->top_font.font_dict.charstring_type,
2410 decoder->num_locals );
2411
2412 decoder->glyph_width = sub->private_dict.default_width;
2413 decoder->nominal_width = sub->private_dict.nominal_width;
2414
2415 decoder->current_subfont = sub;
2416
2417 Exit:
2418 return error;
2419 }
ios_base &_STLP_CALL internal(ios_base &__s)
Definition: _ios_base.h:311
struct CFF_InternalRec_ * CFF_Internal
return FT_Err_Ok
Definition: ftbbox.c:526
#define FT_TRACE3(varformat)
Definition: ftdebug.h:190
#define FT_THROW(e)
Definition: ftdebug.h:243
#define FT_TRACE4(varformat)
Definition: ftdebug.h:191
#define FT_SIZE(x)
Definition: ftobjs.h:598
unsigned char FT_Byte
Definition: fttypes.h:154
int FT_Error
Definition: fttypes.h:299
#define error(str)
Definition: mkdosfs.c:1605
static void Exit(void)
Definition: sock.c:1330
TT_Face face
Definition: psaux.h:1110
void * hints_globals
Definition: psaux.h:1131
void * hints_funcs
Definition: psaux.h:1130
FT_UInt num_subfonts
Definition: cfftypes.h:378
CFF_SubFont subfonts[CFF_MAX_CID_FONTS]
Definition: cfftypes.h:379
CFF_FDSelectRec fd_select
Definition: cfftypes.h:381
const void * cffload
Definition: cfftypes.h:390
void * data
Definition: fttypes.h:469
FT_Size_Internal internal
Definition: freetype.h:1637
void * module_data
Definition: ftobjs.h:459
FT_Generic extra
Definition: tttypes.h:1576

◆ cff_lookup_glyph_by_stdcharcode()

cff_lookup_glyph_by_stdcharcode ( CFF_Font  cff,
FT_Int  charcode 
)

Definition at line 421 of file cffdecode.c.

423 {
424 FT_UInt n;
425 FT_UShort glyph_sid;
426
427 FT_Service_CFFLoad cffload;
428
429
430 /* CID-keyed fonts don't have glyph names */
431 if ( !cff->charset.sids )
432 return -1;
433
434 /* check range of standard char code */
435 if ( charcode < 0 || charcode > 255 )
436 return -1;
437
438#if 0
439 /* retrieve cffload from list of current modules */
440 FT_Service_CFFLoad cffload;
441
442
443 FT_FACE_FIND_GLOBAL_SERVICE( face, cffload, CFF_LOAD );
444 if ( !cffload )
445 {
446 FT_ERROR(( "cff_lookup_glyph_by_stdcharcode:"
447 " the `cffload' module is not available\n" ));
448 return FT_THROW( Unimplemented_Feature );
449 }
450#endif
451
452 cffload = (FT_Service_CFFLoad)cff->cffload;
453
454 /* Get code to SID mapping from `cff_standard_encoding'. */
455 glyph_sid = cffload->get_standard_encoding( (FT_UInt)charcode );
456
457 for ( n = 0; n < cff->num_glyphs; n++ )
458 {
459 if ( cff->charset.sids[n] == glyph_sid )
460 return (FT_Int)n;
461 }
462
463 return -1;
464 }
#define FT_ERROR(varformat)
Definition: ftdebug.h:211
#define FT_FACE_FIND_GLOBAL_SERVICE(face, ptr, id)
Definition: ftserv.h:128
unsigned short FT_UShort
Definition: fttypes.h:209
unsigned int FT_UInt
Definition: fttypes.h:231
signed int FT_Int
Definition: fttypes.h:220
GLdouble n
Definition: glext.h:7729
FT_UShort * sids
Definition: cfftypes.h:102
CFF_CharsetRec charset
Definition: cfftypes.h:359
FT_UInt num_glyphs
Definition: cfftypes.h:344

Referenced by cf2_getSeacComponent().