Set fixed pitch bit in DirectWrite port.
Previously the SkTypeface backed by DirectWrite always reported false
for the fixed pitch style bit. Set the value correctly when it is known.
Change-Id: I77fd1e5356b70928362ab49752cc50c32596f565
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255264
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
diff --git a/src/ports/SkTypeface_win_dw.h b/src/ports/SkTypeface_win_dw.h
index 72d86a2..e090727 100644
--- a/src/ports/SkTypeface_win_dw.h
+++ b/src/ports/SkTypeface_win_dw.h
@@ -68,6 +68,10 @@
if (!SUCCEEDED(fFactory->QueryInterface(&fFactory2))) {
SkASSERT_RELEASE(nullptr == fFactory2.get());
}
+
+ if (fDWriteFontFace1 && fDWriteFontFace1->IsMonospacedFont()) {
+ this->setIsFixedPitch(true);
+ }
}
public: