Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@cbracken
Copy link
Member

@cbracken cbracken commented Apr 3, 2021

CMAP tables are a component of fonts which map character codes to glyph
indices used in the font. In cases where this is missing/corrupt 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, or misleading log messages.

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

No new test since this simply suppresses a log message but does
not affect logic otherwise.

CMAP Reference:
https://docs.microsoft.com/en-us/typography/opentype/spec/cmap

Fixes flutter/flutter#78929

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on
    writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.
  • The reviewer has submitted any presubmit flakes in this PR using the engine presubmit flakes form before re-triggering the failure.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

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
flutter/flutter#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
Copy link
Contributor

@Hixie Hixie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Hixie
Copy link
Contributor

Hixie commented Apr 3, 2021

Can we test this somehow? Sort of "golden files" for logs that makes sure nothing unexpected is logged? It would also catch other kinds of regressions with logging...

@cbracken
Copy link
Member Author

cbracken commented Apr 3, 2021

Can we test this somehow?

Funny you should mention that... we don't currently have testing for logs to stdout by C++ code, but as of #25402, we will have the ability to capture Dart logs :) I'll give this some thought.

@cbracken cbracken merged commit 9bc0f74 into flutter:master Apr 3, 2021
@cbracken cbracken deleted the cmap-spam branch April 3, 2021 16:06
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 3, 2021
duanqz pushed a commit to duanqz/engine that referenced this pull request Apr 16, 2021
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
flutter/flutter#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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes tech-debt Technical debt, code quality, testing, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ERROR:flutter/third_party/txt/src/minikin/FontFamily.cpp(184)] Could not get cmap table size!

2 participants