Skip to content

libtxt: Implement OpenType locl support #12630

@Hixie

Description

@Hixie

Some fonts have different variant glyphs based on the locale. This is critical for Chinese, Chinese (Simplified), Japanese, and Korean; it is also used for other scripts (e.g. Latin vs Romanian).

OpenType encodes this using the locl feature tag.

There are some resources to test this online, e.g. the LOCL Test font.

It is common to not know what locale to use. In that case, we should default to no locale and allow the font to pick its default.

  • Pass the locale through from the framework to the engine. Each TextSpan should take an optional Locale; by default it should inherit the value from ParagraphStyle which should have a Locale also.
  • Use the locale in the engine to configure the font rendering by setting it in the minikin::TextStyle structure.
  • Test this.

Metadata

Metadata

Assignees

Labels

a: internationalizationSupporting other languages or locales. (aka i18n)c: new featureNothing broken; request for a new capabilityengineflutter/engine related. See also e: labels.frameworkflutter/packages/flutter repository. See also f: labels.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions