Skip to content

Commit ad6ed30

Browse files
committed
layout: an extra Chinese line steps at the fitted leading, not half a pitch
When the translation needs one more line than the source and the fitted leading still stacks every line inside the source block, space the lines evenly. baselines_for split one source pitch in half and set 2504 p1's citation line 6.8pt under the line above at 9.8pt.
1 parent a3e2377 commit ad6ed30

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎crates/rpt-core/src/rewrite.rs‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19103,6 +19103,18 @@ fn layout_segment(
1910319103
(0..lines.len())
1910419104
.map(|index| top_y - index as f32 * lead)
1910519105
.collect()
19106+
} else if lines.len() > ink.len()
19107+
&& ink.len() >= 2
19108+
&& leading >= size * 0.95
19109+
&& (lines.len() - 1) as f32 * leading <= (ink[0].y - ink[ink.len() - 1].y) + size * 0.25
19110+
{
19111+
// The Chinese needs one more line than the source, and the fitted
19112+
// leading still stacks every line inside the source block. Splitting
19113+
// one source pitch in half put `(Soudani et al., 2026; …` 6.8pt under
19114+
// the line above it at a 9.8pt size: the two lines overprinted.
19115+
(0..lines.len())
19116+
.map(|index| ink[0].y - index as f32 * leading)
19117+
.collect()
1910619118
} else {
1910719119
baselines_for(&ink, lines.len())
1910819120
};

0 commit comments

Comments
 (0)