Eliminate error message for missing CMAP table (flutter/engine#25403)

CMAP tables are a component of fonts which map character codes to glyph
indices used in the font. In cases where this is missing for a font that
we attempt to load, there is not much gained by logging this. It's also
a common source of false positive bug reports and bug reports with
misleading symptoms in Flutter, such as
https://github.com/flutter/flutter/issues/78929

Instead of logging the error, simply suppress it, since it's not
actionable by the user.

CMAP Reference:
https://docs.microsoft.com/en-us/typography/opentype/spec/cmap
This commit is contained in:
Chris Bracken 2021-04-03 09:06:18 -07:00 committed by GitHub
parent 223aadfa8e
commit e8fd8f2e2b

View File

@ -181,7 +181,8 @@ void FontFamily::computeCoverage() {
const uint32_t cmapTag = MinikinFont::MakeTag('c', 'm', 'a', 'p');
HbBlob cmapTable(getFontTable(typeface, cmapTag));
if (cmapTable.get() == nullptr) {
ALOGE("Could not get cmap table size!\n");
// Missing or corrupt font cmap table; bail out.
// The cmap table maps charcodes to glyph indices in a font.
return;
}
mCoverage = CmapCoverage::getCoverage(cmapTable.get(), cmapTable.size(),