diff --git a/src/calibre/utils/fonts/sfnt/cff/dict_data.py b/src/calibre/utils/fonts/sfnt/cff/dict_data.py index df573bb26c..2238a514a3 100644 --- a/src/calibre/utils/fonts/sfnt/cff/dict_data.py +++ b/src/calibre/utils/fonts/sfnt/cff/dict_data.py @@ -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): diff --git a/src/calibre/utils/fonts/sfnt/cff/table.py b/src/calibre/utils/fonts/sfnt/cff/table.py index af76d1f254..47dc891346 100644 --- a/src/calibre/utils/fonts/sfnt/cff/table.py +++ b/src/calibre/utils/fonts/sfnt/cff/table.py @@ -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):