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:
-
OpenType — a group of OpenType script tags. The font’s GSUB/GPOS script list must contain at least one tag from the group. So
devaexpands to["deva", "dev2", "dev3"]and any one of them suffices. -
Unicode — a single Unicode script (UAX #24). The font’s
cmapis considered to cover that script when it maps at leastMIN_UNICODE_COVERAGEcodepoints 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§
- Script
Requirement - 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
cmapto count as covering that script.
Functions§
- resolve_
scripts - Resolve a list of raw script-tag strings into
ScriptRequirements.