Merge pull request #2287 from con3code/test/mojikumi-one-em-close-up

Mojikumi: test consecutive punctuation under the one-em line-end set too
This commit is contained in:
aiongg authored and GitHub committed 2026-11-03 19:23:28 -05:00
commit b17dd017d5
1 file changed
+6 -3
+6 -3
View File
@@ -6170,7 +6170,8 @@ fn mojikumi_one_em_line_end_set_sets_closing_punctuation_full_width_at_line_end(
}
/// Consecutive punctuation touches (JLREQ 3.1.4): in 漢」。漢(「漢 the closing bracket and
/// the full stop, and the two opening brackets, close up by half an em each.
/// the full stop, and the two opening brackets, close up by half an em each, under both
/// Japanese base sets (the full stop isn't at the line end, so the line-end rule doesn't apply).
#[test]
fn mojikumi_closes_up_consecutive_punctuation() {
let family = "Mojikumi Consecutive";
@@ -6187,8 +6188,10 @@ fn mojikumi_closes_up_consecutive_punctuation() {
(line.end_x - line.x0, g.face.units_per_em() * g.sx)
};
let (natural, em) = width("Nothing");
let (set, _) = width("LineEndAllOneHalfEmEnum");
assert!((natural - set - em).abs() < 0.01, "{natural} - {set} should be one em ({em})");
for name in ["LineEndAllOneHalfEmEnum", "LineEndAllOneEmEnum"] {
let (set, _) = width(name);
assert!((natural - set - em).abs() < 0.01, "{name}: {natural} - {set} should be one em ({em})");
}
}
fn ruled(text: &str, rect: Rect, columns: u32, edit: impl FnOnce(&mut Document, StoryId)) -> (Document, ItemId, Vec<Rect>) {