Merge pull request #872 from googlefonts/drop-tables

[subset] Drop the same tables by default as fontTools does.
This commit is contained in:
Garret Rieger 2018-03-09 12:06:52 -07:00 committed by GitHub
commit 743ef31761
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 34 additions and 15 deletions

View File

@ -290,21 +290,40 @@ _subset_table (hb_subset_plan_t *plan,
static bool
_should_drop_table(hb_subset_plan_t *plan, hb_tag_t tag)
{
switch (tag) {
case HB_TAG ('c', 'v', 'a', 'r'): /* hint table, fallthrough */
case HB_TAG ('c', 'v', 't', ' '): /* hint table, fallthrough */
case HB_TAG ('f', 'p', 'g', 'm'): /* hint table, fallthrough */
case HB_TAG ('p', 'r', 'e', 'p'): /* hint table, fallthrough */
case HB_TAG ('h', 'd', 'm', 'x'): /* hint table, fallthrough */
case HB_TAG ('V', 'D', 'M', 'X'): /* hint table, fallthrough */
return plan->drop_hints;
case HB_TAG ('G', 'D', 'E', 'F'): /* temporary */
case HB_TAG ('G', 'P', 'O', 'S'): /* temporary */
case HB_TAG ('G', 'S', 'U', 'B'): /* temporary */
case HB_TAG ('D', 'S', 'I', 'G'):
return true;
default:
return false;
switch (tag) {
case HB_TAG ('c', 'v', 'a', 'r'): /* hint table, fallthrough */
case HB_TAG ('c', 'v', 't', ' '): /* hint table, fallthrough */
case HB_TAG ('f', 'p', 'g', 'm'): /* hint table, fallthrough */
case HB_TAG ('p', 'r', 'e', 'p'): /* hint table, fallthrough */
case HB_TAG ('h', 'd', 'm', 'x'): /* hint table, fallthrough */
case HB_TAG ('V', 'D', 'M', 'X'): /* hint table, fallthrough */
return plan->drop_hints;
// Drop Layout Tables until subsetting is supported.
case HB_TAG ('G', 'D', 'E', 'F'): /* temporary */
case HB_TAG ('G', 'P', 'O', 'S'): /* temporary */
case HB_TAG ('G', 'S', 'U', 'B'): /* temporary */
// Drop these tables below by default, list pulled
// from fontTools:
case HB_TAG ('B', 'A', 'S', 'E'):
case HB_TAG ('J', 'S', 'T', 'F'):
case HB_TAG ('D', 'S', 'I', 'G'):
case HB_TAG ('E', 'B', 'D', 'T'):
case HB_TAG ('E', 'B', 'L', 'C'):
case HB_TAG ('E', 'B', 'S', 'C'):
case HB_TAG ('S', 'V', 'G', ' '):
case HB_TAG ('P', 'C', 'L', 'T'):
case HB_TAG ('L', 'T', 'S', 'H'):
// Graphite tables:
case HB_TAG ('F', 'e', 'a', 't'):
case HB_TAG ('G', 'l', 'a', 't'):
case HB_TAG ('G', 'l', 'o', 'c'):
case HB_TAG ('S', 'i', 'l', 'f'):
case HB_TAG ('S', 'i', 'l', 'l'):
// Colour
case HB_TAG ('s', 'b', 'i', 'x'):
return true;
default:
return false;
}
}