[pdf] Allow table based font subsetting

It is possible that the font stream may not be in OpenType format but
the font logically is, as is the case with woff and woff2. Pass the
typeface and not just its data to the subsetter so that the subsetter
can fall back to subseting by table if possible. This allows woff and
woff2 fonts to be properly subset.

This new behavior is only possible with HarfBuzz 4.4.0 and later. If
compiling against a version of HarfBuzz prior before 4.4.0 keep the
existing behavior. Use the newer tag retrieval mechanism if using
HarfBuzz 10.0.0 or later. The old tag guessing mechanism works for this
subsetter since this code is already directing HarfBuzz to remove
unknown tables, which is fine since for PDF embedding only the `cmap`
and `glyf` tables are really needed.

Bug: 40045290
Change-Id: Ib23b1772729fa180cf8b57bb8769caf475eb2bcc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/851737
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
6 files changed