本文整理汇总了C++中FT_TRACE0函数的典型用法代码示例。如果您正苦于以下问题:C++ FT_TRACE0函数的具体用法?C++ FT_TRACE0怎么用?C++ FT_TRACE0使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FT_TRACE0函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FTC_Manager_Check
static void
FTC_Manager_Check( FTC_Manager manager )
{
FTC_Node node, first;
first = manager->nodes_list;
/* check node weights */
if ( first )
{
FT_ULong weight = 0;
node = first;
do
{
FTC_Cache cache = manager->caches[node->cache_index];
if ( (FT_UInt)node->cache_index >= manager->num_caches )
FT_TRACE0(( "FTC_Manager_Check: invalid node (cache index = %ld\n",
node->cache_index ));
else
weight += cache->clazz.node_weight( node, cache );
node = FTC_NODE__NEXT( node );
} while ( node != first );
if ( weight != manager->cur_weight )
FT_TRACE0(( "FTC_Manager_Check: invalid weight %ld instead of %ld\n",
manager->cur_weight, weight ));
}
/* check circular list */
if ( first )
{
FT_UFast count = 0;
node = first;
do
{
count++;
node = FTC_NODE__NEXT( node );
} while ( node != first );
if ( count != manager->num_nodes )
FT_TRACE0(( "FTC_Manager_Check:"
" invalid cache node count %d instead of %d\n",
manager->num_nodes, count ));
}
}
示例2: tt_property_set
/*
* PROPERTY SERVICE
*
*/
static FT_Error
tt_property_set( FT_Module module, /* TT_Driver */
const char* property_name,
const void* value )
{
FT_Error error = FT_Err_Ok;
TT_Driver driver = (TT_Driver)module;
if ( !ft_strcmp( property_name, "interpreter-version" ) )
{
FT_UInt* interpreter_version = (FT_UInt*)value;
#ifndef TT_CONFIG_OPTION_SUBPIXEL_HINTING
if ( *interpreter_version != TT_INTERPRETER_VERSION_35 )
error = FT_ERR( Unimplemented_Feature );
else
#endif
driver->interpreter_version = *interpreter_version;
return error;
}
FT_TRACE0(( "tt_property_set: missing property `%s'\n",
property_name ));
return FT_THROW( Missing_Property );
}
示例3: FT_Add_Default_Modules
FT_Add_Default_Modules( FT_Library library )
{
FT_Error error;
const FT_Module_Class* const* cur;
/* FT_DEFAULT_MODULES_GET dereferences `library' in PIC mode */
#ifdef FT_CONFIG_OPTION_PIC
if ( !library )
return;
#endif
/* GCC 4.6 warns the type difference:
* FT_Module_Class** != const FT_Module_Class* const*
*/
cur = (const FT_Module_Class* const*)FT_DEFAULT_MODULES_GET;
/* test for valid `library' delayed to FT_Add_Module() */
while ( *cur )
{
error = FT_Add_Module( library, *cur );
/* notify errors, but don't stop */
if ( error )
FT_TRACE0(( "FT_Add_Default_Module:"
" Cannot install `%s', error = 0x%x\n",
(*cur)->module_name, error ));
cur++;
}
}
示例4: af_property_set
FT_Error
af_property_set( FT_Module ft_module,
const char* property_name,
const void* value )
{
FT_Error error = FT_Err_Ok;
AF_Module module = (AF_Module)ft_module;
if ( !ft_strcmp( property_name, "fallback-script" ) )
{
FT_UInt* fallback_script = (FT_UInt*)value;
module->fallback_script = *fallback_script;
return error;
}
else if ( !ft_strcmp( property_name, "increase-x-height" ) )
{
FT_Prop_IncreaseXHeight* prop = (FT_Prop_IncreaseXHeight*)value;
AF_FaceGlobals globals;
error = af_property_get_face_globals( prop->face, &globals, module );
if ( !error )
globals->increase_x_height = prop->limit;
return error;
}
FT_TRACE0(( "af_property_get: missing property `%s'\n",
property_name ));
return FT_THROW( Missing_Property );
}
示例5: sfnt_get_name_index
static FT_UInt
sfnt_get_name_index( TT_Face face,
FT_String* glyph_name )
{
FT_Face root = &face->root;
FT_UInt i, max_gid = FT_UINT_MAX;
if ( root->num_glyphs < 0 )
return 0;
else if ( ( FT_ULong ) root->num_glyphs < FT_UINT_MAX )
max_gid = ( FT_UInt ) root->num_glyphs;
else
FT_TRACE0(( "Ignore glyph names for invalid GID 0x%08x - 0x%08x\n",
FT_UINT_MAX, root->num_glyphs ));
for ( i = 0; i < max_gid; i++ )
{
FT_String* gname;
FT_Error error = tt_face_get_ps_name( face, i, &gname );
if ( error )
continue;
if ( !ft_strcmp( glyph_name, gname ) )
return i;
}
return 0;
}
示例6: cff_property_get
static FT_Error
cff_property_get( FT_Module module, /* CFF_Driver */
const char* property_name,
const void* value )
{
FT_Error error = FT_Err_Ok;
CFF_Driver driver = (CFF_Driver)module;
FT_UInt hinting_engine = driver->hinting_engine;
FT_Bool no_stem_darkening = driver->no_stem_darkening;
if ( !ft_strcmp( property_name, "hinting-engine" ) )
{
FT_UInt* val = (FT_UInt*)value;
*val = hinting_engine;
return error;
}
else if ( !ft_strcmp( property_name, "no-stem-darkening" ) )
{
FT_Bool* val = (FT_Bool*)value;
*val = no_stem_darkening;
return error;
}
FT_TRACE0(( "cff_property_get: missing property `%s'\n",
property_name ));
return FT_THROW( Missing_Property );
}
示例7: tt_property_get
static FT_Error
tt_property_get( FT_Module module, /* TT_Driver */
const char* property_name,
const void* value )
{
FT_Error error = FT_Err_Ok;
TT_Driver driver = (TT_Driver)module;
FT_UInt interpreter_version = driver->interpreter_version;
if ( !ft_strcmp( property_name, "interpreter-version" ) )
{
FT_UInt* val = (FT_UInt*)value;
*val = interpreter_version;
return error;
}
FT_TRACE0(( "tt_property_get: missing property `%s'\n",
property_name ));
return FT_THROW( Missing_Property );
}
示例8: tt_property_set
/*
* PROPERTY SERVICE
*
*/
static FT_Error
tt_property_set( FT_Module module, /* TT_Driver */
const char* property_name,
const void* value,
FT_Bool value_is_string )
{
FT_Error error = FT_Err_Ok;
TT_Driver driver = (TT_Driver)module;
#ifndef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
FT_UNUSED( value_is_string );
#endif
if ( !ft_strcmp( property_name, "interpreter-version" ) )
{
FT_UInt interpreter_version;
#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
if ( value_is_string )
{
const char* s = (const char*)value;
interpreter_version = (FT_UInt)ft_strtol( s, NULL, 10 );
}
else
#endif
{
FT_UInt* iv = (FT_UInt*)value;
interpreter_version = *iv;
}
if ( interpreter_version == TT_INTERPRETER_VERSION_35
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|| interpreter_version == TT_INTERPRETER_VERSION_38
#endif
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|| interpreter_version == TT_INTERPRETER_VERSION_40
#endif
)
driver->interpreter_version = interpreter_version;
else
error = FT_ERR( Unimplemented_Feature );
return error;
}
FT_TRACE0(( "tt_property_set: missing property `%s'\n",
property_name ));
return FT_THROW( Missing_Property );
}
示例9: cff_property_get
static FT_Error
cff_property_get( FT_Module module, /* CFF_Driver */
const char* property_name,
const void* value )
{
FT_Error error = FT_Err_Ok;
CFF_Driver driver = (CFF_Driver)module;
if ( !ft_strcmp( property_name, "darkening-parameters" ) )
{
FT_Int* darken_params = driver->darken_params;
FT_Int* val = (FT_Int*)value;
val[0] = darken_params[0];
val[1] = darken_params[1];
val[2] = darken_params[2];
val[3] = darken_params[3];
val[4] = darken_params[4];
val[5] = darken_params[5];
val[6] = darken_params[6];
val[7] = darken_params[7];
return error;
}
else if ( !ft_strcmp( property_name, "hinting-engine" ) )
{
FT_UInt hinting_engine = driver->hinting_engine;
FT_UInt* val = (FT_UInt*)value;
*val = hinting_engine;
return error;
}
else if ( !ft_strcmp( property_name, "no-stem-darkening" ) )
{
FT_Bool no_stem_darkening = driver->no_stem_darkening;
FT_Bool* val = (FT_Bool*)value;
*val = no_stem_darkening;
return error;
}
FT_TRACE0(( "cff_property_get: missing property `%s'\n",
property_name ));
return FT_THROW( Missing_Property );
}
示例10: CFF_Load_FD_Select
static FT_Error
CFF_Load_FD_Select( CFF_FDSelect fdselect,
FT_UInt num_glyphs,
FT_Stream stream,
FT_ULong offset )
{
FT_Error error;
FT_Byte format;
FT_UInt num_ranges;
/* read format */
if ( FT_STREAM_SEEK( offset ) || FT_READ_BYTE( format ) )
goto Exit;
fdselect->format = format;
fdselect->cache_count = 0; /* clear cache */
switch ( format )
{
case 0: /* format 0, that's simple */
fdselect->data_size = num_glyphs;
goto Load_Data;
case 3: /* format 3, a tad more complex */
if ( FT_READ_USHORT( num_ranges ) )
goto Exit;
if ( !num_ranges )
{
FT_TRACE0(( "CFF_Load_FD_Select: empty FDSelect array\n" ));
error = FT_THROW( Invalid_File_Format );
goto Exit;
}
fdselect->data_size = num_ranges * 3 + 2;
Load_Data:
if ( FT_FRAME_EXTRACT( fdselect->data_size, fdselect->data ) )
goto Exit;
break;
default: /* hmm... that's wrong */
error = FT_THROW( Invalid_File_Format );
}
Exit:
return error;
}
示例11: af_property_get
FT_Error
af_property_get( FT_Module ft_module,
const char* property_name,
void* value )
{
FT_Error error = FT_Err_Ok;
AF_Module module = (AF_Module)ft_module;
FT_UInt fallback_script = module->fallback_script;
if ( !ft_strcmp( property_name, "glyph-to-script-map" ) )
{
FT_Prop_GlyphToScriptMap* prop = (FT_Prop_GlyphToScriptMap*)value;
AF_FaceGlobals globals;
error = af_property_get_face_globals( prop->face, &globals, module );
if ( !error )
prop->map = globals->glyph_scripts;
return error;
}
else if ( !ft_strcmp( property_name, "fallback-script" ) )
{
FT_UInt* val = (FT_UInt*)value;
*val = fallback_script;
return error;
}
else if ( !ft_strcmp( property_name, "increase-x-height" ) )
{
FT_Prop_IncreaseXHeight* prop = (FT_Prop_IncreaseXHeight*)value;
AF_FaceGlobals globals;
error = af_property_get_face_globals( prop->face, &globals, module );
if ( !error )
prop->limit = globals->increase_x_height;
return error;
}
FT_TRACE0(( "af_property_get: missing property `%s'\n",
property_name ));
return FT_THROW( Missing_Property );
}
示例12: FT_Add_Default_Modules
FT_Add_Default_Modules( FT_Library library )
{
FT_Error error;
const FT_Module_Class* const* cur;
/* test for valid `library' delayed to FT_Add_Module() */
cur = FT_DEFAULT_MODULES_GET;
while ( *cur )
{
error = FT_Add_Module( library, *cur );
/* notify errors, but don't stop */
if ( error )
FT_TRACE0(( "FT_Add_Default_Module:"
" Cannot install `%s', error = 0x%x\n",
(*cur)->module_name, error ));
cur++;
}
}
示例13: FTC_Manager_Compress
FTC_Manager_Compress( FTC_Manager manager )
{
FTC_Node node, first;
if ( !manager )
return;
first = manager->nodes_list;
#ifdef FT_DEBUG_ERROR
FTC_Manager_Check( manager );
FT_TRACE0(( "compressing, weight = %ld, max = %ld, nodes = %d\n",
manager->cur_weight, manager->max_weight,
manager->num_nodes ));
#endif
if ( manager->cur_weight < manager->max_weight || first == NULL )
return;
/* go to last node -- it's a circular list */
node = FTC_NODE__PREV( first );
do
{
FTC_Node prev;
prev = ( node == first ) ? NULL : FTC_NODE__PREV( node );
if ( node->ref_count <= 0 )
ftc_node_destroy( node, manager );
node = prev;
} while ( node && manager->cur_weight > manager->max_weight );
}
示例14: cff_property_set
/*
* PROPERTY SERVICE
*
*/
static FT_Error
cff_property_set( FT_Module module, /* CFF_Driver */
const char* property_name,
const void* value )
{
FT_Error error = FT_Err_Ok;
CFF_Driver driver = (CFF_Driver)module;
if ( !ft_strcmp( property_name, "hinting-engine" ) )
{
FT_UInt* hinting_engine = (FT_UInt*)value;
#ifndef CFF_CONFIG_OPTION_OLD_ENGINE
if ( *hinting_engine != FT_CFF_HINTING_ADOBE )
error = FT_ERR( Unimplemented_Feature );
else
#endif
driver->hinting_engine = *hinting_engine;
return error;
}
else if ( !ft_strcmp( property_name, "no-stem-darkening" ) )
{
FT_Bool* no_stem_darkening = (FT_Bool*)value;
driver->no_stem_darkening = *no_stem_darkening;
return error;
}
FT_TRACE0(( "cff_property_set: missing property `%s'\n",
property_name ));
return FT_THROW( Missing_Property );
}
示例15: cid_load_glyph
cid_load_glyph( T1_Decoder decoder,
FT_UInt glyph_index )
{
CID_Face face = (CID_Face)decoder->builder.face;
CID_FaceInfo cid = &face->cid;
FT_Byte* p;
FT_ULong fd_select;
FT_Stream stream = face->cid_stream;
FT_Error error = FT_Err_Ok;
FT_Byte* charstring = NULL;
FT_Memory memory = face->root.memory;
FT_ULong glyph_length = 0;
PSAux_Service psaux = (PSAux_Service)face->psaux;
#ifdef FT_CONFIG_OPTION_INCREMENTAL
FT_Incremental_InterfaceRec *inc =
face->root.internal->incremental_interface;
#endif
FT_TRACE1(( "cid_load_glyph: glyph index %d\n", glyph_index ));
#ifdef FT_CONFIG_OPTION_INCREMENTAL
/* For incremental fonts get the character data using */
/* the callback function. */
if ( inc )
{
FT_Data glyph_data;
error = inc->funcs->get_glyph_data( inc->object,
glyph_index, &glyph_data );
if ( error )
goto Exit;
p = (FT_Byte*)glyph_data.pointer;
fd_select = cid_get_offset( &p, (FT_Byte)cid->fd_bytes );
if ( glyph_data.length != 0 )
{
glyph_length = (FT_ULong)( glyph_data.length - cid->fd_bytes );
(void)FT_ALLOC( charstring, glyph_length );
if ( !error )
ft_memcpy( charstring, glyph_data.pointer + cid->fd_bytes,
glyph_length );
}
inc->funcs->free_glyph_data( inc->object, &glyph_data );
if ( error )
goto Exit;
}
else
#endif /* FT_CONFIG_OPTION_INCREMENTAL */
/* For ordinary fonts read the CID font dictionary index */
/* and charstring offset from the CIDMap. */
{
FT_UInt entry_len = (FT_UInt)( cid->fd_bytes + cid->gd_bytes );
FT_ULong off1, off2;
if ( FT_STREAM_SEEK( cid->data_offset + cid->cidmap_offset +
glyph_index * entry_len ) ||
FT_FRAME_ENTER( 2 * entry_len ) )
goto Exit;
p = (FT_Byte*)stream->cursor;
fd_select = cid_get_offset( &p, (FT_Byte)cid->fd_bytes );
off1 = cid_get_offset( &p, (FT_Byte)cid->gd_bytes );
p += cid->fd_bytes;
off2 = cid_get_offset( &p, (FT_Byte)cid->gd_bytes );
FT_FRAME_EXIT();
if ( fd_select >= (FT_ULong)cid->num_dicts ||
off2 > stream->size ||
off1 > off2 )
{
FT_TRACE0(( "cid_load_glyph: invalid glyph stream offsets\n" ));
error = FT_THROW( Invalid_Offset );
goto Exit;
}
glyph_length = off2 - off1;
if ( glyph_length == 0 )
goto Exit;
if ( FT_ALLOC( charstring, glyph_length ) )
goto Exit;
if ( FT_STREAM_READ_AT( cid->data_offset + off1,
charstring, glyph_length ) )
goto Exit;
}
/* Now set up the subrs array and parse the charstrings. */
{
CID_FaceDict dict;
CID_Subrs cid_subrs = face->subrs + fd_select;
//.........这里部分代码省略.........