[pdf] Pass typeface, not data, to subsetter

This allows for much more flexibility in how to subset the typeface.

Also check the creation of the hb_face. hb_face_create always succeeds.
If unrecognized data (like woff) is passed to it then it will contain a
"valid" font with no tables. So instead of returning an error and
allowing the data to be embedded on unrecognized data, the HarfBuzz
subsetter was returning the data of an empty OpenType font (12 bytes of
header). Use hb_face_count before calling hb_face_create to check that a
useful hb_face will be created.

Change-Id: I01b4cc40ac0bbe62888049c2e7363709f520c8a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/543485
Reviewed-by: Kaylee Lubick <kjlubick@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
3 files changed