Skip to main content

Module scriptmap

Module scriptmap 

Source
Expand description

Script-tag resolution for the multi-wise --scripts filter.

A user-supplied script tag may be an ISO 15924 code (Latn, Deva, Latf) or an OpenType script tag (latn, dev2, arab). Each input is resolved into a ScriptRequirement carrying two independent ways a font can satisfy it:

  1. OpenType — a group of OpenType script tags. The font’s GSUB/GPOS script list must contain at least one tag from the group. So deva expands to ["deva", "dev2", "dev3"] and any one of them suffices.

  2. Unicode — a single Unicode script (UAX #24). The font’s cmap is considered to cover that script when it maps at least MIN_UNICODE_COVERAGE codepoints belonging to it.

The whole-font decision (see crate::query::Query::matches) is: a font supports the requested list if it satisfies every requirement through the OpenType path, or it satisfies every requirement through the Unicode path.

Resolution is best-effort: when an input cannot be mapped, it is treated as a literal OpenType script tag (and, where possible, as a Unicode script via its title-cased spelling).

Made by FontLab https://www.fontlab.com/

Structs§

ScriptRequirement
One resolved script requirement: an OpenType tag group plus an optional Unicode script. Built by resolve_scripts.

Constants§

MIN_UNICODE_COVERAGE
Minimum number of cmap codepoints in a Unicode script for the font’s cmap to count as covering that script.

Functions§

resolve_scripts
Resolve a list of raw script-tag strings into ScriptRequirements.