Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Unified Diff: src/core/SkTypeface.cpp

Issue 796523002: Force embedding full font when serializing pictures. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Whitelist Linux instead. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkPictureData.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « src/core/SkPictureData.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698