Skip to content

Commit

Permalink
Merge pull request #142 from funstory-ai/feat/improve-formula-detection
Browse files Browse the repository at this point in the history
feat(formula-detection): improve formula font detection and adjust element order
  • Loading branch information
awwaawwa authored Mar 9, 2025
2 parents 1d6b06b + f57a26a commit d8878c9
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion babeldoc/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.30"
__version__ = "0.1.31"
2 changes: 1 addition & 1 deletion babeldoc/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import subprocess
from pathlib import Path

__version__ = "0.1.30"
__version__ = "0.1.31"

CACHE_FOLDER = Path.home() / ".cache" / "babeldoc"

Expand Down
4 changes: 2 additions & 2 deletions babeldoc/document_il/midend/paragraph_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,10 @@ def _get_layout(
"formula_caption",
"isolate_formula",
"table_footnote",
"table",
"figure",
"table_caption",
"figure_caption",
"table",
"figure",
"abandon",
"plain text",
"tiny text",
Expand Down
2 changes: 1 addition & 1 deletion babeldoc/document_il/midend/styles_and_formulas.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ def is_translatable_formula(self, formula: PdfFormula) -> bool:
return bool(re.match(r"^[0-9, ]+$", text))

def is_formulas_font(self, font_name: str) -> bool:
pattern2 = r"^(Cambria|Cambria-BoldItalic|Cambria-Bold|Cambria-Italic|EUAlbertina.+|NimbusRomNo9L.+)$"
pattern2 = r"^(Cambria|Cambria-BoldItalic|Cambria-Bold|Cambria-Italic|EUAlbertina.+|NimbusRomNo9L.+|GlosaMath.+)$"
if self.translation_config.formular_font_pattern:
pattern = self.translation_config.formular_font_pattern
else:
Expand Down
2 changes: 1 addition & 1 deletion babeldoc/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from babeldoc.translation_config import WatermarkOutputMode

logger = logging.getLogger(__name__)
__version__ = "0.1.30"
__version__ = "0.1.31"


def create_parser():
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "BabelDOC"
version = "0.1.30"
version = "0.1.31"
description = "Yet Another Document Translator"
license = "AGPL-3.0"
readme = "README.md"
Expand Down Expand Up @@ -133,7 +133,7 @@ pythonpath = [".", "src"]
testpaths = ["tests"]

[bumpver]
current_version = "0.1.30"
current_version = "0.1.31"
version_pattern = "MAJOR.MINOR.PATCH[.PYTAGNUM]"

[bumpver.file_patterns]
Expand Down

0 comments on commit d8878c9

Please sign in to comment.