BabelDOC 0.3.5__tar.gz → 0.3.6__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.
Files changed (99) hide show
  1. {babeldoc-0.3.5 → babeldoc-0.3.6}/PKG-INFO +1 -1
  2. babeldoc-0.3.6/babeldoc/__init__.py +1 -0
  3. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/assets/embedding_assets_metadata.py +207 -2
  4. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/const.py +1 -1
  5. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/document_il/midend/styles_and_formulas.py +1 -0
  6. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/document_il/midend/typesetting.py +17 -1
  7. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/document_il/utils/fontmap.py +12 -0
  8. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/main.py +1 -1
  9. {babeldoc-0.3.5 → babeldoc-0.3.6}/pyproject.toml +2 -2
  10. {babeldoc-0.3.5 → babeldoc-0.3.6}/uv.lock +324 -318
  11. babeldoc-0.3.5/babeldoc/__init__.py +0 -1
  12. {babeldoc-0.3.5 → babeldoc-0.3.6}/.cursorignore +0 -0
  13. {babeldoc-0.3.5 → babeldoc-0.3.6}/.github/ISSUE_TEMPLATE/bug_report.yaml +0 -0
  14. {babeldoc-0.3.5 → babeldoc-0.3.6}/.github/ISSUE_TEMPLATE/feature_request.yaml +0 -0
  15. {babeldoc-0.3.5 → babeldoc-0.3.6}/.github/PULL_REQUEST_TEMPLATE/pr_form.yml +0 -0
  16. {babeldoc-0.3.5 → babeldoc-0.3.6}/.github/dependabot.yml +0 -0
  17. {babeldoc-0.3.5 → babeldoc-0.3.6}/.github/labels.yml +0 -0
  18. {babeldoc-0.3.5 → babeldoc-0.3.6}/.github/release-drafter.yml +0 -0
  19. {babeldoc-0.3.5 → babeldoc-0.3.6}/.github/workflows/codeql.yml +0 -0
  20. {babeldoc-0.3.5 → babeldoc-0.3.6}/.github/workflows/docs.yml +0 -0
  21. {babeldoc-0.3.5 → babeldoc-0.3.6}/.github/workflows/labeler.yml +0 -0
  22. {babeldoc-0.3.5 → babeldoc-0.3.6}/.github/workflows/publish-to-pypi.yml +0 -0
  23. {babeldoc-0.3.5 → babeldoc-0.3.6}/.github/workflows/test.yml +0 -0
  24. {babeldoc-0.3.5 → babeldoc-0.3.6}/.gitignore +0 -0
  25. {babeldoc-0.3.5 → babeldoc-0.3.6}/.pre-commit-config.yaml +0 -0
  26. {babeldoc-0.3.5 → babeldoc-0.3.6}/LICENSE +0 -0
  27. {babeldoc-0.3.5 → babeldoc-0.3.6}/README.md +0 -0
  28. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/assets/assets.py +0 -0
  29. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/asynchronize/__init__.py +0 -0
  30. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/converter.py +0 -0
  31. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/document_il/__init__.py +0 -0
  32. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/document_il/babeldoc_exception/BabelDOCException.py +0 -0
  33. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/document_il/backend/__init__.py +0 -0
  34. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/document_il/backend/pdf_creater.py +0 -0
  35. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/document_il/frontend/__init__.py +0 -0
  36. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/document_il/frontend/il_creater.py +0 -0
  37. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/document_il/il_version_1.py +0 -0
  38. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/document_il/il_version_1.rnc +0 -0
  39. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/document_il/il_version_1.rng +0 -0
  40. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/document_il/il_version_1.xsd +0 -0
  41. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/document_il/midend/__init__.py +0 -0
  42. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/document_il/midend/add_debug_information.py +0 -0
  43. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/document_il/midend/detect_scanned_file.py +0 -0
  44. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/document_il/midend/il_translator.py +0 -0
  45. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/document_il/midend/il_translator_llm_only.py +0 -0
  46. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/document_il/midend/layout_parser.py +0 -0
  47. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/document_il/midend/paragraph_finder.py +0 -0
  48. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/document_il/midend/remove_descent.py +0 -0
  49. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/document_il/midend/table_parser.py +0 -0
  50. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/document_il/translator/__init__.py +0 -0
  51. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/document_il/translator/cache.py +0 -0
  52. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/document_il/translator/translator.py +0 -0
  53. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/document_il/utils/atomic_integer.py +0 -0
  54. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/document_il/utils/layout_helper.py +0 -0
  55. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/document_il/utils/priority_thread_pool_executor.py +0 -0
  56. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/document_il/utils/style_helper.py +0 -0
  57. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/document_il/xml_converter.py +0 -0
  58. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/docvision/README.md +0 -0
  59. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/docvision/__init__.py +0 -0
  60. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/docvision/doclayout.py +0 -0
  61. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/docvision/rpc_doclayout.py +0 -0
  62. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/docvision/table_detection/rapidocr.py +0 -0
  63. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/high_level.py +0 -0
  64. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/pdfinterp.py +0 -0
  65. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/progress_monitor.py +0 -0
  66. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/result_merger.py +0 -0
  67. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/split_manager.py +0 -0
  68. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/tools/generate_font_metadata.py +0 -0
  69. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/tools/italic_assistance.py +0 -0
  70. {babeldoc-0.3.5 → babeldoc-0.3.6}/babeldoc/translation_config.py +0 -0
  71. {babeldoc-0.3.5 → babeldoc-0.3.6}/docs/CODE_OF_CONDUCT.md +0 -0
  72. {babeldoc-0.3.5 → babeldoc-0.3.6}/docs/CONTRIBUTING.md +0 -0
  73. {babeldoc-0.3.5 → babeldoc-0.3.6}/docs/CONTRIBUTOR_REWARD.md +0 -0
  74. {babeldoc-0.3.5 → babeldoc-0.3.6}/docs/ImplementationDetails/AsyncTranslate/AsyncTranslate.md +0 -0
  75. {babeldoc-0.3.5 → babeldoc-0.3.6}/docs/ImplementationDetails/ILTranslator/ILTranslator.md +0 -0
  76. {babeldoc-0.3.5 → babeldoc-0.3.6}/docs/ImplementationDetails/PDFCreation/PDFCreation.md +0 -0
  77. {babeldoc-0.3.5 → babeldoc-0.3.6}/docs/ImplementationDetails/PDFParsing/PDFParsing.md +0 -0
  78. {babeldoc-0.3.5 → babeldoc-0.3.6}/docs/ImplementationDetails/ParagraphFinding/ParagraphFinding.md +0 -0
  79. {babeldoc-0.3.5 → babeldoc-0.3.6}/docs/ImplementationDetails/README.md +0 -0
  80. {babeldoc-0.3.5 → babeldoc-0.3.6}/docs/ImplementationDetails/StylesAndFormulas/StylesAndFormulas.md +0 -0
  81. {babeldoc-0.3.5 → babeldoc-0.3.6}/docs/ImplementationDetails/Typesetting/Typesetting.md +0 -0
  82. {babeldoc-0.3.5 → babeldoc-0.3.6}/docs/README.md +0 -0
  83. {babeldoc-0.3.5 → babeldoc-0.3.6}/docs/deploy.sh +0 -0
  84. {babeldoc-0.3.5 → babeldoc-0.3.6}/docs/images/babeldoc-banner.png +0 -0
  85. {babeldoc-0.3.5 → babeldoc-0.3.6}/docs/images/babeldoc-big-logo-darkmode-with-transparent-background.png +0 -0
  86. {babeldoc-0.3.5 → babeldoc-0.3.6}/docs/images/babeldoc-big-logo-darkmode-with-transparent-background.svg +0 -0
  87. {babeldoc-0.3.5 → babeldoc-0.3.6}/docs/images/babeldoc-big-logo-with-transparent-background.png +0 -0
  88. {babeldoc-0.3.5 → babeldoc-0.3.6}/docs/images/babeldoc-big-logo-with-transparent-background.svg +0 -0
  89. {babeldoc-0.3.5 → babeldoc-0.3.6}/docs/images/babeldoc-big-logo.png +0 -0
  90. {babeldoc-0.3.5 → babeldoc-0.3.6}/docs/images/babeldoc-contributor_reward_example.png +0 -0
  91. {babeldoc-0.3.5 → babeldoc-0.3.6}/docs/images/babeldoc-preview.gif +0 -0
  92. {babeldoc-0.3.5 → babeldoc-0.3.6}/docs/images/babeldoc-small-logo-with-transparent-background.png +0 -0
  93. {babeldoc-0.3.5 → babeldoc-0.3.6}/docs/images/babeldoc-small-logo-with-transparent-background.svg +0 -0
  94. {babeldoc-0.3.5 → babeldoc-0.3.6}/docs/images/babeldoc-small-logo.png +0 -0
  95. {babeldoc-0.3.5 → babeldoc-0.3.6}/docs/index.md +0 -0
  96. {babeldoc-0.3.5 → babeldoc-0.3.6}/docs/intro-to-pdf-object.md +0 -0
  97. {babeldoc-0.3.5 → babeldoc-0.3.6}/docs/requirements.txt +0 -0
  98. {babeldoc-0.3.5 → babeldoc-0.3.6}/mkdocs.yml +0 -0
  99. {babeldoc-0.3.5 → babeldoc-0.3.6}/tests/test_translation_config.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: BabelDOC
