Index: src/core/SkTypeface.cpp |
diff --git a/src/core/SkTypeface.cpp b/src/core/SkTypeface.cpp |
index c537d4aa2d8c46e9d78de06c346f1e0e89094a16..02d2bc89c01ecdebe8a01ccd4a93f3ae3ab2f4b1 100644 |
--- a/src/core/SkTypeface.cpp |
+++ b/src/core/SkTypeface.cpp |
@@ -155,12 +155,26 @@ void SkTypeface::serialize(SkWStream* wstream) const { |
SkFontDescriptor desc(this->style()); |
this->onGetFontDescriptor(&desc, &isLocal); |
+ // Embed font data if it's a local font. |
if (isLocal && NULL == desc.getFontData()) { |
int ttcIndex; |
desc.setFontData(this->onOpenStream(&ttcIndex)); |
desc.setFontIndex(ttcIndex); |
} |
+ desc.serialize(wstream); |
+} |
+ |
+void SkTypeface::serializeForcingEmbedding(SkWStream* wstream) const { |
+ bool ignoredIsLocal; |
+ SkFontDescriptor desc(this->style()); |
+ this->onGetFontDescriptor(&desc, &ignoredIsLocal); |
+ // Always embed font data. |
+ if (NULL == desc.getFontData()) { |
+ int ttcIndex; |
+ desc.setFontData(this->onOpenStream(&ttcIndex)); |
+ desc.setFontIndex(ttcIndex); |
+ } |
desc.serialize(wstream); |
} |