-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add support for font-specific formats #3142
Conversation
Crissov
commented
Aug 4, 2016
•
edited by Alhadis
Loading
edited by Alhadis
- Text: ← filenames: FONTLOG http://scripts.sil.org/cms/scripts/page.php?item_id=OFL-FAQ_web#43cecb44
- OpenType: ← extensions: .fea https://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html
- Spline Font: ← extensions: .sfd http://fontforge.github.io/en-US/documentation/developers/sfdformat/
- Markdown: ← extensions: .md.txt - Text: ← extensions: .text - Text: ← filenames: FONTLOG http://scripts.sil.org/cms/scripts/page.php?item_id=OFL-FAQ_web#43cecb44 - OpenType: ← extensions: .fea https://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html - Spline Font: ← extensions: .sfd http://fontforge.github.io/en-US/documentation/developers/sfdformat/
@@ -2668,6 +2669,16 @@ OpenSCAD: | |||
tm_scope: none | |||
ace_mode: scad | |||
|
|||
OpenType Font Feature: | |||
type: programming |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this PR is accepted, this should be data
, not programming
. Same with Spline Font Data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ll agree that data
is appropriate for .sfd
, but not so much for .fea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's convinced you that OpenType features are a "programming language"...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, maybe it’s markup
(like Postscript and CSS) but OT features are used to implement substitution algorithms etc. That sounds like programming to me. It’s certainly not just data
like an image or config file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PostScript? Uh, no, PostScript is a fully Turing-complete programming language. CSS, though... yes, that's markup.
I'm well aware of what OpenType features are, but I'd argue they're no closer to programming than SVG source is. They describe coordinates, geometry and hinting for the rendering environment...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that PS is TC and so is TeX, but like CSS they both have type: markup
in languages.yml
. CSS is a declarative language (and doesn’t mark up text)), but so are functional programming languages … CSS is certainly not a markup language like HTML is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hell. I didn't even notice PostScript was classed as markup, and I was even editing that part the other night.
Right, time to amend.
EDIT: Done.
`type: data` for SFD
OpenType feature ← type: markup
You'll need to fix the order of file extensions. From the build's feedback:
|
alphabetic order
@Crissov Thanks for the pull request! Please see the guidelines to add support for a new extension to Linguist to complete the additional steps required. |
@Crissov You can use this package to provide syntax highlighting for OpenType feature files and spline-font databases. The relevant scopes are:
Also, it appears the "proper" name for the former is "OpenType feature file", not "OpenType font feature". That's going by how the spec refers to the format. You'll also need to change OpenType's language type to |
incorporated suggestions: - “OpenType Font Feature” → “Opentype feature” (no “file” at the end, because that’s left out almost everywhere else, too) - `tm_scope` according to https://github.com/Alhadis/language-fontforge
- `.md.txt` Markdown - `.text` Plain Text
- .fea | ||
#- .otl (rare) | ||
#interpreters: | ||
#- makeotf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m not sure I correctly understand the purpose of interpreters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used for identifying languages based on an interpreter directive. For example, we have node
listed as an interpreter for JavaScript, which tells Linguist that #!/usr/bin/env node
identifies the file as being that language.
Since OpenType feature files aren't executed, it's safe to leave this out. ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, thanks
remove comment
Sorry about the long wait! Didn't mean to take this long to get back to you. 😞 Alright, great news: all three additions check out.
|
@@ -2668,6 +2668,15 @@ OpenSCAD: | |||
tm_scope: none | |||
ace_mode: scad | |||
|
|||
Opentype feature: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be changed to OpenType Feature File
(case-sensitive, please).
@@ -3635,6 +3644,13 @@ SourcePawn: | |||
tm_scope: source.sp | |||
ace_mode: text | |||
|
|||
Spline Font Data: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The canonical name for the format is Spline Font Database
, which is what this needs to be. Again, please make sure it's capitalised correctly (the way I've written it here).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. 👍
# Conflicts: # lib/linguist/languages.yml
@Crissov Uhm, you've... kind of committed the conflicts you were supposed to fix. The affected regions are lines 2956-2969 and 4041-4052. Just erase the the blank lines and The diff for |
@Crissov Just paging you with a reminder we're still waiting for the conflicts to be fixed before we can finish our review. =) |
@Crissov looks like this is near the finish line, but you have some additional conflicts to resolve. |
@Crissov I sense you may be having difficulties, so I sent you a pull request to resolve these conflicts. |
Resolve conflicts for #3142
Alright, there're two build failures, but only one of them we can fix (the second failure isn't your fault; it's currently a known issue). This is the one we still have to fix:
I admit the error here was probably mine, since I hastily deleted my fork before seeing what the build result was. Silly me. @Crissov Try these steps:
perl -pi -e 's|script\K (?=list-grammars)|/|;' script/add-grammar
script/add-grammar Alhadis/language-fontforge
git add --all && git commit -m "Update submodules and fix grammar-list script" Then push to your fork as you would normally. Note this should be done in a clean repository to eliminate the risk of unregistered submodules complicating things. There've been quite a few replaced over the course of this year, and since your fork is a little dated, it's quite likely you have stray submodules floating around... Using Probably not a clean way to do it, but hey. |
@Crissov I've sent you a second pull request in the hopes of closing the book on this. @pchaigno Tests were still failing locally for the Ant submodule (even after merging master into the fork's branch). Could this be related to |
@Alhadis You'll need to update dependencies: |
Ah, right. My understanding of what Is it because I'm from the land of JavaScript, not Ruby? ;) Actually, serious question: shouldn't there be a version check or something to ensure dependencies are up to date? Because I had no idea what was going on. |
I'm not sure I get it myself, but then I'm not sure either of which land I'm from :p
We could increase the version of Licensee needed in github-linguist.gemspec. I'm a little hesitant to do that because Licensee 8.7.0 isn't actually needed for anything else than tests. |
@Crissov Could you please merge the PR so we can get this wrapped up? |
Add missing grammar to submodules list
@brandonblack This looks merge-ready to me. ? Please also remember to squash-merge; the PR's commit history is extremely convoluted and would pollute the codebase's revision history. |
Thanks @Crissov! |
It was really @Alhadis who did all the nasty work. |