1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-04-27 17:13:32 +02:00

Enable docx write support

This commit is contained in:
2020-04-13 16:35:28 +02:00
parent a4533957f7
commit d3369d55bc
27 changed files with 103 additions and 131 deletions
@@ -1,10 +0,0 @@
#!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai
from __future__ import absolute_import, division, print_function, unicode_literals
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
@@ -7,7 +7,7 @@ __copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from struct import pack, unpack_from
from polyglot.builtins import range, unicode_type
from ebook_converter.polyglot.builtins import range, unicode_type
t1_operand_encoding = [None] * 256
t1_operand_encoding[0:32] = (32) * ["do_operator"]
@@ -9,12 +9,12 @@ __docformat__ = 'restructuredtext en'
from struct import unpack_from, unpack, calcsize
from functools import partial
from calibre.utils.fonts.sfnt import UnknownTable
from calibre.utils.fonts.sfnt.errors import UnsupportedFont, NoGlyphs
from calibre.utils.fonts.sfnt.cff.dict_data import TopDict, PrivateDict
from calibre.utils.fonts.sfnt.cff.constants import (cff_standard_strings,
from ebook_converter.utils.fonts.sfnt import UnknownTable
from ebook_converter.utils.fonts.sfnt.errors import UnsupportedFont, NoGlyphs
from ebook_converter.utils.fonts.sfnt.cff.dict_data import TopDict, PrivateDict
from ebook_converter.utils.fonts.sfnt.cff.constants import (cff_standard_strings,
STANDARD_CHARSETS)
from polyglot.builtins import iteritems, itervalues, range
from ebook_converter.polyglot.builtins import iteritems, itervalues, range
# Useful links
# http://www.adobe.com/content/dam/Adobe/en/devnet/font/pdfs/5176.CFF.pdf
@@ -194,7 +194,7 @@ class CFFTable(UnknownTable):
self.cff = CFF(self.raw)
def subset(self, character_map, extra_glyphs):
from calibre.utils.fonts.sfnt.cff.writer import Subset
from ebook_converter.utils.fonts.sfnt.cff.writer import Subset
# Map codes from the cmap table to glyph names, this will be used to
# reconstruct character_map for the subset font
charset_map = {code:self.cff.charset.safe_lookup(glyph_id) for code,