mirror of
https://github.com/storytold/wordcraft.git
synced 2026-10-31 13:57:18 -06:00
Layout: first-page header test no longer depends on installed fonts (#65)
tall_first_page_header_pushes_body_down compared page 1's first line with the last paragraph on the last page. Where Aptos falls back to Liberation Sans (Linux without Carlito), the last page is nearly full and that paragraph sits below page 1's first line, so the test failed although layout was correct. Compare with the first paragraph on page 2 instead, which is what the test means: later pages don't reserve the tall first-page header's space. Co-authored-by: Dmitrii Khlapov <19991457+dkhlapov@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Dmitrii Khlapov
Claude Opus 5.5
parent
810e176303
commit
daf9a99eb2
@@ -166,7 +166,9 @@ fn tall_first_page_header_pushes_body_down() {
|
||||
let l = lay(&d);
|
||||
let first = l.caret(&Pos::body(0, 0)).unwrap();
|
||||
assert!(first.top > d.last_section.margin_top + 50.0, "{first:?}");
|
||||
let later = l.caret_on(&Pos::body(119, 0), l.pages.len() - 1).unwrap();
|
||||
// The first paragraph on page 2 (which has no header) sits higher than page 1's first line,
|
||||
// whatever the installed fonts do to pagination.
|
||||
let later = (0..120).filter_map(|i| l.caret(&Pos::body(i, 0))).find(|c| c.page == 1).unwrap();
|
||||
assert!(later.top < first.top, "{later:?}");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user