本文整理汇总了C++中SFNT_Service类的典型用法代码示例。如果您正苦于以下问题:C++ SFNT_Service类的具体用法?C++ SFNT_Service怎么用?C++ SFNT_Service使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SFNT_Service类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sfnt_init_face
sfnt_init_face( FT_Stream stream,
TT_Face face,
FT_Int face_index,
FT_Int num_params,
FT_Parameter* params )
{
FT_Error error;
FT_Library library = face->root.driver->root.library;
SFNT_Service sfnt;
SFNT_HeaderRec sfnt_header;
/* for now, parameters are unused */
FT_UNUSED( num_params );
FT_UNUSED( params );
sfnt = (SFNT_Service)face->sfnt;
if ( !sfnt )
{
sfnt = (SFNT_Service)FT_Get_Module_Interface( library, "sfnt" );
if ( !sfnt )
{
error = SFNT_Err_Invalid_File_Format;
goto Exit;
}
face->sfnt = sfnt;
face->goto_table = sfnt->goto_table;
}
FT_FACE_FIND_GLOBAL_SERVICE( face, face->psnames, POSTSCRIPT_CMAPS );
/* check that we have a valid TrueType file */
error = sfnt->load_sfnt_header( face, stream, face_index, &sfnt_header );
if ( error )
goto Exit;
face->format_tag = sfnt_header.format_tag;
face->num_tables = sfnt_header.num_tables;
/* Load font directory */
error = sfnt->load_directory( face, stream, &sfnt_header );
if ( error )
goto Exit;
face->root.num_faces = face->ttc_header.count;
if ( face->root.num_faces < 1 )
face->root.num_faces = 1;
Exit:
return error;
}
示例2: cff_get_kerning
cff_get_kerning( FT_Face ttface, /* TT_Face */
FT_UInt left_glyph,
FT_UInt right_glyph,
FT_Vector* kerning )
{
TT_Face face = (TT_Face)ttface;
SFNT_Service sfnt = (SFNT_Service)face->sfnt;
kerning->x = 0;
kerning->y = 0;
if ( sfnt )
kerning->x = sfnt->get_kerning( face, left_glyph, right_glyph );
return CFF_Err_Ok;
}
示例3: tt_face_done
tt_face_done( FT_Face ttface ) /* TT_Face */
{
TT_Face face = (TT_Face)ttface;
FT_Memory memory;
FT_Stream stream;
SFNT_Service sfnt;
if ( !face )
return;
memory = ttface->memory;
stream = ttface->stream;
sfnt = (SFNT_Service)face->sfnt;
/* for `extended TrueType formats' (i.e. compressed versions) */
if ( face->extra.finalizer )
face->extra.finalizer( face->extra.data );
if ( sfnt )
sfnt->done_face( face );
/* freeing the locations table */
tt_face_done_loca( face );
tt_face_free_hdmx( face );
/* freeing the CVT */
FT_FREE( face->cvt );
face->cvt_size = 0;
/* freeing the programs */
FT_FRAME_RELEASE( face->font_program );
FT_FRAME_RELEASE( face->cvt_program );
face->font_program_size = 0;
face->cvt_program_size = 0;
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
tt_done_blend( memory, face->blend );
face->blend = NULL;
#endif
}
示例4: CFF_Face_Done
CFF_Face_Done( CFF_Face face )
{
FT_Memory memory = face->root.memory;
SFNT_Service sfnt = (SFNT_Service)face->sfnt;
if ( sfnt )
sfnt->done_face( face );
{
CFF_Font cff = (CFF_Font)face->extra.data;
if ( cff )
{
CFF_Done_Font( cff );
FT_FREE( face->extra.data );
}
}
}
示例5: tt_get_interface
tt_get_interface( FT_Module driver, /* TT_Driver */
const char* tt_interface )
{
FT_Library library;
FT_Module_Interface result;
FT_Module sfntd;
SFNT_Service sfnt;
/* TT_SERVICES_GET derefers `library' in PIC mode */
#ifdef FT_CONFIG_OPTION_PIC
if ( !driver )
return NULL;
library = driver->library;
if ( !library )
return NULL;
#endif
result = ft_service_list_lookup( TT_SERVICES_GET, tt_interface );
if ( result != NULL )
return result;
#ifndef FT_CONFIG_OPTION_PIC
if ( !driver )
return NULL;
library = driver->library;
if ( !library )
return NULL;
#endif
/* only return the default interface from the SFNT module */
sfntd = FT_Get_Module( library, "sfnt" );
if ( sfntd )
{
sfnt = (SFNT_Service)( sfntd->clazz->module_interface );
if ( sfnt )
return sfnt->get_interface( driver, tt_interface );
}
return 0;
}
示例6: cff_face_done
cff_face_done( FT_Face cffface ) /* CFF_Face */
{
CFF_Face face = (CFF_Face)cffface;
FT_Memory memory = cffface->memory;
SFNT_Service sfnt = (SFNT_Service)face->sfnt;
if ( sfnt )
sfnt->done_face( face );
{
CFF_Font cff = (CFF_Font)face->extra.data;
if ( cff )
{
cff_font_done( cff );
FT_FREE( face->extra.data );
}
}
}
示例7: tt_get_interface
tt_get_interface( FT_Module driver, /* TT_Driver */
const char* tt_interface )
{
FT_Module_Interface result;
FT_Module sfntd;
SFNT_Service sfnt;
result = ft_service_list_lookup( tt_services, tt_interface );
if ( result != NULL )
return result;
/* only return the default interface from the SFNT module */
sfntd = FT_Get_Module( driver->library, "sfnt" );
if ( sfntd )
{
sfnt = (SFNT_Service)( sfntd->clazz->module_interface );
if ( sfnt )
return sfnt->get_interface( driver, tt_interface );
}
return 0;
}
示例8: tt_size_request
static FT_Error
tt_size_request( FT_Size size,
FT_Size_Request req )
{
TT_Size ttsize = (TT_Size)size;
FT_Error error = FT_Err_Ok;
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
if ( FT_HAS_FIXED_SIZES( size->face ) )
{
TT_Face ttface = (TT_Face)size->face;
SFNT_Service sfnt = (SFNT_Service) ttface->sfnt;
FT_ULong strike_index;
error = sfnt->set_sbit_strike( ttface, req, &strike_index );
if ( error )
ttsize->strike_index = 0xFFFFFFFFUL;
else
return tt_size_select( size, strike_index );
}
#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
FT_Request_Metrics( size->face, req );
if ( FT_IS_SCALABLE( size->face ) )
{
error = tt_size_reset( ttsize );
ttsize->root.metrics = ttsize->metrics;
}
return error;
}
示例9: tt_face_init
tt_face_init( FT_Stream stream,
FT_Face ttface, /* TT_Face */
FT_Int face_index,
FT_Int num_params,
FT_Parameter* params )
{
FT_Error error;
FT_Library library;
SFNT_Service sfnt;
TT_Face face = (TT_Face)ttface;
FT_TRACE2(( "TTF driver\n" ));
library = ttface->driver->root.library;
sfnt = (SFNT_Service)FT_Get_Module_Interface( library, "sfnt" );
if ( !sfnt )
{
FT_ERROR(( "tt_face_init: cannot access `sfnt' module\n" ));
error = FT_THROW( Missing_Module );
goto Exit;
}
/* create input stream from resource */
if ( FT_STREAM_SEEK( 0 ) )
goto Exit;
/* check that we have a valid TrueType file */
error = sfnt->init_face( stream, face, face_index, num_params, params );
/* Stream may have changed. */
stream = face->root.stream;
if ( error )
goto Exit;
/* We must also be able to accept Mac/GX fonts, as well as OT ones. */
/* The 0x00020000 tag is completely undocumented; some fonts from */
/* Arphic made for Chinese Windows 3.1 have this. */
if ( face->format_tag != 0x00010000L && /* MS fonts */
face->format_tag != 0x00020000L && /* CJK fonts for Win 3.1 */
face->format_tag != TTAG_true ) /* Mac fonts */
{
FT_TRACE2(( " not a TTF font\n" ));
goto Bad_Format;
}
#ifdef TT_USE_BYTECODE_INTERPRETER
ttface->face_flags |= FT_FACE_FLAG_HINTER;
#endif
/* If we are performing a simple font format check, exit immediately. */
if ( face_index < 0 )
return FT_Err_Ok;
/* Load font directory */
error = sfnt->load_face( stream, face, face_index, num_params, params );
if ( error )
goto Exit;
if ( tt_check_trickyness( ttface ) )
ttface->face_flags |= FT_FACE_FLAG_TRICKY;
error = tt_face_load_hdmx( face, stream );
if ( error )
goto Exit;
if ( FT_IS_SCALABLE( ttface ) )
{
#ifdef FT_CONFIG_OPTION_INCREMENTAL
if ( !ttface->internal->incremental_interface )
error = tt_face_load_loca( face, stream );
if ( !error )
error = tt_face_load_cvt( face, stream );
if ( !error )
error = tt_face_load_fpgm( face, stream );
if ( !error )
error = tt_face_load_prep( face, stream );
/* Check the scalable flag based on `loca'. */
if ( !ttface->internal->incremental_interface &&
ttface->num_fixed_sizes &&
face->glyph_locations &&
tt_check_single_notdef( ttface ) )
{
FT_TRACE5(( "tt_face_init:"
" Only the `.notdef' glyph has an outline.\n"
" "
" Resetting scalable flag to FALSE.\n" ));
ttface->face_flags &= ~FT_FACE_FLAG_SCALABLE;
}
#else /* !FT_CONFIG_OPTION_INCREMENTAL */
if ( !error )
error = tt_face_load_loca( face, stream );
//.........这里部分代码省略.........
示例10: sfnt_init_face
sfnt_init_face( FT_Stream stream,
TT_Face face,
FT_Int face_index,
FT_Int num_params,
FT_Parameter* params )
{
FT_Error error;
FT_Library library = face->root.driver->root.library;
SFNT_Service sfnt;
/* for now, parameters are unused */
FT_UNUSED( num_params );
FT_UNUSED( params );
sfnt = (SFNT_Service)face->sfnt;
if ( !sfnt )
{
sfnt = (SFNT_Service)FT_Get_Module_Interface( library, "sfnt" );
if ( !sfnt )
{
FT_ERROR(( "sfnt_init_face: cannot access `sfnt' module\n" ));
return FT_THROW( Missing_Module );
}
face->sfnt = sfnt;
face->goto_table = sfnt->goto_table;
}
FT_FACE_FIND_GLOBAL_SERVICE( face, face->psnames, POSTSCRIPT_CMAPS );
FT_TRACE2(( "SFNT driver\n" ));
error = sfnt_open_font( stream, face );
if ( error )
return error;
/* Stream may have changed in sfnt_open_font. */
stream = face->root.stream;
FT_TRACE2(( "sfnt_init_face: %08p, %ld\n", face, face_index ));
if ( face_index < 0 )
face_index = 0;
if ( face_index >= face->ttc_header.count )
return FT_THROW( Invalid_Argument );
if ( FT_STREAM_SEEK( face->ttc_header.offsets[face_index] ) )
return error;
/* check that we have a valid TrueType file */
error = sfnt->load_font_dir( face, stream );
if ( error )
return error;
face->root.num_faces = face->ttc_header.count;
face->root.face_index = face_index;
return error;
}
示例11: sfnt_load_face
sfnt_load_face(FT_Stream stream,
TT_Face face,
FT_Int face_index,
FT_Int num_params,
FT_Parameter * params)
{
FT_Error error;
#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
FT_Error psnames_error;
#endif
FT_Bool has_outline;
FT_Bool is_apple_sbit;
FT_Bool ignore_preferred_family = FALSE;
FT_Bool ignore_preferred_subfamily = FALSE;
SFNT_Service sfnt = (SFNT_Service)face->sfnt;
FT_UNUSED(face_index);
/* Check parameters */
{
FT_Int i;
for (i = 0; i < num_params; i++)
{
if (params[i].tag == FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY)
ignore_preferred_family = TRUE;
else if (params[i].tag == FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY)
ignore_preferred_subfamily = TRUE;
}
}
/* Load tables */
/* We now support two SFNT-based bitmapped font formats. They */
/* are recognized easily as they do not include a `glyf' */
/* table. */
/* */
/* The first format comes from Apple, and uses a table named */
/* `bhed' instead of `head' to store the font header (using */
/* the same format). It also doesn't include horizontal and */
/* vertical metrics tables (i.e. `hhea' and `vhea' tables are */
/* missing). */
/* */
/* The other format comes from Microsoft, and is used with */
/* WinCE/PocketPC. It looks like a standard TTF, except that */
/* it doesn't contain outlines. */
/* */
FT_TRACE2(("sfnt_load_face: %08p\n\n", face));
/* do we have outlines in there? */
#ifdef FT_CONFIG_OPTION_INCREMENTAL
has_outline = FT_BOOL(face->root.internal->incremental_interface != 0 ||
tt_face_lookup_table(face, TTAG_glyf) != 0 ||
tt_face_lookup_table(face, TTAG_CFF) != 0);
#else
has_outline = FT_BOOL(tt_face_lookup_table(face, TTAG_glyf) != 0 ||
tt_face_lookup_table(face, TTAG_CFF) != 0);
#endif
is_apple_sbit = 0;
/* if this font doesn't contain outlines, we try to load */
/* a `bhed' table */
if (!has_outline && sfnt->load_bhed)
{
LOAD_(bhed);
is_apple_sbit = FT_BOOL(!error);
}
/* load the font header (`head' table) if this isn't an Apple */
/* sbit font file */
if (!is_apple_sbit)
{
LOAD_(head);
if (error)
goto Exit;
}
if (face->header.Units_Per_EM == 0)
{
error = SFNT_Err_Invalid_Table;
goto Exit;
}
/* the following tables are often not present in embedded TrueType */
/* fonts within PDF documents, so don't check for them. */
LOAD_(maxp);
LOAD_(cmap);
/* the following tables are optional in PCL fonts -- */
/* don't check for errors */
LOAD_(name);
LOAD_(post);
//.........这里部分代码省略.........
示例12: sfnt_done_face
sfnt_done_face(TT_Face face)
{
FT_Memory memory;
SFNT_Service sfnt;
if (!face)
return;
memory = face->root.memory;
sfnt = (SFNT_Service)face->sfnt;
if (sfnt)
{
/* destroy the postscript names table if it is loaded */
if (sfnt->free_psnames)
sfnt->free_psnames(face);
/* destroy the embedded bitmaps table if it is loaded */
if (sfnt->free_eblc)
sfnt->free_eblc(face);
}
#ifdef TT_CONFIG_OPTION_BDF
/* freeing the embedded BDF properties */
tt_face_free_bdf_props(face);
#endif
/* freeing the kerning table */
tt_face_done_kern(face);
/* freeing the collection table */
FT_FREE(face->ttc_header.offsets);
face->ttc_header.count = 0;
/* freeing table directory */
FT_FREE(face->dir_tables);
face->num_tables = 0;
{
FT_Stream stream = FT_FACE_STREAM(face);
/* simply release the 'cmap' table frame */
FT_FRAME_RELEASE(face->cmap_table);
face->cmap_size = 0;
}
/* freeing the horizontal metrics */
#ifndef FT_CONFIG_OPTION_OLD_INTERNALS
{
FT_Stream stream = FT_FACE_STREAM(face);
FT_FRAME_RELEASE(face->horz_metrics);
FT_FRAME_RELEASE(face->vert_metrics);
face->horz_metrics_size = 0;
face->vert_metrics_size = 0;
}
#else
FT_FREE(face->horizontal.long_metrics);
FT_FREE(face->horizontal.short_metrics);
#endif
/* freeing the vertical ones, if any */
if (face->vertical_info)
{
FT_FREE(face->vertical.long_metrics);
FT_FREE(face->vertical.short_metrics);
face->vertical_info = 0;
}
/* freeing the gasp table */
FT_FREE(face->gasp.gaspRanges);
face->gasp.numRanges = 0;
/* freeing the name table */
if (sfnt)
sfnt->free_name(face);
/* freeing family and style name */
FT_FREE(face->root.family_name);
FT_FREE(face->root.style_name);
/* freeing sbit size table */
FT_FREE(face->root.available_sizes);
face->root.num_fixed_sizes = 0;
FT_FREE(face->postscript_name);
face->sfnt = 0;
}
示例13: cff_slot_load
cff_slot_load( CFF_GlyphSlot glyph,
CFF_Size size,
FT_UInt glyph_index,
FT_Int32 load_flags )
{
FT_Error error;
CFF_Decoder decoder;
PS_Decoder psdecoder;
TT_Face face = (TT_Face)glyph->root.face;
FT_Bool hinting, scaled, force_scaling;
CFF_Font cff = (CFF_Font)face->extra.data;
PSAux_Service psaux = (PSAux_Service)face->psaux;
const CFF_Decoder_Funcs decoder_funcs = psaux->cff_decoder_funcs;
FT_Matrix font_matrix;
FT_Vector font_offset;
force_scaling = FALSE;
/* in a CID-keyed font, consider `glyph_index' as a CID and map */
/* it immediately to the real glyph_index -- if it isn't a */
/* subsetted font, glyph_indices and CIDs are identical, though */
if ( cff->top_font.font_dict.cid_registry != 0xFFFFU &&
cff->charset.cids )
{
/* don't handle CID 0 (.notdef) which is directly mapped to GID 0 */
if ( glyph_index != 0 )
{
glyph_index = cff_charset_cid_to_gindex( &cff->charset,
glyph_index );
if ( glyph_index == 0 )
return FT_THROW( Invalid_Argument );
}
}
else if ( glyph_index >= cff->num_glyphs )
return FT_THROW( Invalid_Argument );
if ( load_flags & FT_LOAD_NO_RECURSE )
load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING;
glyph->x_scale = 0x10000L;
glyph->y_scale = 0x10000L;
if ( size )
{
glyph->x_scale = size->root.metrics.x_scale;
glyph->y_scale = size->root.metrics.y_scale;
}
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
/* try to load embedded bitmap if any */
/* */
/* XXX: The convention should be emphasized in */
/* the documents because it can be confusing. */
if ( size )
{
CFF_Face cff_face = (CFF_Face)size->root.face;
SFNT_Service sfnt = (SFNT_Service)cff_face->sfnt;
FT_Stream stream = cff_face->root.stream;
if ( size->strike_index != 0xFFFFFFFFUL &&
sfnt->load_eblc &&
( load_flags & FT_LOAD_NO_BITMAP ) == 0 )
{
TT_SBit_MetricsRec metrics;
error = sfnt->load_sbit_image( face,
size->strike_index,
glyph_index,
(FT_UInt)load_flags,
stream,
&glyph->root.bitmap,
&metrics );
if ( !error )
{
FT_Bool has_vertical_info;
FT_UShort advance;
FT_Short dummy;
glyph->root.outline.n_points = 0;
glyph->root.outline.n_contours = 0;
glyph->root.metrics.width = (FT_Pos)metrics.width << 6;
glyph->root.metrics.height = (FT_Pos)metrics.height << 6;
glyph->root.metrics.horiBearingX = (FT_Pos)metrics.horiBearingX << 6;
glyph->root.metrics.horiBearingY = (FT_Pos)metrics.horiBearingY << 6;
glyph->root.metrics.horiAdvance = (FT_Pos)metrics.horiAdvance << 6;
glyph->root.metrics.vertBearingX = (FT_Pos)metrics.vertBearingX << 6;
glyph->root.metrics.vertBearingY = (FT_Pos)metrics.vertBearingY << 6;
glyph->root.metrics.vertAdvance = (FT_Pos)metrics.vertAdvance << 6;
glyph->root.format = FT_GLYPH_FORMAT_BITMAP;
//.........这里部分代码省略.........
示例14: sfnt_load_face
sfnt_load_face( FT_Stream stream,
TT_Face face,
FT_Int face_index,
FT_Int num_params,
FT_Parameter* params )
{
FT_Error error, psnames_error;
FT_Bool has_outline;
FT_Bool is_apple_sbit;
SFNT_Service sfnt = (SFNT_Service)face->sfnt;
FT_UNUSED( face_index );
FT_UNUSED( num_params );
FT_UNUSED( params );
/* Load tables */
/* We now support two SFNT-based bitmapped font formats. They */
/* are recognized easily as they do not include a `glyf' */
/* table. */
/* */
/* The first format comes from Apple, and uses a table named */
/* `bhed' instead of `head' to store the font header (using */
/* the same format). It also doesn't include horizontal and */
/* vertical metrics tables (i.e. `hhea' and `vhea' tables are */
/* missing). */
/* */
/* The other format comes from Microsoft, and is used with */
/* WinCE/PocketPC. It looks like a standard TTF, except that */
/* it doesn't contain outlines. */
/* */
/* do we have outlines in there? */
#ifdef FT_CONFIG_OPTION_INCREMENTAL
has_outline = FT_BOOL( face->root.internal->incremental_interface != 0 ||
tt_face_lookup_table( face, TTAG_glyf ) != 0 ||
tt_face_lookup_table( face, TTAG_CFF ) != 0 );
#else
has_outline = FT_BOOL( tt_face_lookup_table( face, TTAG_glyf ) != 0 ||
tt_face_lookup_table( face, TTAG_CFF ) != 0 );
#endif
is_apple_sbit = 0;
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
/* if this font doesn't contain outlines, we try to load */
/* a `bhed' table */
if ( !has_outline )
is_apple_sbit = FT_BOOL( !LOAD_( bitmap_header ) );
#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
/* load the font header (`head' table) if this isn't an Apple */
/* sbit font file */
if ( !is_apple_sbit && LOAD_( header ) )
goto Exit;
/* the following tables are often not present in embedded TrueType */
/* fonts within PDF documents, so don't check for them. */
(void)LOAD_( max_profile );
(void)LOAD_( charmaps );
/* the following tables are optional in PCL fonts -- */
/* don't check for errors */
(void)LOAD_( names );
psnames_error = LOAD_( psnames );
/* do not load the metrics headers and tables if this is an Apple */
/* sbit font file */
if ( !is_apple_sbit )
{
/* load the `hhea' and `hmtx' tables at once */
error = sfnt->load_metrics( face, stream, 0 );
if ( error )
goto Exit;
/* try to load the `vhea' and `vmtx' tables at once */
error = sfnt->load_metrics( face, stream, 1 );
if ( error )
goto Exit;
if ( LOAD_( os2 ) )
goto Exit;
}
/* the optional tables */
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
/* embedded bitmap support. */
if ( sfnt->load_sbits && LOAD_( sbits ) )
{
/* return an error if this font file has no outlines */
if ( error == SFNT_Err_Table_Missing && has_outline )
error = SFNT_Err_Ok;
else
goto Exit;
//.........这里部分代码省略.........
示例15: Reset_SBit_Size
static FT_Error
Reset_SBit_Size( TT_Size size )
{
TT_Face face;
FT_Error error = TT_Err_Ok;
FT_ULong strike_index;
FT_Size_Metrics* metrics;
FT_Size_Metrics* sbit_metrics;
SFNT_Service sfnt;
metrics = &size->metrics;
if ( size->strike_index != 0xFFFFU )
return TT_Err_Ok;
face = (TT_Face)size->root.face;
sfnt = (SFNT_Service)face->sfnt;
sbit_metrics = &size->strike_metrics;
error = sfnt->set_sbit_strike( face,
metrics->x_ppem, metrics->y_ppem,
&strike_index );
if ( !error )
{
/* XXX: TODO: move this code to the SFNT module where it belongs */
#ifdef FT_OPTIMIZE_MEMORY
FT_Byte* strike = face->sbit_table + 8 + strike_index*48;
sbit_metrics->ascender = (FT_Char)strike[16] << 6; /* hori.ascender */
sbit_metrics->descender = (FT_Char)strike[17] << 6; /* hori.descender */
/* XXX: Is this correct? */
sbit_metrics->max_advance = ( (FT_Char)strike[22] + /* min_origin_SB */
strike[18] + /* max_width */
(FT_Char)strike[23] /* min_advance_SB */
) << 6;
#else /* !FT_OPTIMIZE_MEMORY */
TT_SBit_Strike strike = face->sbit_strikes + strike_index;
sbit_metrics->ascender = strike->hori.ascender << 6;
sbit_metrics->descender = strike->hori.descender << 6;
/* XXX: Is this correct? */
sbit_metrics->max_advance = ( strike->hori.min_origin_SB +
strike->hori.max_width +
strike->hori.min_advance_SB ) << 6;
#endif /* !FT_OPTIMIZE_MEMORY */
/* XXX: Is this correct? */
sbit_metrics->height = sbit_metrics->ascender -
sbit_metrics->descender;
sbit_metrics->x_ppem = metrics->x_ppem;
sbit_metrics->y_ppem = metrics->y_ppem;
size->strike_index = (FT_UInt)strike_index;
}
else
{
size->strike_index = 0xFFFFU;
sbit_metrics->x_ppem = 0;
sbit_metrics->y_ppem = 0;
sbit_metrics->ascender = 0;
sbit_metrics->descender = 0;
sbit_metrics->height = 0;
sbit_metrics->max_advance = 0;
}
return error;
}