3
- Version: 0.3.5
3
+ Version: 0.3.6
4
4
  Summary: Yet Another Document Translator
5
5
  Project-URL: Homepage, https://github.com/funstory-ai/BabelDOC
6
6
  Project-URL: Issues, https://github.com/funstory-ai/BabelDOC/issues
@@ -0,0 +1 @@
1
+ __version__ = "0.3.6"
@@ -64,6 +64,19 @@ EMBEDDING_FONT_METADATA = {
64
64
  "sha3_256": "4324a60d507c691e6efc97420647f4d2c2d86d9de35009d1c769861b76074ae6",
65
65
  "size": 15515760,
66
66
  },
67
+ "KleeOne-Regular.ttf": {
68
+ "ascent": 1160,
69
+ "bold": 0,
70
+ "descent": -288,
71
+ "encoding_length": 2,
72
+ "file_name": "KleeOne-Regular.ttf",
73
+ "font_name": "Klee One Regular",
74
+ "italic": 0,
75
+ "monospace": 0,
76
+ "serif": 1,
77
+ "sha3_256": "8585c29f89b322d937f83739f61ede5d84297873e1465cad9a120a208ac55ce0",
78
+ "size": 8724704,
79
+ },
67
80
  "LXGWWenKaiGB-Regular.ttf": {
68
81
  "ascent": 928,
69
82
  "bold": 0,
@@ -103,6 +116,123 @@ EMBEDDING_FONT_METADATA = {
103
116
  "sha3_256": "66ccd0ffe8e56cd585dabde8d1292c3f551b390d8ed85f81d7a844825f9c2379",
104
117
  "size": 13100328,
105
118
  },
119
+ "MaruBuri-Regular.ttf": {
120
+ "ascent": 800,
121
+ "bold": 0,
122
+ "descent": -200,
123
+ "encoding_length": 2,
124
+ "file_name": "MaruBuri-Regular.ttf",
125
+ "font_name": "MaruBuri Regular",
126
+ "italic": 0,
127
+ "monospace": 0,
128
+ "serif": 1,
129
+ "sha3_256": "abb672dde7b89e06914ce27c59159b7a2933f26207bfcc47981c67c11c41e6d1",
130
+ "size": 3268988,
131
+ },
132
+ "NotoSans-Bold.ttf": {
133
+ "ascent": 1069,
134
+ "bold": 1,
135
+ "descent": -293,
136
+ "encoding_length": 2,
137
+ "file_name": "NotoSans-Bold.ttf",
138
+ "font_name": "Noto Sans Bold",
139
+ "italic": 0,
140
+ "monospace": 0,
141
+ "serif": 1,
142
+ "sha3_256": "ecd38d472c1cad07d8a5dffd2b5a0f72edcd40fff2b4e68d770da8f2ef343a82",
143
+ "size": 630964,
144
+ },
145
+ "NotoSans-BoldItalic.ttf": {
146
+ "ascent": 1069,
147
+ "bold": 1,
148
+ "descent": -293,
149
+ "encoding_length": 2,
150
+ "file_name": "NotoSans-BoldItalic.ttf",
151
+ "font_name": "Noto Sans Bold Italic",
152
+ "italic": 1,
153
+ "monospace": 0,
154
+ "serif": 1,
155
+ "sha3_256": "0b6c690a4a6b7d605b2ecbde00c7ac1a23e60feb17fa30d8b972d61ec3ff732b",
156
+ "size": 644340,
157
+ },
158
+ "NotoSans-Italic.ttf": {
159
+ "ascent": 1069,
160
+ "bold": 0,
161
+ "descent": -293,
162
+ "encoding_length": 2,
163
+ "file_name": "NotoSans-Italic.ttf",
164
+ "font_name": "Noto Sans Italic",
165
+ "italic": 1,
166
+ "monospace": 0,
167
+ "serif": 1,
168
+ "sha3_256": "830652f61724c017e5a29a96225b484a2ccbd25f69a1b3f47e5f466a2dbed1ad",
169
+ "size": 642344,
170
+ },
171
+ "NotoSans-Regular.ttf": {
172
+ "ascent": 1069,
173
+ "bold": 0,
174
+ "descent": -293,
175
+ "encoding_length": 2,
176
+ "file_name": "NotoSans-Regular.ttf",
177
+ "font_name": "Noto Sans Regular",
178
+ "italic": 0,
179
+ "monospace": 0,
180
+ "serif": 1,
181
+ "sha3_256": "7dfe2bbf97dc04c852d1223b220b63430e6ad03b0dbb28ebe6328a20a2d45eb8",
182
+ "size": 629024,
183
+ },
184
+ "NotoSerif-Bold.ttf": {
185
+ "ascent": 1069,
186
+ "bold": 1,
187
+ "descent": -293,
188
+ "encoding_length": 2,
189
+ "file_name": "NotoSerif-Bold.ttf",
190
+ "font_name": "Noto Serif Bold",
191
+ "italic": 0,
192
+ "monospace": 0,
193
+ "serif": 1,
194
+ "sha3_256": "28d88d924285eadb9f9ce49f2d2b95473f89a307b226c5f6ebed87a654898312",
195
+ "size": 506864,
196
+ },
197
+ "NotoSerif-BoldItalic.ttf": {
198
+ "ascent": 1069,
199
+ "bold": 1,
200
+ "descent": -293,
201
+ "encoding_length": 2,
202
+ "file_name": "NotoSerif-BoldItalic.ttf",
203
+ "font_name": "Noto Serif Bold Italic",
204
+ "italic": 1,
205
+ "monospace": 0,
206
+ "serif": 1,
207
+ "sha3_256": "b69ee56af6351b2fb4fbce623f8e1c1f9fb19170686a9e5db2cf260b8cf24ac7",
208
+ "size": 535724,
209
+ },
210
+ "NotoSerif-Italic.ttf": {
211
+ "ascent": 1069,
212
+ "bold": 0,
213
+ "descent": -293,
214
+ "encoding_length": 2,
215
+ "file_name": "NotoSerif-Italic.ttf",
216
+ "font_name": "Noto Serif Italic",
217
+ "italic": 1,
218
+ "monospace": 0,
219
+ "serif": 1,
220
+ "sha3_256": "9b7773c24ab8a29e3c1c03efa4ab652d051e4c209134431953463aa946d62868",
221
+ "size": 535340,
222
+ },
223
+ "NotoSerif-Regular.ttf": {
224
+ "ascent": 1069,
225
+ "bold": 0,
226
+ "descent": -293,
227
+ "encoding_length": 2,
228
+ "file_name": "NotoSerif-Regular.ttf",
229
+ "font_name": "Noto Serif Regular",
230
+ "italic": 0,
231
+ "monospace": 0,
232
+ "serif": 1,
233
+ "sha3_256": "c2bbe984e65bafd3bcd38b3cb1e1344f3b7b79d6beffc7a3d883b57f8358559d",
234
+ "size": 504932,
235
+ },
106
236
  "SourceHanSansCN-Bold.ttf": {
107
237
  "ascent": 1160,
108
238
  "bold": 1,
@@ -424,21 +554,96 @@ TW_FONT_FAMILY = {
424
554
  "base": ["SourceHanSansCN-Regular.ttf"],
425
555
  }
426
556
 
557
+ KR_FONT_FAMILY = {
558
+ "script": ["MaruBuri-Regular.ttf"],
559
+ "normal": [
560
+ "SourceHanSerifKR-Bold.ttf",
561
+ "SourceHanSerifKR-Regular.ttf",
562
+ "SourceHanSansKR-Bold.ttf",
563
+ "SourceHanSansKR-Regular.ttf",
564
+ "SourceHanSerifCN-Bold.ttf",
565
+ "SourceHanSerifCN-Regular.ttf",
566
+ "SourceHanSansCN-Bold.ttf",
567
+ "SourceHanSansCN-Regular.ttf",
568
+ ],
569
+ "fallback": [
570
+ "GoNotoKurrent-Regular.ttf",
571
+ "GoNotoKurrent-Bold.ttf",
572
+ ],
573
+ "base": ["SourceHanSansCN-Regular.ttf"],
574
+ }
575
+
576
+ JP_FONT_FAMILY = {
577
+ "script": ["KleeOne-Regular.ttf"],
578
+ "normal": [
579
+ "SourceHanSerifJP-Bold.ttf",
580
+ "SourceHanSerifJP-Regular.ttf",
581
+ "SourceHanSansJP-Bold.ttf",
582
+ "SourceHanSansJP-Regular.ttf",
583
+ "SourceHanSerifCN-Bold.ttf",
584
+ "SourceHanSerifCN-Regular.ttf",
585
+ "SourceHanSansCN-Bold.ttf",
586
+ "SourceHanSansCN-Regular.ttf",
587
+ ],
588
+ "fallback": [
589
+ "GoNotoKurrent-Regular.ttf",
590
+ "GoNotoKurrent-Bold.ttf",
591
+ ],
592
+ "base": ["SourceHanSansCN-Regular.ttf"],
593
+ }
594
+
595
+ EN_FONT_FAMILY = {
596
+ "script": [
597
+ "NotoSans-Italic.ttf",
598
+ "NotoSans-BoldItalic.ttf",
599
+ "NotoSerif-Italic.ttf",
600
+ "NotoSerif-BoldItalic.ttf",
601
+ ],
602
+ "normal": [
603
+ "NotoSerif-Regular.ttf",
604
+ "NotoSerif-Bold.ttf",
605
+ "NotoSans-Regular.ttf",
606
+ "NotoSans-Bold.ttf",
607
+ "SourceHanSerifCN-Bold.ttf",
608
+ "SourceHanSerifCN-Regular.ttf",
609
+ "SourceHanSansCN-Bold.ttf",
610
+ "SourceHanSansCN-Regular.ttf",
611
+ ],
612
+ "fallback": [
613
+ "GoNotoKurrent-Regular.ttf",
614
+ "GoNotoKurrent-Bold.ttf",
615
+ ],
616
+ "base": [
617
+ "NotoSans-Regular.ttf",
618
+ ],
619
+ }
620
+
427
621
  ALL_FONT_FAMILY = {
428
622
  "CN": CN_FONT_FAMILY,
429
623
  "HK": HK_FONT_FAMILY,
430
624
  "TW": TW_FONT_FAMILY,
625
+ "KR": KR_FONT_FAMILY,
626
+ "JP": JP_FONT_FAMILY,
627
+ "EN": EN_FONT_FAMILY,
431
628
  }
432
629
 
433
630
 
434
631
  def get_font_family(lang_code: str):
435
632
  lang_code = lang_code.upper()
436
- if "HK" in lang_code:
633
+ if "KR" in lang_code:
634
+ font_family = KR_FONT_FAMILY
635
+ elif "JP" in lang_code:
636
+ font_family = JP_FONT_FAMILY
637
+ elif "HK" in lang_code:
437
638
  font_family = HK_FONT_FAMILY
438
639
  elif "TW" in lang_code:
439
640
  font_family = TW_FONT_FAMILY
440
- else:
641
+ elif "EN" in lang_code:
642
+ font_family = EN_FONT_FAMILY
643
+ elif "CN" in lang_code:
441
644
  font_family = CN_FONT_FAMILY
645
+ else:
646
+ font_family = EN_FONT_FAMILY
442
647
  verify_font_family(font_family)
443
648
  return font_family
444
649
 
@@ -3,7 +3,7 @@ import shutil
3
3
  import subprocess
4
4
  from pathlib import Path
5
5
 
6
- __version__ = "0.3.5"
6
+ __version__ = "0.3.6"
7
7
 
8
8
  CACHE_FOLDER = Path.home() / ".cache" / "babeldoc"
9
9
 
@@ -548,6 +548,7 @@ class StylesAndFormulas:
548
548
  r"|.*AGaramondPro.*"
549
549
  r"|.*PalatinoItalCOR.*"
550
550
  r"|.*ITCSymbolStd.*"
551
+ r"|.*PlantinStd.*"
551
552
  r")$"
552
553
  )
553
554
  if self.translation_config.formular_font_pattern:
@@ -97,7 +97,23 @@ class TypesettingUnit:
97
97
  unicode = self.try_get_unicode()
98
98
  if not unicode:
99
99
  return True
100
- if re.match(r"^[a-zA-Z0-9]+$", unicode):
100
+ if re.match(
101
+ r"^["
102
+ r"a-z"
103
+ r"A-Z"
104
+ r"0-9"
105
+ r"\u00C0-\u00FF" # Latin-1 Supplement
106
+ r"\u0100-\u017F" # Latin Extended A
107
+ r"\u0180-\u024F" # Latin Extended B
108
+ r"\u1E00-\u1EFF" # Latin Extended Additional
109
+ r"\u2C60-\u2C7F" # Latin Extended C
110
+ r"\uA720-\uA7FF" # Latin Extended D
111
+ r"\uAB30-\uAB6F" # Latin Extended E
112
+ r"\u0250-\u02A0" # IPA Extensions
113
+ r"\u0400-\u04FF" # Cyrillic
114
+ r"]+$",
115
+ unicode,
116
+ ):
101
117
  return False
102
118
  return True
103
119
 
@@ -104,6 +104,8 @@ class FontMapper:
104
104
  char_unicode: str,
105
105
  font_type: str,
106
106
  ):
