From 16374c3de497ad1b182dd11dbf55e0905e11c4cc Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Fri, 2 Apr 2021 18:46:32 -0700 Subject: [PATCH] Eliminate error message for missing CMAP table 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 --- third_party/txt/src/minikin/FontFamily.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/third_party/txt/src/minikin/FontFamily.cpp b/third_party/txt/src/minikin/FontFamily.cpp index 9f66e72f2f520..cf5a623c56132 100644 --- a/third_party/txt/src/minikin/FontFamily.cpp +++ b/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(),