Layout: end manual tate-chu-yoko at soft return, and use separator metrics for empty continuation line

This commit is contained in:
Taha-Mahmoodi
2026-10-29 20:36:05 +07:00
committed by bflatastic
parent b6df1ef0b1
commit 7511f84d5d
2 changed files with 9 additions and 2 deletions
+8 -1
View File
@@ -392,6 +392,13 @@ fn run_paragraph_lines(cx: &mut Ctx<'_>, pen: &mut Pen<'_>, t: &TextObject, mut
let mut index = 0;
let mut emitted_empty_continuation = false;
loop {
let pm = if index >= n
&& let Some(last) = paragraph.sg.last()
{
Metrics::of(last)
} else {
paragraph.pm
};
let mut placement = PlacementContext {
para: paragraph.para,
pr: &paragraph.pr,
@@ -399,7 +406,7 @@ fn run_paragraph_lines(cx: &mut Ctx<'_>, pen: &mut Pen<'_>, t: &TextObject, mut
continued: paragraph.continued,
rtl: paragraph.rtl,
mirror: paragraph.mirror,
pm: paragraph.pm,
pm,
composed: &paragraph.composed,
hyphen_run,
hyphen_limit: paragraph.hyphen_limit,
+1 -1
View File
@@ -23,7 +23,7 @@ pub(super) fn whole_character_widths(glyphs: &mut [SGlyph]) {
/// before the automatic digit rule.
/// <https://helpx.adobe.com/illustrator/using/formatting-asian-characters.html>
pub(super) fn tate_chu_yoko(g: &mut [SGlyph], style: impl Fn(&SGlyph) -> (f64, bool)) {
let manual: Vec<bool> = g.iter().map(|gl| style(gl).1).collect();
let manual: Vec<bool> = g.iter().map(|gl| gl.ch != '\u{2028}' && style(gl).1).collect();
let digits: Vec<bool> = g.iter().map(|gl| gl.inline.is_none() && gl.ch.is_ascii_digit()).collect();
let mut i = 0;
while i < g.len() {