Index: src/core/SkTypeface.cpp |
diff --git a/src/core/SkTypeface.cpp b/src/core/SkTypeface.cpp |
index c94e22f2bc1bfaaeeb947320a6a0116806e5ddae..0e544c2f67323a5b0c7977781dc233d1262aecfd 100644 |
--- a/src/core/SkTypeface.cpp |
+++ b/src/core/SkTypeface.cpp |
@@ -203,6 +203,23 @@ SkTypeface* SkTypeface::Deserialize(SkStream* stream) { |
/////////////////////////////////////////////////////////////////////////////// |
+bool SkTypeface::canEmbed() const { return this->onCanEmbed(); } |
+ |
+bool SkTypeface::onCanEmbed() const { |
+ struct SkOTTableOS2 os2table; |
+ if (this->getTableData( |
+ SkTEndian_SwapBE32(SkOTTableOS2::TAG), 0, |
+ sizeof(os2table), &os2table) > 0) { |
+ if (os2table.version.v2.fsType.field.Bitmap || |
+ (os2table.version.v2.fsType.field.Restricted && |
+ !(os2table.version.v2.fsType.field.PreviewPrint || |
+ os2table.version.v2.fsType.field.Editable))) { |
+ return false; |
+ } |
+ } |
+ return true; |
+} |
+ |
int SkTypeface::countTables() const { |
return this->onGetTableTags(NULL); |
} |