Don’t print to stderr unless a standalone binary

We will use woff2 code from OTS and it is undesirable for a library to
print messages to stderr.
This commit is contained in:
Khaled Hosny
2015-08-28 01:19:56 +02:00
parent eeec219f20
commit 17ed658d0a
4 changed files with 34 additions and 12 deletions
+6 -2
View File
@@ -286,8 +286,10 @@ bool NormalizeFontCollection(FontCollection* font_collection) {
font_collection->fonts.size());
for (auto& font : font_collection->fonts) {
if (!NormalizeWithoutFixingChecksums(&font)) {
#ifdef FONT_COMPRESSION_BIN
fprintf(stderr, "Font normalization failed.\n");
return false;
#endif
return FONT_COMPRESSION_FAILURE();
}
offset += kSfntHeaderSize + kSfntEntrySize * font.num_tables;
}
@@ -308,8 +310,10 @@ bool NormalizeFontCollection(FontCollection* font_collection) {
// Now we can fix the checksums
for (auto& font : font_collection->fonts) {
if (!FixChecksums(&font)) {
#ifdef FONT_COMPRESSION_BIN
fprintf(stderr, "Failed to fix checksums\n");
return false;
#endif
return FONT_COMPRESSION_FAILURE();
}
}