mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
b9cefe9989
commit
985c9c857f
@ -104,8 +104,9 @@ class Dict(Reader):
|
||||
self.operators = {op:(name, arg) for op, name, arg, default, conv in
|
||||
table}
|
||||
|
||||
def decompile(self, strings, data):
|
||||
def decompile(self, strings, global_subrs, data):
|
||||
self.strings = strings
|
||||
self.global_subrs = global_subrs
|
||||
self.stack = []
|
||||
index = 0
|
||||
while index < len(data):
|
||||
|
@ -42,8 +42,12 @@ class CFF(object):
|
||||
self.strings = Strings(raw, offset)
|
||||
offset = self.strings.pos
|
||||
|
||||
# Read global subroutines
|
||||
self.global_subrs = GlobalSubrs(raw, offset)
|
||||
offset = self.global_subrs.pos
|
||||
|
||||
# Decompile Top Dict
|
||||
self.top_dict.decompile(self.strings, self.top_index[0])
|
||||
self.top_dict.decompile(self.strings, self.global_subrs, self.top_index[0])
|
||||
import pprint
|
||||
pprint.pprint(self.top_dict)
|
||||
|
||||
@ -81,6 +85,9 @@ class Strings(Index):
|
||||
def __init__(self, raw, offset):
|
||||
super(Strings, self).__init__(raw, offset, prepend=cff_standard_strings)
|
||||
|
||||
class GlobalSubrs(Index):
|
||||
pass
|
||||
|
||||
class CFFTable(UnknownTable):
|
||||
|
||||
def decompile(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user