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

Unified Diff: src/ports/SkFontHost_win.cpp

Issue 107863002: [PDF] Fix font embedding restrictions. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix Mac Created 7 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/ports/SkFontHost_mac.cpp ('k') | src/ports/SkFontHost_win_dw.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontHost_win.cpp
diff --git a/src/ports/SkFontHost_win.cpp b/src/ports/SkFontHost_win.cpp
index aee2b863e6477a47e866929328d1b2bc28cd241f..386c3db9fd904319fa6f778e8c05e9c37ab27305 100755
--- a/src/ports/SkFontHost_win.cpp
+++ b/src/ports/SkFontHost_win.cpp
@@ -1851,10 +1851,18 @@ SkAdvancedTypefaceMetrics* LogFontTypeface::onGetAdvancedTypefaceMetrics(
info = new SkAdvancedTypefaceMetrics;
info->fEmSize = otm.otmEMSquare;
- info->fMultiMaster = false;
info->fLastGlyphID = SkToU16(glyphCount - 1);
info->fStyle = 0;
tchar_to_skstring(lf.lfFaceName, &info->fFontName);
+ info->fFlags = SkAdvancedTypefaceMetrics::kEmpty_FontFlag;
+ // If bit 1 is set, the font may not be embedded in a document.
+ // If bit 1 is clear, the font can be embedded.
+ // If bit 2 is set, the embedding is read-only.
+ if (otm.otmfsType & 0x1) {
+ info->fFlags = SkTBitOr<SkAdvancedTypefaceMetrics::FontFlags>(
+ info->fFlags,
+ SkAdvancedTypefaceMetrics::kNotEmbeddable_FontFlag)
bungeman-skia 2013/12/10 16:43:50 Looks like there's a missing ';' here.
+ }
if (perGlyphInfo & SkAdvancedTypefaceMetrics::kToUnicode_PerGlyphInfo) {
populate_glyph_to_unicode(hdc, glyphCount, &(info->fGlyphToUnicode));
@@ -1915,13 +1923,7 @@ SkAdvancedTypefaceMetrics* LogFontTypeface::onGetAdvancedTypefaceMetrics(
}
}
- // If bit 1 is set, the font may not be embedded in a document.
- // If bit 1 is clear, the font can be embedded.
- // If bit 2 is set, the embedding is read-only.
- if (otm.otmfsType & 0x1) {
- info->fType = SkAdvancedTypefaceMetrics::kNotEmbeddable_Font;
- } else if (perGlyphInfo &
- SkAdvancedTypefaceMetrics::kHAdvance_PerGlyphInfo) {
+ if (perGlyphInfo & SkAdvancedTypefaceMetrics::kHAdvance_PerGlyphInfo) {
if (info->fStyle & SkAdvancedTypefaceMetrics::kFixedPitch_Style) {
appendRange(&info->fGlyphWidths, 0);
info->fGlyphWidths->fAdvance.append(1, &min_width);
« no previous file with comments | « src/ports/SkFontHost_mac.cpp ('k') | src/ports/SkFontHost_win_dw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698