107
+ if font_type == "script" and not italic:
108
+ return None
107
109
  current_char = ord(char_unicode)
108
110
  for font in self.type2font[font_type]:
109
111
  if not font.has_glyph(current_char):
@@ -139,6 +141,12 @@ class FontMapper:
139
141
  )
140
142
  return None
141
143
 
144
+ script_font_map_result = self.map_in_type(
145
+ bold, italic, monospaced, serif, char_unicode, "script"
146
+ )
147
+ if script_font_map_result:
148
+ return script_font_map_result
149
+
142
150
  for script_font in self.script_fonts:
143
151
  if italic and script_font.has_glyph(current_char):
144
152
  return script_font
@@ -155,6 +163,10 @@ class FontMapper:
155
163
  if fallback_font_map_result is not None:
156
164
  return fallback_font_map_result
157
165
 
166
+ for font in self.fallback_fonts:
167
+ if font.has_glyph(current_char):
168
+ return font
169
+
158
170
  logger.warning(
159
171
  f"Can't find font for {char_unicode}({current_char}). "
160
172
  f"Original font: {original_font.name}[{original_font.font_id}]. "
@@ -23,7 +23,7 @@ from babeldoc.translation_config import TranslationConfig
23
23
  from babeldoc.translation_config import WatermarkOutputMode
24
24
 
25
25
  logger = logging.getLogger(__name__)
26
- __version__ = "0.3.5"
26
+ __version__ = "0.3.6"
27
27
 
28
28
 
29
29
  def create_parser():
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "BabelDOC"
3
- version = "0.3.5"
3
+ version = "0.3.6"
4
4
  description = "Yet Another Document Translator"
5
5
  license = "AGPL-3.0"
6
6
  readme = "README.md"
@@ -148,7 +148,7 @@ pythonpath = [".", "src"]
148
148
  testpaths = ["tests"]
149
149
 
150
150
  [bumpver]
151
- current_version = "0.3.5"
151
+ current_version = "0.3.6"
152
152
  version_pattern = "MAJOR.MINOR.PATCH[.PYTAGNUM]"
153
153
 
154
154
  [bumpver.file_patterns]