aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports/SkFontHost_win.cpp
diff options
context:
space:
mode:
authorGravatar Hal Canary <halcanary@google.com>2017-11-09 16:16:09 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-11-10 14:21:17 +0000
commita865d25519b0805697c5809288dd2fb3f642c17d (patch)
tree6e603d755fb3a0dcf26ffe305373645f118170aa /src/ports/SkFontHost_win.cpp
parent193de5d7ea81ad4a3cf5bd9e0bf7f50069368d27 (diff)
Windows GDI Typeface: set NotEmbeddable_FontFlag same as other backends.
Also fix a typo. Change-Id: I1a94cd961887ef7f55a9bfd27def6b1675ec4952 Reviewed-on: https://skia-review.googlesource.com/69700 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
Diffstat (limited to 'src/ports/SkFontHost_win.cpp')
-rw-r--r--src/ports/SkFontHost_win.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/ports/SkFontHost_win.cpp b/src/ports/SkFontHost_win.cpp
index 3cf42fd39e..9094d7e2a4 100644
--- a/src/ports/SkFontHost_win.cpp
+++ b/src/ports/SkFontHost_win.cpp
@@ -20,6 +20,7 @@
#include "SkMaskGamma.h"
#include "SkMatrix22.h"
#include "SkOnce.h"
+#include "SkOTTable_OS_2.h"
#include "SkOTTable_maxp.h"
#include "SkOTTable_name.h"
#include "SkOTUtils.h"
@@ -1733,11 +1734,20 @@ std::unique_ptr<SkAdvancedTypefaceMetrics> LogFontTypeface::onGetAdvancedMetrics
info.reset(new SkAdvancedTypefaceMetrics);
tchar_to_skstring(lf.lfFaceName, &info->fFontName);
- // 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 |= SkAdvancedTypefaceMetrics::kNotEmbeddable_FontFlag;
+
+ SkOTTableOS2_V4::Type fsType;
+ if (sizeof(fsType) == this->getTableData(SkTEndian_SwapBE32(SkOTTableOS2::TAG),
+ offsetof(SkOTTableOS2_V4, fsType),
+ sizeof(fsType),
+ &fsType)) {
+ SkOTUtils::SetAdvancedTypefaceFlags(fsType, info.get());
+ } else {
+ // 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 |= SkAdvancedTypefaceMetrics::kNotEmbeddable_FontFlag;
+ }
}
populate_glyph_to_unicode(hdc, glyphCount, &(info->fGlyphToUnicode));