Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

for mathematical unicode characters, treat as latex #607

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pdf2zh/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ def vflag(font: str, char: str): # 匹配公式(和角标)字体
unicodedata.category(char[0])
in ["Lm", "Mn", "Sk", "Sm", "Zl", "Zp", "Zs"] # 文字修饰符、数学符号、分隔符号
or ord(char[0]) in range(0x370, 0x400) # 希腊字母
or ord(char[0]) in range(0x1D44E, 0x1D468) # Mathematical Italic
or ord(char[0]) in range(0x1D482, 0x1D49C) # Mathematical Bold Italic
or ord(char[0]) in range(0x1D622, 0x1D63C) # Mathematical Sans-Serif Italic
or ord(char[0]) in range(0x1D656, 0x1D670) # Mathematical Sans-Serif Bold Italic
)
):
return True
Expand Down
Loading