From e8fd8f2e2b10db3775f15c28eab850d0165fca5e Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Sat, 3 Apr 2021 09:06:18 -0700 Subject: [PATCH] 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 --- engine/src/flutter/third_party/txt/src/minikin/FontFamily.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/third_party/txt/src/minikin/FontFamily.cpp b/engine/src/flutter/third_party/txt/src/minikin/FontFamily.cpp index 9f66e72f2f5..cf5a623c561 100644 --- a/engine/src/flutter/third_party/txt/src/minikin/FontFamily.cpp +++ b/engine/src/flutter/third_party/txt/src/minikin/FontFamily.cpp @@ -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(),