本文整理汇总了C++中PSH_Globals_Funcs::set_scale方法的典型用法代码示例。如果您正苦于以下问题:C++ PSH_Globals_Funcs::set_scale方法的具体用法?C++ PSH_Globals_Funcs::set_scale怎么用?C++ PSH_Globals_Funcs::set_scale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PSH_Globals_Funcs
的用法示例。
在下文中一共展示了PSH_Globals_Funcs::set_scale方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
cff_size_select( FT_Size size,
FT_ULong strike_index )
{
CFF_Size cffsize = (CFF_Size)size;
PSH_Globals_Funcs funcs;
cffsize->strike_index = strike_index;
FT_Select_Metrics( size->face, strike_index );
funcs = cff_size_get_globals_funcs( cffsize );
if ( funcs )
{
CFF_Face face = (CFF_Face)size->face;
CFF_Font font = (CFF_Font)face->extra.data;
CFF_Internal internal = (CFF_Internal)size->internal;
FT_ULong top_upm = font->top_font.font_dict.units_per_em;
FT_UInt i;
funcs->set_scale( internal->topfont,
size->metrics.x_scale, size->metrics.y_scale,
0, 0 );
for ( i = font->num_subfonts; i > 0; i-- )
{
CFF_SubFont sub = font->subfonts[i - 1];
FT_ULong sub_upm = sub->font_dict.units_per_em;
FT_Pos x_scale, y_scale;
if ( top_upm != sub_upm )
{
x_scale = FT_MulDiv( size->metrics.x_scale, top_upm, sub_upm );
y_scale = FT_MulDiv( size->metrics.y_scale, top_upm, sub_upm );
}
else
{
x_scale = size->metrics.x_scale;
y_scale = size->metrics.y_scale;
}
funcs->set_scale( internal->subfonts[i - 1],
x_scale, y_scale, 0, 0 );
}
}
return FT_Err_Ok;
}
示例2:
T1_Size_Request( T1_Size size,
FT_Size_Request req )
{
PSH_Globals_Funcs funcs = T1_Size_Get_Globals_Funcs( size );
FT_Request_Metrics( size->root.face, req );
if ( funcs )
funcs->set_scale( (PSH_Globals)size->root.internal,
size->root.metrics.x_scale,
size->root.metrics.y_scale,
0, 0 );
return T1_Err_Ok;
}
示例3:
T1_Size_Request( FT_Size t1size, /* T1_Size */
FT_Size_Request req )
{
T1_Size size = (T1_Size)t1size;
PSH_Globals_Funcs funcs = T1_Size_Get_Globals_Funcs( size );
FT_Request_Metrics( size->root.face, req );
if ( funcs )
funcs->set_scale( (PSH_Globals)t1size->internal->module_data,
size->root.metrics.x_scale,
size->root.metrics.y_scale,
0, 0 );
return FT_Err_Ok;
}
示例4:
cid_size_request( FT_Size size,
FT_Size_Request req )
{
PSH_Globals_Funcs funcs;
FT_Request_Metrics( size->face, req );
funcs = cid_size_get_globals_funcs( (CID_Size)size );
if ( funcs )
funcs->set_scale( (PSH_Globals)size->internal,
size->metrics.x_scale,
size->metrics.y_scale,
0, 0 );
return CID_Err_Ok;
}
示例5:
cid_size_reset( FT_Size cidsize, /* CID_Size */
FT_UInt char_width,
FT_UInt char_height )
{
CID_Size size = (CID_Size)cidsize;
PSH_Globals_Funcs funcs = cid_size_get_globals_funcs( size );
FT_Error error = 0;
FT_UNUSED( char_width );
FT_UNUSED( char_height );
if ( funcs )
error = funcs->set_scale( (PSH_Globals)cidsize->internal,
cidsize->metrics.x_scale,
cidsize->metrics.y_scale,
0, 0 );
return error;
}
示例6: cff_size_select
cff_size_request( FT_Size size,
FT_Size_Request req )
{
CFF_Size cffsize = (CFF_Size)size;
PSH_Globals_Funcs funcs;
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
if ( FT_HAS_FIXED_SIZES( size->face ) )
{
CFF_Face cffface = (CFF_Face)size->face;
SFNT_Service sfnt = (SFNT_Service)cffface->sfnt;
FT_ULong strike_index;
if ( sfnt->set_sbit_strike( cffface, req, &strike_index ) )
cffsize->strike_index = 0xFFFFFFFFUL;
else
return cff_size_select( size, strike_index );
}
#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
FT_Request_Metrics( size->face, req );
funcs = cff_size_get_globals_funcs( cffsize );
if ( funcs )
{
CFF_Face cffface = (CFF_Face)size->face;
CFF_Font font = (CFF_Font)cffface->extra.data;
CFF_Internal internal = (CFF_Internal)size->internal;
FT_ULong top_upm = font->top_font.font_dict.units_per_em;
FT_UInt i;
funcs->set_scale( internal->topfont,
size->metrics.x_scale, size->metrics.y_scale,
0, 0 );
for ( i = font->num_subfonts; i > 0; i-- )
{
CFF_SubFont sub = font->subfonts[i - 1];
FT_ULong sub_upm = sub->font_dict.units_per_em;
FT_Pos x_scale, y_scale;
if ( top_upm != sub_upm )
{
x_scale = FT_MulDiv( size->metrics.x_scale, top_upm, sub_upm );
y_scale = FT_MulDiv( size->metrics.y_scale, top_upm, sub_upm );
}
else
{
x_scale = size->metrics.x_scale;
y_scale = size->metrics.y_scale;
}
funcs->set_scale( internal->subfonts[i - 1],
x_scale, y_scale, 0, 0 );
}
}
return FT_Err_Ok;
}