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

Desubroutinize if needed #1

Open
roozbehp opened this issue Jun 2, 2015 · 3 comments
Open

Desubroutinize if needed #1

roozbehp opened this issue Jun 2, 2015 · 3 comments

Comments

@roozbehp
Copy link

roozbehp commented Jun 2, 2015

For example, running it on Noto's third_party/noto_cjk/NotoSansKR-Regular.otf results in:

roozbeh@machine-name:~/compreffor/compreffor$ ./cxxCompressor.py NotoSansKR-Regular.otf 
Warning: There are subrs in NotoSansKR-Regular.otf
Traceback (most recent call last):
  File "./cxxCompressor.py", line 387, in <module>
    main(**kwargs)
  File "./cxxCompressor.py", line 342, in main
    handle_font(filename)
  File "./cxxCompressor.py", line 320, in handle_font
    font.save(out_name)
  File "/home/roozbeh/fonttools/Lib/fontTools/ttLib/__init__.py", line 214, in save
    self._writeTable(tag, writer, done)
  File "/home/roozbeh/fonttools/Lib/fontTools/ttLib/__init__.py", line 629, in _writeTable
    tabledata = self.getTableData(tag)
  File "/home/roozbeh/fonttools/Lib/fontTools/ttLib/__init__.py", line 642, in getTableData
    return self.tables[tag].compile(self)
  File "/home/roozbeh/fonttools/Lib/fontTools/ttLib/tables/C_F_F_.py", line 20, in compile
    self.cff.compile(f, otFont)
  File "/home/roozbeh/fonttools/Lib/fontTools/cffLib.py", line 72, in compile
    for child in topCompiler.getChildren(strings):
  File "/home/roozbeh/fonttools/Lib/fontTools/cffLib.py", line 243, in getChildren
    children.extend(topDict.getChildren(strings))
  File "/home/roozbeh/fonttools/Lib/fontTools/cffLib.py", line 1422, in getChildren
    charStringsComp = CharStringsCompiler(items, strings, self)
  File "/home/roozbeh/fonttools/Lib/fontTools/cffLib.py", line 180, in __init__
    self.items = self.getItems(items, strings)
  File "/home/roozbeh/fonttools/Lib/fontTools/cffLib.py", line 286, in getItems
    cs.compile()
  File "/home/roozbeh/fonttools/Lib/fontTools/misc/psCharStrings.py", line 289, in compile
    "seac"), "illegal CharString"
AssertionError: illegal CharString
@behdad
Copy link
Contributor

behdad commented Jun 2, 2015

Apparently you need to desubroutinize first. Let me see how you can do that.

@behdad behdad changed the title compreffor fails on various Noto CJK fonts with "illegal CharString" error Desubroutinize if needed Jun 2, 2015
@samfishman
Copy link
Contributor

I believe we came up with a patch to fonttools last summer to
desubroutinize but I don't think it ever got merged.

On Tue, Jun 2, 2015 at 7:47 PM, Behdad Esfahbod notifications@github.com
wrote:

Apparently you need to desubroutinize first. Let me see how you can do
that.


Reply to this email directly or view it on GitHub
#1 (comment)
.

@samfishman
Copy link
Contributor

Ah nice, I didn't see you already linked to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants