Skip to content
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

[spec] Valid whitespace characters in feature files? #191

Open
jenskutilek opened this issue Aug 8, 2017 · 5 comments
Open

[spec] Valid whitespace characters in feature files? #191

jenskutilek opened this issue Aug 8, 2017 · 5 comments
Labels

Comments

@jenskutilek
Copy link

makeotf apparently allows non-breaking space characters as whitespace in feature files, while fontTools.feaLib doesn’t. Is there a list of which whitespace characters are valid somewhere?

@frankrolf
Copy link
Member

In my opinion, all whitespace characters should be valid in feature files (even line breaks).
I have been teaching the concept that the only requirement is a semicolon to end a logical “line”.

This should be valid:

@EXAMPLE = [
    A
    B
    C
];

@khaledhosny
Copy link
Collaborator

Whitespace characters is a long list in Unicode (and potentially open ended with future additions to Unicode), the spec should explicitly list what characters are treated as such instead.

@frankrolf
Copy link
Member

Since the feature file specification does not allow for non-ASCII characters, I don’t think this is an issue.

@kenlunde
Copy link

kenlunde commented Aug 8, 2017

The non-breaking space is U+00A0, which is (barely) outside of ASCII, so based on @frankrolf's statement, its presence outside of comments should throw an error.

While we're on the subject, the following are the Unicode Version 10.0 characters that have the White_Space property:

0020          ; White_Space # Zs       SPACE
0085          ; White_Space # Cc       <control-0085>
00A0          ; White_Space # Zs       NO-BREAK SPACE
1680          ; White_Space # Zs       OGHAM SPACE MARK
2000..200A    ; White_Space # Zs  [11] EN QUAD..HAIR SPACE
2028          ; White_Space # Zl       LINE SEPARATOR
2029          ; White_Space # Zp       PARAGRAPH SEPARATOR
202F          ; White_Space # Zs       NARROW NO-BREAK SPACE
205F          ; White_Space # Zs       MEDIUM MATHEMATICAL SPACE
3000          ; White_Space # Zs       IDEOGRAPHIC SPACE```

@jenskutilek
Copy link
Author

Yes, 0x0a is not ASCII, but some font editors apparently do not prevent non-ASCII characters from ending up in feature files. For example, in my case the file was in a UFO generated by glyphsLib from a Glyphs file. The feature file was UTF-8-encoded. Maybe this should be decided together with #165.

@miguelsousa miguelsousa changed the title Valid whitespace characters in feature files? [spec] Valid whitespace characters in feature files? Jul 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants