BabelDOC 0.4.3__tar.gz → 0.4.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {babeldoc-0.4.3 → babeldoc-0.4.5}/PKG-INFO +1 -1
- babeldoc-0.4.5/babeldoc/__init__.py +1 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/const.py +1 -1
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/backend/pdf_creater.py +1 -1
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/midend/add_debug_information.py +3 -4
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/high_level.py +10 -1
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/result_merger.py +4 -2
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/translation_config.py +2 -2
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/main.py +1 -1
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/pdffont.py +7 -89
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/tools/italic_assistance.py +2 -3
- {babeldoc-0.4.3 → babeldoc-0.4.5}/pyproject.toml +2 -2
- {babeldoc-0.4.3 → babeldoc-0.4.5}/uv.lock +2 -1
- babeldoc-0.4.3/babeldoc/__init__.py +0 -1
- {babeldoc-0.4.3 → babeldoc-0.4.5}/.cursorignore +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/.github/ISSUE_TEMPLATE/bug_report.yaml +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/.github/ISSUE_TEMPLATE/feature_request.yaml +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/.github/PULL_REQUEST_TEMPLATE/pr_form.yml +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/.github/dependabot.yml +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/.github/labels.yml +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/.github/release-drafter.yml +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/.github/workflows/codeql.yml +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/.github/workflows/docs.yml +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/.github/workflows/labeler.yml +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/.github/workflows/lint.yml +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/.github/workflows/pr-lint.yml +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/.github/workflows/publish-to-pypi.yml +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/.github/workflows/test.yml +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/.gitignore +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/.pre-commit-config.yaml +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/LICENSE +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/README.md +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/assets/assets.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/assets/embedding_assets_metadata.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/asynchronize/__init__.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/babeldoc_exception/BabelDOCException.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/babeldoc_exception/__init__.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/docvision/README.md +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/docvision/__init__.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/docvision/base_doclayout.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/docvision/doclayout.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/docvision/rpc_doclayout.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/docvision/rpc_doclayout2.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/docvision/table_detection/rapidocr.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/__init__.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/__init__.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/converter.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/__init__.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/backend/__init__.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/frontend/__init__.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/frontend/il_creater.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/il_version_1.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/il_version_1.rnc +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/il_version_1.rng +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/il_version_1.xsd +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/midend/__init__.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/midend/automatic_term_extractor.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/midend/detect_scanned_file.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/midend/il_translator.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/midend/il_translator_llm_only.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/midend/layout_parser.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/midend/paragraph_finder.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/midend/remove_descent.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/midend/styles_and_formulas.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/midend/table_parser.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/midend/typesetting.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/utils/__init__.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/utils/fontmap.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/utils/formular_helper.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/utils/layout_helper.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/utils/mupdf_helper.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/utils/paragraph_helper.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/utils/style_helper.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/utils/zstd_helper.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/xml_converter.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/pdfinterp.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/split_manager.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/glossary.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/LICENSE +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/__init__.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/_saslprep.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/arcfour.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/ascii85.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/casting.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/ccitt.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/78-EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/78-EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/78-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/78-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/78-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/78-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/78ms-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/78ms-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/83pv-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/83pv-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/90ms-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/90ms-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/90msp-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/90msp-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/90pv-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/90pv-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/Add-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/Add-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/Add-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/Add-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/B5-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/B5-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/B5pc-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/B5pc-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/CNS-EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/CNS-EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/CNS1-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/CNS1-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/CNS2-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/CNS2-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/ETHK-B5-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/ETHK-B5-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/ETen-B5-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/ETen-B5-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/ETenms-B5-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/ETenms-B5-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/Ext-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/Ext-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/Ext-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/Ext-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/GB-EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/GB-EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/GB-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/GB-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/GBK-EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/GBK-EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/GBK2K-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/GBK2K-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/GBKp-EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/GBKp-EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/GBT-EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/GBT-EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/GBT-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/GBT-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/GBTpc-EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/GBTpc-EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/GBpc-EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/GBpc-EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/HKdla-B5-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/HKdla-B5-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/HKdlb-B5-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/HKdlb-B5-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/HKgccs-B5-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/HKgccs-B5-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/HKm314-B5-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/HKm314-B5-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/HKm471-B5-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/HKm471-B5-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/HKscs-B5-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/HKscs-B5-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/Hankaku-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/Hankaku-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/Hiragana-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/Hiragana-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/KSC-EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/KSC-EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/KSC-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/KSC-Johab-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/KSC-Johab-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/KSC-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/KSCms-UHC-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/KSCms-UHC-HW-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/KSCms-UHC-HW-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/KSCms-UHC-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/KSCpc-EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/KSCpc-EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/Katakana-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/Katakana-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/NWP-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/NWP-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/README.txt +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/Roman-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/Roman-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniCNS-UCS2-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniCNS-UCS2-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniCNS-UTF16-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniCNS-UTF16-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniCNS-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniCNS-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniCNS-UTF8-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniCNS-UTF8-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniGB-UCS2-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniGB-UCS2-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniGB-UTF16-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniGB-UTF16-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniGB-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniGB-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniGB-UTF8-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniGB-UTF8-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniJIS-UCS2-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniJIS-UCS2-HW-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniJIS-UCS2-HW-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniJIS-UCS2-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniJIS-UTF16-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniJIS-UTF16-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniJIS-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniJIS-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniJIS-UTF8-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniJIS-UTF8-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniJIS2004-UTF16-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniJIS2004-UTF16-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniJIS2004-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniJIS2004-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniJIS2004-UTF8-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniJIS2004-UTF8-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniJISX0213-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniJISX0213-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniJISX02132004-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniJISX02132004-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniKS-UCS2-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniKS-UCS2-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniKS-UTF16-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniKS-UTF16-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniKS-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniKS-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniKS-UTF8-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/UniKS-UTF8-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/WP-Symbol-H.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/WP-Symbol-V.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/to-unicode-Adobe-CNS1.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/to-unicode-Adobe-GB1.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/to-unicode-Adobe-Japan1.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmap/to-unicode-Adobe-Korea1.pickle.gz +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/cmapdb.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/converter.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/data_structures.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/encodingdb.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/fontmetrics.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/glyphlist.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/high_level.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/image.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/jbig2.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/latin_enc.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/layout.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/lzw.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/pdfcolor.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/pdfdevice.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/pdfdocument.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/pdfexceptions.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/pdfinterp.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/pdfpage.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/pdfparser.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/pdftypes.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/psexceptions.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/psparser.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/py.typed +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/runlength.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/settings.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/pdfminer/utils.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/progress_monitor.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/tools/generate_font_metadata.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/tools/italic_recognize_tool.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/translator/__init__.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/translator/cache.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/translator/translator.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/utils/__init__.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/utils/atomic_integer.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/utils/priority_thread_pool_executor.py +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/docs/CODE_OF_CONDUCT.md +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/docs/CONTRIBUTING.md +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/docs/CONTRIBUTOR_REWARD.md +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/docs/ImplementationDetails/AsyncTranslate/AsyncTranslate.md +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/docs/ImplementationDetails/ILTranslator/ILTranslator.md +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/docs/ImplementationDetails/PDFCreation/PDFCreation.md +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/docs/ImplementationDetails/PDFParsing/PDFParsing.md +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/docs/ImplementationDetails/ParagraphFinding/ParagraphFinding.md +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/docs/ImplementationDetails/README.md +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/docs/ImplementationDetails/StylesAndFormulas/StylesAndFormulas.md +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/docs/ImplementationDetails/Typesetting/Typesetting.md +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/docs/README.md +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/docs/deploy.sh +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/docs/example/demo_glossary.csv +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/docs/images/babeldoc-banner.png +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/docs/images/babeldoc-big-logo-darkmode-with-transparent-background.png +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/docs/images/babeldoc-big-logo-darkmode-with-transparent-background.svg +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/docs/images/babeldoc-big-logo-with-transparent-background.png +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/docs/images/babeldoc-big-logo-with-transparent-background.svg +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/docs/images/babeldoc-big-logo.png +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/docs/images/babeldoc-contributor_reward_example.png +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/docs/images/babeldoc-preview.gif +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/docs/images/babeldoc-small-logo-with-transparent-background.png +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/docs/images/babeldoc-small-logo-with-transparent-background.svg +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/docs/images/babeldoc-small-logo.png +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/docs/index.md +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/docs/intro-to-pdf-object.md +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/docs/requirements.txt +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/docs/supported_languages.md +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/mkdocs.yml +0 -0
- {babeldoc-0.4.3 → babeldoc-0.4.5}/tests/test_translation_config.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.4.5"
|
{babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/midend/add_debug_information.py
RENAMED
|
@@ -3,7 +3,6 @@ import logging
|
|
|
3
3
|
import babeldoc.format.pdf.document_il.il_version_1 as il_version_1
|
|
4
4
|
from babeldoc.format.pdf.document_il import GraphicState
|
|
5
5
|
from babeldoc.format.pdf.document_il.utils.style_helper import BLUE
|
|
6
|
-
from babeldoc.format.pdf.document_il.utils.style_helper import CYAN
|
|
7
6
|
from babeldoc.format.pdf.document_il.utils.style_helper import ORANGE
|
|
8
7
|
from babeldoc.format.pdf.document_il.utils.style_helper import TEAL
|
|
9
8
|
from babeldoc.format.pdf.document_il.utils.style_helper import YELLOW
|
|
@@ -133,9 +132,9 @@ class AddDebugInformation:
|
|
|
133
132
|
char.visual_bbox.box, TEAL, line_width=0.2
|
|
134
133
|
),
|
|
135
134
|
)
|
|
136
|
-
page.pdf_rectangle.append(
|
|
137
|
-
|
|
138
|
-
)
|
|
135
|
+
# page.pdf_rectangle.append(
|
|
136
|
+
# self._create_rectangle(char.box, CYAN, line_width=0.2),
|
|
137
|
+
# )
|
|
139
138
|
|
|
140
139
|
for xobj in page.pdf_xobject:
|
|
141
140
|
new_paragraphs.append(
|
|
@@ -491,7 +491,7 @@ def do_translate(
|
|
|
491
491
|
pm.total_parts = len(split_points)
|
|
492
492
|
|
|
493
493
|
# Process parts serially
|
|
494
|
-
results: dict[int, TranslateResult] = {}
|
|
494
|
+
results: dict[int, TranslateResult | None] = {}
|
|
495
495
|
original_watermark_mode = (
|
|
496
496
|
translation_config.watermark_output_mode
|
|
497
497
|
)
|
|
@@ -515,6 +515,12 @@ def do_translate(
|
|
|
515
515
|
part_config.page_ranges = [
|
|
516
516
|
(x, x) for x in should_translate_pages
|
|
517
517
|
]
|
|
518
|
+
if (
|
|
519
|
+
translation_config.only_include_translated_page
|
|
520
|
+
and not should_translate_pages
|
|
521
|
+
):
|
|
522
|
+
results[i] = None
|
|
523
|
+
continue
|
|
518
524
|
|
|
519
525
|
# Only first part should do scanned detection if enabled
|
|
520
526
|
if i > 0:
|
|
@@ -805,6 +811,9 @@ def _do_translate_single(
|
|
|
805
811
|
docs = il_creater.create_il()
|
|
806
812
|
logger.debug(f"finish create il from {temp_pdf_path}")
|
|
807
813
|
del il_creater
|
|
814
|
+
if translation_config.only_include_translated_page and not docs.page:
|
|
815
|
+
return None
|
|
816
|
+
|
|
808
817
|
if translation_config.debug:
|
|
809
818
|
xml_converter.write_json(
|
|
810
819
|
docs,
|
|
@@ -16,7 +16,9 @@ class ResultMerger:
|
|
|
16
16
|
def __init__(self, translation_config: TranslationConfig):
|
|
17
17
|
self.config = translation_config
|
|
18
18
|
|
|
19
|
-
def merge_results(
|
|
19
|
+
def merge_results(
|
|
20
|
+
self, results: dict[int, TranslateResult | None]
|
|
21
|
+
) -> TranslateResult:
|
|
20
22
|
"""Merge multiple translation results into one"""
|
|
21
23
|
if not results:
|
|
22
24
|
raise ValueError("No results to merge")
|
|
@@ -35,7 +37,7 @@ class ResultMerger:
|
|
|
35
37
|
dual_file_name_no_watermark = (
|
|
36
38
|
f"{basename}{debug_suffix}.{self.config.lang_out}.dual.pdf"
|
|
37
39
|
)
|
|
38
|
-
|
|
40
|
+
results = {k: v for k, v in results.items() if v is not None}
|
|
39
41
|
# Sort results by part index
|
|
40
42
|
sorted_results = dict(sorted(results.items()))
|
|
41
43
|
first_result = next(iter(sorted_results.values()))
|
|
@@ -354,7 +354,7 @@ class TranslationConfig:
|
|
|
354
354
|
if part_index in self._part_working_dirs:
|
|
355
355
|
part_dir = self._part_working_dirs[part_index]
|
|
356
356
|
if part_dir.exists():
|
|
357
|
-
shutil.rmtree(part_dir)
|
|
357
|
+
shutil.rmtree(part_dir, ignore_errors=True)
|
|
358
358
|
del self._part_working_dirs[part_index]
|
|
359
359
|
|
|
360
360
|
def cleanup_temp_files(self):
|
|
@@ -364,7 +364,7 @@ class TranslationConfig:
|
|
|
364
364
|
self.cleanup_part_working_dir(part_index)
|
|
365
365
|
if self._is_temp_dir:
|
|
366
366
|
logger.info(f"cleanup temp files: {self.working_dir}")
|
|
367
|
-
shutil.rmtree(self.working_dir)
|
|
367
|
+
shutil.rmtree(self.working_dir, ignore_errors=True)
|
|
368
368
|
except Exception:
|
|
369
369
|
logger.exception("Error cleaning up temporary files")
|
|
370
370
|
|
|
@@ -8,6 +8,7 @@ from typing import TYPE_CHECKING
|
|
|
8
8
|
from typing import Any
|
|
9
9
|
from typing import BinaryIO
|
|
10
10
|
from typing import cast
|
|
11
|
+
import freetype
|
|
11
12
|
|
|
12
13
|
from babeldoc.pdfminer.casting import safe_float
|
|
13
14
|
from babeldoc.pdfminer.casting import safe_rect_list
|
|
@@ -749,99 +750,16 @@ class TrueTypeFont:
|
|
|
749
750
|
def create_unicode_map(self) -> FileUnicodeMap:
|
|
750
751
|
if b"cmap" not in self.tables:
|
|
751
752
|
raise TrueTypeFont.CMapNotFound
|
|
752
|
-
(base_offset, length) = self.tables[b"cmap"]
|
|
753
753
|
fp = self.fp
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
cast(tuple[int, int, int], struct.unpack(">HHL", fp.read(8))),
|
|
760
|
-
)
|
|
761
|
-
char2gid: dict[int, int] = {}
|
|
762
|
-
# Only supports subtable type 0, 2 and 4.
|
|
763
|
-
for platform_id, encoding_id, st_offset in subtables:
|
|
764
|
-
# Skip non-Unicode cmaps.
|
|
765
|
-
# https://docs.microsoft.com/en-us/typography/opentype/spec/cmap
|
|
766
|
-
if not (platform_id == 0 or (platform_id == 3 and encoding_id in [1, 10])):
|
|
767
|
-
continue
|
|
768
|
-
fp.seek(base_offset + st_offset)
|
|
769
|
-
(fmttype, fmtlen, fmtlang) = cast(
|
|
770
|
-
tuple[int, int, int],
|
|
771
|
-
struct.unpack(">HHH", fp.read(6)),
|
|
772
|
-
)
|
|
773
|
-
if fmttype == 0:
|
|
774
|
-
char2gid.update(
|
|
775
|
-
enumerate(
|
|
776
|
-
cast(tuple[int, ...], struct.unpack(">256B", fp.read(256))),
|
|
777
|
-
),
|
|
778
|
-
)
|
|
779
|
-
elif fmttype == 2:
|
|
780
|
-
subheaderkeys = cast(
|
|
781
|
-
tuple[int, ...],
|
|
782
|
-
struct.unpack(">256H", fp.read(512)),
|
|
783
|
-
)
|
|
784
|
-
firstbytes = [0] * 8192
|
|
785
|
-
for i, k in enumerate(subheaderkeys):
|
|
786
|
-
firstbytes[k // 8] = i
|
|
787
|
-
nhdrs = max(subheaderkeys) // 8 + 1
|
|
788
|
-
hdrs: list[tuple[int, int, int, int, int]] = []
|
|
789
|
-
for i in range(nhdrs):
|
|
790
|
-
(firstcode, entcount, delta, offset) = cast(
|
|
791
|
-
tuple[int, int, int, int],
|
|
792
|
-
struct.unpack(">HHhH", fp.read(8)),
|
|
793
|
-
)
|
|
794
|
-
hdrs.append((i, firstcode, entcount, delta, fp.tell() - 2 + offset))
|
|
795
|
-
for i, firstcode, entcount, delta, pos in hdrs:
|
|
796
|
-
if not entcount:
|
|
797
|
-
continue
|
|
798
|
-
first = firstcode + (firstbytes[i] << 8)
|
|
799
|
-
fp.seek(pos)
|
|
800
|
-
for c in range(entcount):
|
|
801
|
-
gid = cast(tuple[int], struct.unpack(">H", fp.read(2)))[0]
|
|
802
|
-
if gid:
|
|
803
|
-
gid += delta
|
|
804
|
-
char2gid[first + c] = gid
|
|
805
|
-
elif fmttype == 4:
|
|
806
|
-
(segcount, _1, _2, _3) = cast(
|
|
807
|
-
tuple[int, int, int, int],
|
|
808
|
-
struct.unpack(">HHHH", fp.read(8)),
|
|
809
|
-
)
|
|
810
|
-
segcount //= 2
|
|
811
|
-
ecs = cast(
|
|
812
|
-
tuple[int, ...],
|
|
813
|
-
struct.unpack(">%dH" % segcount, fp.read(2 * segcount)),
|
|
814
|
-
)
|
|
815
|
-
fp.read(2)
|
|
816
|
-
scs = cast(
|
|
817
|
-
tuple[int, ...],
|
|
818
|
-
struct.unpack(">%dH" % segcount, fp.read(2 * segcount)),
|
|
819
|
-
)
|
|
820
|
-
idds = cast(
|
|
821
|
-
tuple[int, ...],
|
|
822
|
-
struct.unpack(">%dh" % segcount, fp.read(2 * segcount)),
|
|
823
|
-
)
|
|
824
|
-
pos = fp.tell()
|
|
825
|
-
idrs = cast(
|
|
826
|
-
tuple[int, ...],
|
|
827
|
-
struct.unpack(">%dH" % segcount, fp.read(2 * segcount)),
|
|
828
|
-
)
|
|
829
|
-
for ec, sc, idd, idr in zip(ecs, scs, idds, idrs, strict=False):
|
|
830
|
-
if idr:
|
|
831
|
-
fp.seek(pos + idr)
|
|
832
|
-
for c in range(sc, ec + 1):
|
|
833
|
-
b = cast(tuple[int], struct.unpack(">H", fp.read(2)))[0]
|
|
834
|
-
char2gid[c] = (b + idd) & 0xFFFF
|
|
835
|
-
else:
|
|
836
|
-
for c in range(sc, ec + 1):
|
|
837
|
-
char2gid[c] = (c + idd) & 0xFFFF
|
|
838
|
-
else:
|
|
839
|
-
assert False, str(("Unhandled", fmttype))
|
|
840
|
-
if not char2gid:
|
|
754
|
+
char2gid = []
|
|
755
|
+
try:
|
|
756
|
+
face = freetype.Face(fp)
|
|
757
|
+
char2gid = list(face.get_chars())
|
|
758
|
+
except Exception:
|
|
841
759
|
raise TrueTypeFont.CMapNotFound
|
|
842
760
|
# create unicode map
|
|
843
761
|
unicode_map = FileUnicodeMap()
|
|
844
|
-
for char, gid in char2gid
|
|
762
|
+
for char, gid in char2gid:
|
|
845
763
|
unicode_map.add_cid2unichr(gid, char)
|
|
846
764
|
return unicode_map
|
|
847
765
|
|
|
@@ -5,7 +5,7 @@ from pathlib import Path
|
|
|
5
5
|
|
|
6
6
|
import orjson
|
|
7
7
|
from babeldoc.const import CACHE_FOLDER
|
|
8
|
-
from babeldoc.format.pdf.document_il.
|
|
8
|
+
from babeldoc.format.pdf.document_il.utils.formular_helper import is_formulas_font
|
|
9
9
|
from babeldoc.format.pdf.translation_config import TranslationConfig
|
|
10
10
|
from rich.console import Console
|
|
11
11
|
from rich.table import Table
|
|
@@ -252,7 +252,6 @@ def main():
|
|
|
252
252
|
translation_config = TranslationConfig(
|
|
253
253
|
*[None for _ in range(3)], lang_out="zh_cn", doc_layout_model=1
|
|
254
254
|
)
|
|
255
|
-
checker = StylesAndFormulas(translation_config)
|
|
256
255
|
|
|
257
256
|
# Create table
|
|
258
257
|
table = Table(title="Font Recognition Results")
|
|
@@ -266,7 +265,7 @@ def main():
|
|
|
266
265
|
for each_font in fonts:
|
|
267
266
|
page_index, font_name, paragraph_index, font_debug_id = each_font
|
|
268
267
|
|
|
269
|
-
if
|
|
268
|
+
if is_formulas_font(font_name, None):
|
|
270
269
|
table.add_row(
|
|
271
270
|
str(page_index),
|
|
272
271
|
str(paragraph_index),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "BabelDOC"
|
|
3
|
-
version = "0.4.
|
|
3
|
+
version = "0.4.5"
|
|
4
4
|
description = "Yet Another Document Translator"
|
|
5
5
|
license = "AGPL-3.0"
|
|
6
6
|
readme = "README.md"
|
|
@@ -157,7 +157,7 @@ pythonpath = [".", "src"]
|
|
|
157
157
|
testpaths = ["tests"]
|
|
158
158
|
|
|
159
159
|
[bumpver]
|
|
160
|
-
current_version = "0.4.
|
|
160
|
+
current_version = "0.4.5"
|
|
161
161
|
version_pattern = "MAJOR.MINOR.PATCH[.PYTAGNUM]"
|
|
162
162
|
|
|
163
163
|
[bumpver.file_patterns]
|
|
@@ -48,7 +48,7 @@ wheels = [
|
|
|
48
48
|
|
|
49
49
|
[[package]]
|
|
50
50
|
name = "babeldoc"
|
|
51
|
-
version = "0.4.
|
|
51
|
+
version = "0.4.5"
|
|
52
52
|
source = { editable = "." }
|
|
53
53
|
dependencies = [
|
|
54
54
|
{ name = "bitstring" },
|
|
@@ -2333,6 +2333,7 @@ sdist = { url = "https://files.pythonhosted.org/packages/bd/62/d29612ca33b7844e7
|
|
|
2333
2333
|
wheels = [
|
|
2334
2334
|
{ url = "https://files.pythonhosted.org/packages/32/5a/3399a2caf51c91db650de57464465b830c2d4ea15b23d24a98182202b704/pymupdf-1.26.1-cp39-abi3-macosx_10_9_x86_64.whl", hash = "sha256:32296f12a7c7f36febd59cee77823a54490313bcaba9879b17def6518186f94e", size = 23054640, upload-time = "2025-06-11T22:14:07.439Z" },
|
|
2335
2335
|
{ url = "https://files.pythonhosted.org/packages/64/e0/cc3ec6a4d5ada8992b8610f134565ceb517243f12736b50d795cb3459315/pymupdf-1.26.1-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:aad7949eca62aca40854510cdb125cf873b181726dc9497a90834200f31faa63", size = 22402766, upload-time = "2025-06-11T22:14:25.557Z" },
|
|
2336
|
+
{ url = "https://files.pythonhosted.org/packages/e8/cf/d5b1cd775a17a7b83e25cbf4c46f64cf1352c962ca97646e3e01953cf0df/pymupdf-1.26.1-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:3b62c4d443121ed9a2eb967c3a0e45f8dbabcc838db8604ece02c4e868808edc", size = 23448474, upload-time = "2025-06-20T17:51:56.446Z" },
|
|
2336
2337
|
{ url = "https://files.pythonhosted.org/packages/82/9f/e7101bd24a0f5cbfa0310c8e5c3a8ec0dd9a86986812ff86ac2fbd273c92/pymupdf-1.26.1-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:a65c411eb1cbb79e40c307e10fbad23658f19e9d7334ac4de21d24b58009a7b9", size = 24056183, upload-time = "2025-06-11T22:14:53.777Z" },
|
|
2337
2338
|
{ url = "https://files.pythonhosted.org/packages/99/39/23ac15cf0edc2877ef366dc7ae041ac199d212433c2c3113661d1a1d5ad0/pymupdf-1.26.1-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:26cebdcc1b2b7a7445423599ce2e0000f2be0333cce0fa0e6846e5a7da46f965", size = 24258802, upload-time = "2025-06-11T22:15:20.499Z" },
|
|
2338
2339
|
{ url = "https://files.pythonhosted.org/packages/e1/8c/56bd5951128d5c5c0b64d2942090c2cd7bc44302bac991b941ac736e3d63/pymupdf-1.26.1-cp39-abi3-win32.whl", hash = "sha256:82ed9e106cf564fc959c0691c374ba68443086ba1a1c9f26128eebbc3e6df9e5", size = 16927933, upload-time = "2025-06-11T22:15:59.72Z" },
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.4.3"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/midend/automatic_term_extractor.py
RENAMED
|
File without changes
|
{babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/midend/detect_scanned_file.py
RENAMED
|
File without changes
|
|
File without changes
|
{babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/midend/il_translator_llm_only.py
RENAMED
|
File without changes
|
|
File without changes
|
{babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/midend/paragraph_finder.py
RENAMED
|
File without changes
|
|
File without changes
|
{babeldoc-0.4.3 → babeldoc-0.4.5}/babeldoc/format/pdf/document_il/midend/styles_and_formulas.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|