[canvaskit] Use linear metrics in shaping demo

Subpixel and slight hinting also make a big difference.

Change-Id: I1b942caf20dbdcf8bebc3504695c673fbe7e4392
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319791
Reviewed-by: Ben Wagner <bungeman@google.com>
This commit is contained in:
Kevin Lubick 2020-09-28 10:51:33 -04:00
parent 435b482638
commit f95c8629d1

View File

@ -59,6 +59,10 @@
const textPaint = new CanvasKit.SkPaint();
const textFont = new CanvasKit.SkFont(typeface, 20);
textFont.setLinearMetrics(true);
textFont.setSubpixel(true);
textFont.setHinting(CanvasKit.FontHinting.Slight);
// Only care about these characters for now. If we get any unknown characters, we'll replace
// them with the first glyph here (the replacement glyph).