Skip to content
This repository was archived by the owner on Jan 17, 2019. It is now read-only.

Conversation

@runarbu
Copy link
Contributor

@runarbu runarbu commented Mar 15, 2018

Support for running on both Python 2 and 3. Tested with Python 2.7 and Python 3.6 and they gives the same output:

env PYTHONPATH=Lib/ python2.7 ./woff-all /tmp/woffTools/py2/f1.woff
env PYTHONPATH=Lib/ python3.6 ./woff-all /tmp/woffTools/py3/f1.woff

diff -r /tmp/woffTools/py2/f1_info.html /tmp/woffTools/py3/f1_info.html
300c300
< 					<td>/tmp/woffTools/py2</td>
---
> 					<td>/tmp/woffTools/py3</td>
diff -r /tmp/woffTools/py2/f1_proof.html /tmp/woffTools/py3/f1_proof.html
358c358
< 					<td>/tmp/woffTools/py2</td>
---
> 					<td>/tmp/woffTools/py3</td>
diff -r /tmp/woffTools/py2/f1_validate.html /tmp/woffTools/py3/f1_validate.html
273c273
< 					<td>/tmp/woffTools/py2</td>
---
> 					<td>/tmp/woffTools/py3</td>

runarbu added 7 commits March 14, 2018 14:19
…rom fontTools.ttLib.sfnt to fontTools.ttLib

This prevents the error:

[]python ./woff-info /tmp/aaa/f8.woff
Traceback (most recent call last):
  File "./woff-info", line 3, in <module>
    from woffTools.tools import info
  File "/Users/<usename>/git/woffTools/Lib/woffTools/__init__.py", line 23, in <module>
    from fontTools.ttLib.sfnt import getSearchRange
This prevents the error

[]python ./woff-info /tmp/aaa/f8.woff
Creating Info Report: /tmp/aaa/f8.woff...
Traceback (most recent call last):
  File "./woff-info", line 5, in <module>
    info.main()
  File "/Users/<username>/git/woffTools/Lib/woffTools/tools/info.py", line 276, in main
    html = reportInfo(font, fontPath)
  File "/Users/<username>/git/woffTools/Lib/woffTools/tools/info.py", line 242, in reportInfo
    writeFontFaceRule(font, fontPath, writer)
  File "/Users/<username>/git/woffTools/Lib/woffTools/tools/info.py", line 210, in writeFontFaceRule
    fontFaceRule = makeFontFaceRule(font, fontPath, doLocalSrc=False)
  File "/Users/<username>/git/woffTools/Lib/woffTools/tools/css.py", line 226, in makeFontFaceRule
    makeFontFaceFontFamily(font),
  File "/Users/<username>/git/woffTools/Lib/woffTools/tools/css.py", line 54, in makeFontFaceFontFamily
    familyName = _skimNameIDs(font, familyPriority)
  File "/Users/<username>/git/woffTools/Lib/woffTools/tools/css.py", line 189, in _skimNameIDs
    for nameRecord in font["name"].names:
  File "/Library/Python/2.7/site-packages/fontTools/ttLib/ttFont.py", line 376, in __getitem__
    if self._tableCache is not None:
  File "/Users/<username>/git/woffTools/Lib/woffTools/__init__.py", line 82, in __getattr__
    raise AttributeError(attr)
AttributeError: _tableCache
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant