aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports/SkTypeface_win_dw.cpp
diff options
context:
space:
mode:
authorGravatar Ben Wagner <bungeman@google.com>2017-04-07 16:07:46 -0400
committerGravatar Ben Wagner <bungeman@google.com>2017-04-07 23:07:08 +0000
commitf1bc5e8b78376e3b6509c8626623d3aae871daec (patch)
tree649fd1f38bd638cc7a1b74b96beee20cecb580e4 /src/ports/SkTypeface_win_dw.cpp
parent868d52be4e78f6dff330a1b931b5e2f8c55e87b4 (diff)
Set the kMultiMaster_FontFlag in DirectWrite.
DirectWrite can now produce system font typefaces which are variations, so mark these as multiple masters so printing knows what to do. BUG=chromium:697916 Change-Id: Idf09ebba3c7002a09ff2e4a2dbae13dbce4e79d4 Reviewed-on: https://skia-review.googlesource.com/12101 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Hal Canary <halcanary@google.com>
Diffstat (limited to 'src/ports/SkTypeface_win_dw.cpp')
-rw-r--r--src/ports/SkTypeface_win_dw.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ports/SkTypeface_win_dw.cpp b/src/ports/SkTypeface_win_dw.cpp
index 9ff9177012..ae4e3f7105 100644
--- a/src/ports/SkTypeface_win_dw.cpp
+++ b/src/ports/SkTypeface_win_dw.cpp
@@ -18,6 +18,7 @@
#include "SkDWriteFontFileStream.h"
#include "SkFontDescriptor.h"
#include "SkFontStream.h"
+#include "SkOTTable_fvar.h"
#include "SkOTTable_head.h"
#include "SkOTTable_hhea.h"
#include "SkOTTable_OS_2.h"
@@ -376,6 +377,13 @@ SkAdvancedTypefaceMetrics* DWriteFontTypeface::onGetAdvancedTypefaceMetrics(
return info;
}
+ // There are versions of DirectWrite which support named instances for system variation fonts,
+ // but no means to indicate that such a typeface is a variation.
+ AutoTDWriteTable<SkOTTableFontVariations> fvarTable(fDWriteFontFace.get());
+ if (fvarTable.fExists) {
+ info->fFlags |= SkAdvancedTypefaceMetrics::kMultiMaster_FontFlag;
+ }
+
//There exist CJK fonts which set the IsFixedPitch and Monospace bits,
//but have full width, latin half-width, and half-width kana.
bool fixedWidth = (postTable->isFixedPitch &&