skia/skia/075fbe4778d97b1554f1ab2631f63d17651d7713 Prefer outline over a distant EBDT/EBLC strike in Fontations
When a scalable font (glyf outlines) also carries monochrome EBDT/EBLC
embedded bitmaps, the Fontations scaler context preferred the embedded
bitmap at every size. The strike picker returns the nearest available
strike regardless of distance, so requesting a size far above the
largest strike rasterized a tiny monochrome bitmap upscaled many times,
producing blocky text where a smooth outline was available.
Mirror the FreeType backend, whose FT_Match_Size selects an embedded
bitmap for a scalable face only when the rounded requested ppem equals a
strike ppem, and otherwise renders the outline:
- embeddedBitmapStrikeCloseEnough() prefers the outline unless the chosen monochrome strike's rounded ppem equals the rounded requested ppem.
- Fall back to the outline when the chosen strike yields no bitmap data for the glyph instead of rendering nothing.
Cq-Include-Trybots: luci.skia.skia.primary:Build-Mac-Clang-x86_64-Debug-Fontations,Build-Ubuntu24.04-Clang-x86_64-Debug-Fontations,Test-Mac15-Clang-MacBookPro15.1-CPU-AppleIntel-x86_64-Debug-All-NativeFonts_Fontations,Test-Ubuntu24.04-Clang-GCE-CPU-AVX2-x86_64-Debug-All-NativeFonts_Fontations
Bug: 526181509
Change-Id: I9bf701b79fbd3653e23956b00b521de9f0b43259
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1278616
Reviewed-by: Dominik Röttsches <drott@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Dominik Röttsches <drott@google.com>
2 files changed