Index: src/ports/SkFontHost_win_dw.cpp |
diff --git a/src/ports/SkFontHost_win_dw.cpp b/src/ports/SkFontHost_win_dw.cpp |
index 3df743055ab40cbfd80e308c1114cd71f8664a5e..00623623b07d5081f799b2054a1770d63e3eca24 100644 |
--- a/src/ports/SkFontHost_win_dw.cpp |
+++ b/src/ports/SkFontHost_win_dw.cpp |
@@ -1490,9 +1490,10 @@ SkAdvancedTypefaceMetrics* DWriteFontTypeface::onGetAdvancedTypefaceMetrics( |
info = new SkAdvancedTypefaceMetrics; |
info->fEmSize = dwfm.designUnitsPerEm; |
+ info->fMultiMaster = false; |
info->fLastGlyphID = SkToU16(glyphCount - 1); |
info->fStyle = 0; |
- info->fFlags = SkAdvancedTypefaceMetrics::kEmpty_FontFlag; |
+ |
SkTScopedComPtr<IDWriteLocalizedStrings> familyNames; |
SkTScopedComPtr<IDWriteLocalizedStrings> faceNames; |
@@ -1600,7 +1601,12 @@ SkAdvancedTypefaceMetrics* DWriteFontTypeface::onGetAdvancedTypefaceMetrics( |
} |
*/ |
- if (perGlyphInfo & SkAdvancedTypefaceMetrics::kHAdvance_PerGlyphInfo) { |
+ // If Restricted, the font may not be embedded in a document. |
+ // If not Restricted, the font can be embedded. |
+ // If PreviewPrint, the embedding is read-only. |
+ if (os2Table->version.v0.fsType.field.Restricted) { |
+ info->fType = SkAdvancedTypefaceMetrics::kNotEmbeddable_Font; |
+ } else if (perGlyphInfo & SkAdvancedTypefaceMetrics::kHAdvance_PerGlyphInfo) { |
if (fixedWidth) { |
appendRange(&info->fGlyphWidths, 0); |
int16_t advance; |