diff options
Diffstat (limited to 'vcl/source/fontsubset/sft.cxx')
-rw-r--r-- | vcl/source/fontsubset/sft.cxx | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx index cd3e6bbd2a2c..efba8ff594f3 100644 --- a/vcl/source/fontsubset/sft.cxx +++ b/vcl/source/fontsubset/sft.cxx @@ -520,14 +520,16 @@ static int GetCompoundTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPo if( std::find( glyphlist.begin(), glyphlist.end(), index ) != glyphlist.end() ) { #if OSL_DEBUG_LEVEL > 1 - fprintf(stderr, "Endless loop found in a compound glyph.\n"); - fprintf(stderr, "%d -> ", index); - fprintf(stderr," ["); + SAL_INFO("vcl.fonts", "Endless loop found in a compound glyph."); + + std::ostringstream oss; + oss << index << " -> ["; for( const auto& rGlyph : glyphlist ) { - fprintf( stderr,"%d ", (int) rGlyph ); + oss << (int) rGlyph << " "; } - fprintf(stderr,"]\n"); + oss << "]"; + SAL_INFO("vcl.fonts", oss.str()); /**/ #endif } @@ -538,7 +540,7 @@ static int GetCompoundTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPo { /* XXX that probably indicates a corrupted font */ #if OSL_DEBUG_LEVEL > 1 - fprintf(stderr, "An empty compound!\n"); + SAL_WARN("vcl.fonts", "An empty compound!"); /* assert(!"An empty compound"); */ #endif } @@ -905,7 +907,7 @@ static void GetNames(TrueTypeFont *t) if (nTableSize < 6) { #if OSL_DEBUG_LEVEL > 1 - fprintf(stderr, "O_name table too small\n"); + SAL_WARN("vcl.fonts", "O_name table too small."); #endif return; } @@ -1333,7 +1335,9 @@ static void FindCmap(TrueTypeFont *ttf) default: #if OSL_DEBUG_LEVEL > 1 /*- if the cmap table is really broken */ - printf("%s: %d is not a recognized cmap format.\n", ttf->fname, GetUInt16(ttf->cmap, 0)); + SAL_WARN("vcl.fonts", ttf->fname << ": " + << GetUInt16(ttf->cmap, 0) + << " is not a recognized cmap format.."); #endif ttf->cmapType = CMAP_NOT_USABLE; ttf->cmap = nullptr; @@ -1594,8 +1598,10 @@ static SFErrCodes doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t ) if( t->tables[i] < t->ptr ) { #if OSL_DEBUG_LEVEL > 1 - if( t->tables[i] ) - fprintf( stderr, "font file %s has bad table offset %" SAL_PRI_PTRDIFFT "d (tagnum=%d)\n", t->fname, (sal_uInt8*)t->tables[i]-t->ptr, i ); + SAL_WARN_IF(t->tables[i], "vcl.fonts", "font file " << t->fname + << " has bad table offset " + << (sal_uInt8*)t->tables[i]-t->ptr + << "d (tagnum=" << i << ")."); #endif t->tlens[i] = 0; t->tables[i] = nullptr; @@ -1607,7 +1613,8 @@ static SFErrCodes doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t ) nMaxLen = 0; t->tlens[i] = nMaxLen; #if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "font file %s has too big table (tagnum=%d)\n", t->fname, i ); + SAL_WARN("vcl.fonts", "font file " << t->fname + << " has too big table (tagnum=" << i << ")."); #endif } } @@ -1991,11 +1998,11 @@ SFErrCodes CreateTTFromTTGlyphs(TrueTypeFont *ttf, AddTable(ttcr, cvt ); AddTable(ttcr, prep); AddTable(ttcr, fpgm); AddTable(ttcr, post); AddTable(ttcr, os2); - if ((res = StreamToFile(ttcr, fname)) != SFErrCodes::Ok) { + res = StreamToFile(ttcr, fname); #if OSL_DEBUG_LEVEL > 1 - fprintf(stderr, "StreamToFile: error code: %d.\n", int(res)); + SAL_WARN_IF(res != SFErrCodes::Ok, "vcl.fonts", "StreamToFile: error code: " + << (int) res << "."); #endif - } TrueTypeCreatorDispose(ttcr); free(gID); @@ -2504,7 +2511,7 @@ int GetTTNameRecords(TrueTypeFont const *ttf, NameRecord **nr) if (nTableSize < 6) { #if OSL_DEBUG_LEVEL > 1 - fprintf(stderr, "O_name table too small\n"); + SAL_WARN("vcl.fonts", "O_name table too small."); #endif return 0; } |