Avoid finding a font with simulations

When requesting a font match for fonts like Sylfaen or Gabriola, which
absolutely do not have a bold or italic version, Windows silently
produces DirectWrite simulations which synthetic bolding or synthetic
italic or both.

From Chromium's perspective, we clearly do not want Windows to produce
silent simulations for us and this makes it impossible for us to
determine what the font's actual weight or slant is. As a result, we
are blocked from implementing the font-synthesis CSS property
correctly. For the latter, we need to be able to programmatically
enable setEmbolden() or setSkew() on SkFont and have Skia apply
artifical synthesis, instead of Windows instantiating such a font
silently.

Addresses TODO to avoid simulations in
SkFontStyleSet_DirectWrite::matchStyle.

Bug: skia:12455
Cq-Include-Trybots: luci.skia.skia.primary:Test-Win10-Clang-NUC5i7RYH-CPU-AVX2-x86_64-Debug-All-NativeFonts,Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Release-All-NativeFonts,Test-Win7-Clang-Golo-CPU-AVX512-x86_64-Debug-All-NativeFonts,Test-Win7-Clang-Golo-CPU-AVX512-x86_64-Debug-All-NativeFonts_GDI
Change-Id: If965d2501dff45ee7881544c6473b3fb36a8d90d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/450676
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
1 file changed