googlefonts / googlefonts/fontc

Some fonts use FEA include for arbitrary string concatenation

Open
#2,002 0 comments 0 reactions 0 assignees View on GitHub
crater
Dominant language
Rust
Stars
193
Forks
21
Avg merge
1d 20h
Merged PRs (30d)
60

Description

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](https://github.com/erinmclaughlin/Yantramanav) family seems to have some FEA that looks something like this:

_features.fea_
```fea
feature derp {
sub a by b;
include(my_include.fea);
```

```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](https://adobe-type-tools.github.io/afdko/OpenTypeFeatureFileSpecification.html#:~:text=An%20include%20directive%20is%20valid%20in%20any%20context%20that%20otherwise%20contains%20statements%20ending%20in%20semicolons))

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.