[ot-font] Return char-not-found if mapped to gid 0

OpenType cmap table can use gid=0 to mean "not covered" to produce
more optimized cmap subtables.  Return false from get_nominal_glyph()
for those.  hb-ft already does this.
This commit is contained in:
Behdad Esfahbod 2018-08-25 08:44:18 -07:00
parent aadb2a9188
commit 531051b8b9
1 changed files with 4 additions and 4 deletions

View File

@ -52,7 +52,7 @@ struct CmapSubtableFormat0
if (!gid)
return false;
*glyph = gid;
return true;
return *glyph != 0;
}
inline bool sanitize (hb_sanitize_context_t *c) const
@ -280,7 +280,7 @@ struct CmapSubtableFormat4
}
*glyph = gid & 0xFFFFu;
return true;
return *glyph != 0;
}
static inline void get_all_codepoints_func (const void *obj, hb_set_t *out)
@ -398,7 +398,7 @@ struct CmapSubtableTrimmed
if (!gid)
return false;
*glyph = gid;
return true;
return *glyph != 0;
}
inline bool sanitize (hb_sanitize_context_t *c) const
@ -433,7 +433,7 @@ struct CmapSubtableLongSegmented
if (i == -1)
return false;
*glyph = T::group_get_glyph (groups[i], codepoint);
return true;
return *glyph != 0;
}
inline void get_all_codepoints (hb_set_t *out) const