-
Notifications
You must be signed in to change notification settings - Fork 475
[feaLib] Make include()
work like makeotf
#838
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hi Miguel, thanks for your pull request. As you know, the OpenType Feature File specification simply says: http://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html#3
The spec however does not say that "the paths need to be relative to the first file instead of relative to each other". I wonder whether the spec should be modified to clarify this? I personally think the way feaLib implements the include statement makes more sense, as it's similar to how the C preprocessor handles relative paths like /cc @brawer @readroberts |
I see you moved |
I don't oppose changing the current behavior, but it has been working like this for as long as I can remember, and we have a fair number of projects that rely on it. Other developers may depend on it too. |
@anthrotype yes, I did move |
Here's a simple example to illustrate the situation that the PR is trying to address.
where For both makeotf and feaLib, the contents of
and the contents of
But when it comes to the contents of
whereas feaLib needs it to be
|
Agree with @anthrotype that the makeotf behavior is funky, but I’d say supporting existing sources (and compatibility with makeotf) is more important. For the location of the test files, I’ll move them into the data directory in a follow-up change. Will also file a bug on the feature file spec, since it would be nice if the spec reflected reality. |
Move the other include files into a new subdirectory inside `data`. Mention the changed behavior of include statements in NEWS. See #838.
It might be good to clarify the spec, since the path resolution is quite unusual compared to other languages. Filed adobe-type-tools/afdko#164. |
Move the other include files into a new subdirectory inside `data`. Mention the changed behavior of include statements in NEWS. See #838.
Thanks Sasha. |
Thank you Miguel and Sascha. |
Move the other include files into a new subdirectory inside `data`. Mention the changed behavior of include statements in NEWS. See fonttools#838.
The way makeotf handles
include()
is to literally replace the statement with the contents of the file that is being referenced, therefore the paths need to be relative to the first file instead of relative to each other. I've adjusted the test files to cover other file location examples. The test results remain the same.