[autofit] Improve tracing of style coverages.

* include/internal/fttrace.h: Add `afglobal' for tracing style
coverages.

* src/autofit/afglobal.c: Include FT_INTERNAL_DEBUG_H.
(FT_COMPONENT): Define.
(af_face_globals_compute_style_coverage): Trace `gstyles' array
data.
This commit is contained in:
Werner Lemberg 2014-01-16 08:55:40 +01:00
parent 2b623fe4f6
commit 6a700786ae
3 changed files with 64 additions and 1 deletions

View File

@ -1,3 +1,15 @@
2014-01-16 Werner Lemberg <wl@gnu.org>
[autofit] Improve tracing of style coverages.
* include/internal/fttrace.h: Add `afglobal' for tracing style
coverages.
* src/autofit/afglobal.c: Include FT_INTERNAL_DEBUG_H.
(FT_COMPONENT): Define.
(af_face_globals_compute_style_coverage): Trace `gstyles' array
data.
2014-01-09 Werner Lemberg <wl@gnu.org>
Fix Savannah bug #41158.

View File

@ -4,7 +4,7 @@
/* */
/* Tracing handling (specification only). */
/* */
/* Copyright 2002, 2004-2007, 2009, 2011-2013 by */
/* Copyright 2002, 2004-2007, 2009, 2011-2014 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -149,5 +149,6 @@ FT_TRACE_DEF( aflatin )
FT_TRACE_DEF( aflatin2 )
FT_TRACE_DEF( afwarp )
FT_TRACE_DEF( afharfbuzz )
FT_TRACE_DEF( afglobal )
/* END */

View File

@ -19,6 +19,17 @@
#include "afglobal.h"
#include "afranges.h"
#include "hbshim.h"
#include FT_INTERNAL_DEBUG_H
/*************************************************************************/
/* */
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
/* messages during execution. */
/* */
#undef FT_COMPONENT
#define FT_COMPONENT trace_afglobal
/* get writing system specific header files */
@ -246,6 +257,45 @@
}
}
#ifdef FT_DEBUG_LEVEL_TRACE
FT_TRACE4(( "\n"
"style coverage\n"
"==============\n"
"\n" ));
for ( ss = 0; AF_STYLE_CLASSES_GET[ss]; ss++ )
{
AF_StyleClass style_class = AF_STYLE_CLASSES_GET[ss];
FT_UInt count = 0;
FT_Long idx;
FT_TRACE4(( "%s:\n", af_style_names[style_class->style] ));
for ( idx = 0; idx < globals->glyph_count; idx++ )
{
if ( ( gstyles[idx] & ~AF_DIGIT ) == style_class->style )
{
if ( !( count % 10 ) )
FT_TRACE4(( " " ));
FT_TRACE4(( " %d", idx ));
count++;
if ( !( count % 10 ) )
FT_TRACE4(( "\n" ));
}
}
if ( !count )
FT_TRACE4(( " (none)\n" ));
if ( count % 10 )
FT_TRACE4(( "\n" ));
}
#endif /* FT_DEBUG_LEVEL_TRACE */
FT_Set_Charmap( face, old_charmap );
return error;
}