Skip to content

Commit

Permalink
Fix small caps case
Browse files Browse the repository at this point in the history
  • Loading branch information
timelic authored Dec 23, 2024
1 parent 71632d7 commit 58e2a1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pdf2zh/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def vflag(font: str, char: str): # 匹配公式(和角标)字体
pstk.append(Paragraph(child.y0, child.x0, child.x0, child.x0, child.size, False))
if not cur_v: # 文字入栈
if ( # 根据当前字符修正段落属性
child.size > pstk[-1].size / 0.79 # 1. 当前字符显著比段落字体大
child.size > pstk[-1].size # 1. 当前字符显著比段落字体大
or len(sstk[-1].strip()) == 1 # 2. 当前字符为段落第二个文字(考虑首字母放大的情况)
) and child.get_text() != " ": # 3. 当前字符不是空格
pstk[-1].y -= child.size - pstk[-1].size # 修正段落初始纵坐标,假设两个不同大小字符的上边界对齐
Expand Down

0 comments on commit 58e2a1e

Please sign in to comment.