diff options
-rw-r--r-- | src/pdf/SkPDFFont.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/pdf/SkPDFFont.cpp b/src/pdf/SkPDFFont.cpp index 682f721c26..db9a177dc2 100644 --- a/src/pdf/SkPDFFont.cpp +++ b/src/pdf/SkPDFFont.cpp @@ -368,9 +368,11 @@ void SkPDFType0Font::getFontSubset(SkPDFCanon* canon) { int ttcIndex; std::unique_ptr<SkStreamAsset> fontAsset(face->openStream(&ttcIndex)); size_t fontSize = fontAsset ? fontAsset->getLength() : 0; - SkASSERT(fontAsset); - SkASSERT(fontSize > 0); - if (fontSize > 0) { + if (0 == fontSize) { + SkDebugf("Error: (SkTypeface)(%p)::openStream() returned " + "empty stream (%p) when identified as kType1CID_Font " + "or kTrueType_Font.\n", face, fontAsset.get()); + } else { switch (type) { case SkAdvancedTypefaceMetrics::kTrueType_Font: { #ifdef SK_PDF_USE_SFNTLY |