Skip to content

Some fonts use FEA include for arbitrary string concatenation #2002

@cmyr

Description

@cmyr

That is, either or both of the including/included files are not valid FEA independently, and are only valid if they are parsed after they are concatenated.

For instance the Yantramanav family seems to have some FEA that looks something like this:

features.fea

feature derp {
    sub a by b;
    include(my_include.fea);
sub x by y;
} derp;

This is not well handled by fea-rs, because fea-rs attempts to parse each fea file independently, and errors because in features.fea the feature is never closed.

This is not a common pattern, and the spec is not clear as to whether it should be supported or not; all it really says is,

An include directive is valid in any context that otherwise contains statements ending in semicolons: “Top-level” statements; feature, lookup, table, cvParameter, and AxisValue blocks; and name groups. (An implementation that processes include statements at the token level is not required to enforce these restrictions.)

– (3. Including files)

Metadata

Metadata

Assignees

No one assigned

    Labels

    craterIssues based on a crater diff

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions