question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[feaLib] backslash-prefixed glyph names not supported

See original GitHub issue

Given the following feature file:

@group = [\f \i];

feature liga {
    sub @group by f_i;
} liga;

Traceback:

Traceback (most recent call last):
  File "C:\Users\Admin\Downloads\trufont\Lib\defconQt\scriptingWindow.py", line 40, in runScript
    exec(code, global_vars)
  File "<string>", line 8, in <module>
  File "C:\Python34\lib\site-packages\defcon\objects\base.py", line 337, in getRepresentation
    representation = factory["factory"](self, **kwargs)
  File "C:\Users\Admin\Downloads\trufont\Lib\defconQt\representationFactories\openTypeFactory.py", line 5, in TTFontFactory
    otf = compileOTF(font)
  File "C:\Python34\lib\site-packages\ufo2ft-0.1-py3.4.egg\ufo2ft\__init__.py", line 29, in compileOTF
    featureCompilerClass, kernWriter, markWriter)
  File "C:\Python34\lib\site-packages\ufo2ft-0.1-py3.4.egg\ufo2ft\__init__.py", line 18, in _compile
    featureCompiler.compile()
  File "C:\Python34\lib\site-packages\ufo2ft-0.1-py3.4.egg\ufo2ft\makeotfParts.py", line 26, in compile
    self.setupFile_features()
  File "C:\Python34\lib\site-packages\ufo2ft-0.1-py3.4.egg\ufo2ft\makeotfParts.py", line 59, in setupFile_features
    autoFeatures["kern"] = self.writeFeatures_kern()
  File "C:\Python34\lib\site-packages\ufo2ft-0.1-py3.4.egg\ufo2ft\makeotfParts.py", line 82, in writeFeatures_kern
    writer = self.kernWriter(self.font)
  File "C:\Python34\lib\site-packages\ufo2ft-0.1-py3.4.egg\ufo2ft\kernFeatureWriter.py", line 30, in __init__
    parser.parseFeatures(self, font.features.text)
  File "C:\Python34\lib\site-packages\feaTools\parser.py", line 645, in parseFeatures
    _parseUnknown(writer, text)
  File "C:\Python34\lib\site-packages\feaTools\parser.py", line 300, in _parseUnknown
    _parseUnknown(writer, precedingText)
  File "C:\Python34\lib\site-packages\feaTools\parser.py", line 408, in _parseUnknown
    text = _executeSimpleSlice(None, text, terminatorRE, writer)
  File "C:\Python34\lib\site-packages\feaTools\parser.py", line 420, in _executeSimpleSlice
    _parseUnknown(writer, precedingText)
  File "C:\Python34\lib\site-packages\feaTools\parser.py", line 412, in _parseUnknown
    raise FeaToolsParserSyntaxError("Invalid Syntax: %s" % text)
feaTools.parser.FeaToolsParserSyntaxError: 'Invalid Syntax: @group = [\\f \\i]'

Backslash-prefixed glyph name statements aren’t supported (they are in place to distinguish glyph names from identically-named keywords).

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
anthrotypecommented, Oct 25, 2016

@miguelsousa btw, backslash-escaped CIDs (e.g. \12345) are already supported by feaLib parser.

0reactions
brawercommented, Oct 26, 2016

No, makeotf rejects sub sub by lookup; unless the glyph names are prefixed by a backslash. (Just checked).

Read more comments on GitHub >

github_iconTop Results From Across the Web

PKG-INFO - platform/external/fonttools - android Git repositories
important, we maintain an ordered list of glyph names in the font. Other Tools ... [feaLib] Add support for special-case contextual positioning formatting....
Read more >
fonttools [python-library] - Occam :: Details
[merge] Support merging CFF tables (CID-keyed CFF is still not supported) (#2447). ... [feaLib] Support backslash-prefixed glyph names.
Read more >
Source code for fontTools.feaLib.parser
If the iterable is left empty, no glyph name in glyph set checking takes place, ... kwargs.pop("glyphMap") if kwargs: raise TypeError( "unsupported keyword ......
Read more >
Font Development Best Practices: Glyph Naming - GitHub Pages
Developers may choose to manage two sets of glyph names: working glyph ... Various font tools may have other restrictions but such are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found