ReactOS 0.4.16-dev-1063-gd722e70
cffdecode.h File Reference
#include <ft2build.h>
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 2327 of file cffdecode.c.

2335 {
2336 CFF_Font cff = (CFF_Font)face->extra.data;
2337
2338
2339 /* clear everything */
2340 FT_ZERO( decoder );
2341
2342 /* initialize builder */
2343 cff_builder_init( &decoder->builder, face, size, slot, hinting );
2344
2345 /* initialize Type2 decoder */
2346 decoder->cff = cff;
2347 decoder->num_globals = cff->global_subrs_index.count;
2348 decoder->globals = cff->global_subrs;
2349 decoder->globals_bias = cff_compute_bias(
2351 decoder->num_globals );
2352
2353 decoder->hint_mode = hint_mode;
2354
2355 decoder->get_glyph_callback = get_callback;
2356 decoder->free_glyph_callback = free_callback;
2357 }
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:402
CFF_Font cff
Definition: cffdrivr.c:702
struct CFF_FontRec_ * CFF_Font
Definition: cfftypes.h:157
#define FT_ZERO(p)
Definition: ftmemory.h:237
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:1841
FT_Int charstring_type
Definition: cfftypes.h:198
FT_Byte ** global_subrs
Definition: cfftypes.h:370
CFF_SubFontRec top_font
Definition: cfftypes.h:378
CFF_IndexRec global_subrs_index
Definition: cfftypes.h:357
CFF_FontRecDictRec font_dict
Definition: cfftypes.h:305
Definition: vfat.h:185

◆ cff_decoder_prepare()

cff_decoder_prepare ( CFF_Decoder decoder,
CFF_Size  size,
FT_UInt  glyph_index 
)

Definition at line 2363 of file cffdecode.c.

2366 {
2367 CFF_Builder *builder = &decoder->builder;
2368 CFF_Font cff = (CFF_Font)builder->face->extra.data;
2369 CFF_SubFont sub = &cff->top_font;
2371
2372 FT_Service_CFFLoad cffload = (FT_Service_CFFLoad)cff->cffload;
2373
2374
2375 /* manage CID fonts */
2376 if ( cff->num_subfonts )
2377 {
2378 FT_Byte fd_index = cffload->fd_select_get( &cff->fd_select,
2379 glyph_index );
2380
2381
2382 if ( fd_index >= cff->num_subfonts )
2383 {
2384 FT_TRACE4(( "cff_decoder_prepare: invalid CID subfont index\n" ));
2385 error = FT_THROW( Invalid_File_Format );
2386 goto Exit;
2387 }
2388
2389 FT_TRACE3(( " in subfont %d:\n", fd_index ));
2390
2391 sub = cff->subfonts[fd_index];
2392
2393 if ( builder->hints_funcs && size )
2394 {
2395 FT_Size ftsize = FT_SIZE( size );
2397
2398
2399 /* for CFFs without subfonts, this value has already been set */
2400 builder->hints_globals = (void *)internal->subfonts[fd_index];
2401 }
2402 }
2403
2404 decoder->num_locals = sub->local_subrs_index.count;
2405 decoder->locals = sub->local_subrs;
2406 decoder->locals_bias = cff_compute_bias(
2407 decoder->cff->top_font.font_dict.charstring_type,
2408 decoder->num_locals );
2409
2410 decoder->glyph_width = sub->private_dict.default_width;
2411 decoder->nominal_width = sub->private_dict.nominal_width;
2412
2413 decoder->current_subfont = sub;
2414
2415 Exit:
2416 return error;
2417 }
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:527
#define FT_TRACE3(varformat)
Definition: ftdebug.h:188
#define FT_THROW(e)
Definition: ftdebug.h:241
#define FT_TRACE4(varformat)
Definition: ftdebug.h:189
#define FT_SIZE(x)
Definition: ftobjs.h:600
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:1111
void * hints_globals
Definition: psaux.h:1132
void * hints_funcs
Definition: psaux.h:1131
FT_UInt num_subfonts
Definition: cfftypes.h:379
CFF_SubFont subfonts[CFF_MAX_CID_FONTS]
Definition: cfftypes.h:380
CFF_FDSelectRec fd_select
Definition: cfftypes.h:382
const void * cffload
Definition: cfftypes.h:391
void * data
Definition: fttypes.h:469
FT_Size_Internal internal
Definition: freetype.h:1650
void * module_data
Definition: ftobjs.h:461
FT_Generic extra
Definition: tttypes.h:1650

◆ cff_lookup_glyph_by_stdcharcode()

cff_lookup_glyph_by_stdcharcode ( CFF_Font  cff,
FT_Int  charcode 
)

Definition at line 422 of file cffdecode.c.

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

Referenced by cf2_getSeacComponent().