mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-30 04:37:29 -06:00
Layout: end manual tate-chu-yoko at soft return, and use separator metrics for empty continuation line
This commit is contained in:
committed by
bflatastic
parent
b6df1ef0b1
commit
7511f84d5d
@@ -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: ¶graph.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: ¶graph.composed,
|
||||
hyphen_run,
|
||||
hyphen_limit: paragraph.hyphen_limit,
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user