* src/*: More fixes for using a '\n' in `FT_TRACE` and `FT_ERROR`.

This commit is contained in:
Werner Lemberg 2020-12-07 10:29:24 +01:00
parent 015a9b8d8f
commit 272ae5ee2a
6 changed files with 46 additions and 42 deletions

View File

@ -1,3 +1,7 @@
2020-12-07 Werner Lemberg <wl@gnu.org>
* src/*: More fixes for using a '\n' in `FT_TRACE` and `FT_ERROR`.
2020-12-07 Werner Lemberg <wl@gnu.org> 2020-12-07 Werner Lemberg <wl@gnu.org>
*/*: s/FT_LOGGING/FT_DEBUG_LOGGING/. */*: s/FT_LOGGING/FT_DEBUG_LOGGING/.

View File

@ -1274,29 +1274,28 @@
if ( dist == 0 ) if ( dist == 0 )
{ {
FT_TRACE5(( FT_TRACE5(( "af_latin_metrics_scale_dim:"
"af_latin_metrics_scale_dim:" " x height alignment (style `%s'):\n",
" x height alignment (style `%s'):\n" af_style_names[metrics->root.style_class->style] ));
" " FT_TRACE5(( " "
" vertical scaling changed from %.5f to %.5f (by %ld%%)\n" " vertical scaling changed"
"\n", " from %.5f to %.5f (by %ld%%)\n",
af_style_names[metrics->root.style_class->style], scale / 65536.0,
scale / 65536.0, new_scale / 65536.0,
new_scale / 65536.0, ( fitted - scaled ) * 100 / scaled ));
( fitted - scaled ) * 100 / scaled )); FT_TRACE5(( "\n" ));
scale = new_scale; scale = new_scale;
} }
#ifdef FT_DEBUG_LEVEL_TRACE #ifdef FT_DEBUG_LEVEL_TRACE
else else
{ {
FT_TRACE5(( FT_TRACE5(( "af_latin_metrics_scale_dim:"
"af_latin_metrics_scale_dim:" " x height alignment (style `%s'):\n",
" x height alignment (style `%s'):\n" af_style_names[metrics->root.style_class->style] ));
" " FT_TRACE5(( " "
" excessive vertical scaling abandoned\n" " excessive vertical scaling abandoned\n" ));
"\n", FT_TRACE5(( "\n" ));
af_style_names[metrics->root.style_class->style] ));
} }
#endif #endif
} }

View File

@ -105,10 +105,11 @@ FT_BEGIN_HEADER
FT_Byte* pp = (FT_Byte*)_size ## _p; \ FT_Byte* pp = (FT_Byte*)_size ## _p; \
\ \
\ \
FT_TRACE3(( "\n" \ FT_TRACE3(( "\n" )); \
"Invalid offset to optional table `%s'" \ FT_TRACE3(( "Invalid offset to optional table `%s'" \
" set to zero.\n" \ " set to zero.\n", \
"\n", #_size )); \ #_size )); \
FT_TRACE3(( "\n" )); \
\ \
_size = pp[0] = pp[1] = 0; \ _size = pp[0] = pp[1] = 0; \
} \ } \
@ -127,10 +128,11 @@ FT_BEGIN_HEADER
FT_Byte* pp = (FT_Byte*)_size ## _p; \ FT_Byte* pp = (FT_Byte*)_size ## _p; \
\ \
\ \
FT_TRACE3(( "\n" \ FT_TRACE3(( "\n" )); \
"Invalid offset to optional table `%s'" \ FT_TRACE3(( "Invalid offset to optional table `%s'" \
" set to zero.\n" \ " set to zero.\n", \
"\n", #_size )); \ #_size )); \
FT_TRACE3(( "\n" )); \
\ \
_size = pp[0] = pp[1] = pp[2] = pp[3] = 0; \ _size = pp[0] = pp[1] = pp[2] = pp[3] = 0; \
} \ } \

View File

@ -1340,9 +1340,9 @@
if ( decoder->glyph_names == 0 ) if ( decoder->glyph_names == 0 )
#endif /* FT_CONFIG_OPTION_INCREMENTAL */ #endif /* FT_CONFIG_OPTION_INCREMENTAL */
{ {
FT_ERROR(( FT_ERROR(( "cf2_interpT2CharString:\n" ));
"cf2_interpT2CharString: (Type 1 seac)" FT_ERROR(( " (Type 1 seac) glyph names table"
" glyph names table not available in this font\n" )); " not available in this font\n" ));
lastError = FT_THROW( Invalid_Glyph_Format ); lastError = FT_THROW( Invalid_Glyph_Format );
goto exit; goto exit;
} }
@ -1368,9 +1368,9 @@
if ( bchar_index < 0 || achar_index < 0 ) if ( bchar_index < 0 || achar_index < 0 )
{ {
FT_ERROR(( FT_ERROR(( "cf2_interpT2CharString:\n" ));
"cf2_interpT2CharString: (Type 1 seac)" FT_ERROR(( " (Type 1 seac) invalid"
" invalid seac character code arguments\n" )); " seac character code arguments\n" ));
lastError = FT_THROW( Invalid_Glyph_Format ); lastError = FT_THROW( Invalid_Glyph_Format );
goto exit; goto exit;
} }

View File

@ -1852,11 +1852,10 @@
FT_NEW_ARRAY( indices, woff2.num_tables ) ) FT_NEW_ARRAY( indices, woff2.num_tables ) )
goto Exit; goto Exit;
FT_TRACE2(( FT_TRACE2(( "\n" ));
"\n" FT_TRACE2(( " tag flags transform origLen transformLen offset\n" ));
" tag flags transform origLen transformLen offset\n" FT_TRACE2(( " -----------------------------------------------------------\n" ));
" -----------------------------------------------------------\n" )); /* " XXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX" */
/* " XXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX" */
for ( nn = 0; nn < woff2.num_tables; nn++ ) for ( nn = 0; nn < woff2.num_tables; nn++ )
{ {

View File

@ -1852,12 +1852,12 @@
FT_TRACE5(( " %d: %.5f\n", i, coord / 65536.0 )); FT_TRACE5(( " %d: %.5f\n", i, coord / 65536.0 ));
if ( coord > a->maximum || coord < a->minimum ) if ( coord > a->maximum || coord < a->minimum )
{ {
FT_TRACE1(( FT_TRACE1(( "ft_var_to_normalized: design coordinate %.5f\n",
"ft_var_to_normalized: design coordinate %.5f\n" coord / 65536.0 ));
" is out of range [%.5f;%.5f]; clamping\n", FT_TRACE1(( " is out of range [%.5f;%.5f];"
coord / 65536.0, " clamping\n",
a->minimum / 65536.0, a->minimum / 65536.0,
a->maximum / 65536.0 )); a->maximum / 65536.0 ));
if ( coord > a->maximum ) if ( coord > a->maximum )
coord = a->maximum; coord = a->maximum;