skia2/modules/skshaper
Ben Wagner 5a479e187d Check hb_font_create return value
There are very few ways that hb_font_create can fail. It will do minimal
sanitization if the data begins with a known magic signature, but will
otherwise return a valid hb_font which more or less looks like a valid
font with no glyphs and upem of 1000. This appears to be the reason gfx
is only using hb_face_create_for_tables to avoid the issue where a
system font may be understood by FreeType and otherwise be valid, but
not recognized by HarfBuzz.

Keep the efficiency of hb_font_create when it can be used, but check if
the resulting hb_font has no glyphs. If it has no glyphs attempt to use
hb_face_create_for_tables instead.

See https://github.com/harfbuzz/harfbuzz/issues/248

Change-Id: Iaf82127152cdf6de160274234bcb19b5ccbccc1b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/419805
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2021-06-18 22:21:47 +00:00
..
include Add SkShaper::PurgeCaches. 2021-01-27 17:50:30 +00:00
src Check hb_font_create return value 2021-06-18 22:21:47 +00:00
BUILD.gn Revert the workaround for missing ICU API ubrk_safeClone 2021-03-08 15:26:25 +00:00
skshaper.gni Reland "Removing ICU dependencies from skparagraph BUILD.gn file" 2020-09-11 18:31:24 +00:00