diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-09-30 22:46:03 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-09-30 22:50:14 +0200 |
| commit | 2818ceee44a523308d83643b8d2f921b4a5e5d2e (patch) | |
| tree | 7578dd2e354e64c0265cc6e736828e5803d38762 | |
| parent | 30f302f7ffc464b41f1ac3b6d8fc6b4214835549 (diff) | |
New default fonts
| -rw-r--r-- | NOTICE | 15 | ||||
| -rw-r--r-- | benches/oneshot.rs | 8 | ||||
| -rw-r--r-- | fonts/EBGaramond-Bold.ttf | bin | 601316 -> 0 bytes | |||
| -rw-r--r-- | fonts/EBGaramond-BoldItalic.ttf | bin | 567300 -> 0 bytes | |||
| -rw-r--r-- | fonts/EBGaramond-Italic.ttf | bin | 564280 -> 0 bytes | |||
| -rw-r--r-- | fonts/EBGaramond-Regular.ttf | bin | 599076 -> 0 bytes | |||
| -rw-r--r-- | fonts/IBMPlexMono-Regular.ttf | bin | 0 -> 109272 bytes | |||
| -rw-r--r-- | fonts/IBMPlexSans-Bold.ttf | bin | 0 -> 175212 bytes | |||
| -rw-r--r-- | fonts/IBMPlexSans-BoldItalic.ttf | bin | 0 -> 184200 bytes | |||
| -rw-r--r-- | fonts/IBMPlexSans-Italic.ttf | bin | 0 -> 183496 bytes | |||
| -rw-r--r-- | fonts/IBMPlexSans-Regular.ttf | bin | 0 -> 175232 bytes | |||
| -rw-r--r-- | fonts/IBMPlexSerif-Regular.ttf | bin | 0 -> 159828 bytes | |||
| -rw-r--r-- | fonts/Inconsolata-Bold.ttf | bin | 98260 -> 0 bytes | |||
| -rw-r--r-- | fonts/Inconsolata-Regular.ttf | bin | 97864 -> 0 bytes | |||
| -rw-r--r-- | src/eval/state.rs | 14 | ||||
| -rw-r--r-- | src/loading/fs.rs | 12 | ||||
| -rw-r--r-- | tests/ref/code/array.png | bin | 1971 -> 1899 bytes | |||
| -rw-r--r-- | tests/ref/code/block.png | bin | 1440 -> 1374 bytes | |||
| -rw-r--r-- | tests/ref/code/call.png | bin | 1932 -> 1865 bytes | |||
| -rw-r--r-- | tests/ref/code/closure.png | bin | 657 -> 591 bytes | |||
| -rw-r--r-- | tests/ref/code/comment.png | bin | 1829 -> 1691 bytes | |||
| -rw-r--r-- | tests/ref/code/dict.png | bin | 884 -> 894 bytes | |||
| -rw-r--r-- | tests/ref/code/for.png | bin | 2346 -> 2128 bytes | |||
| -rw-r--r-- | tests/ref/code/if.png | bin | 2090 -> 1825 bytes | |||
| -rw-r--r-- | tests/ref/code/import.png | bin | 1891 -> 1810 bytes | |||
| -rw-r--r-- | tests/ref/code/include.png | bin | 31078 -> 29204 bytes | |||
| -rw-r--r-- | tests/ref/code/let.png | bin | 1465 -> 1239 bytes | |||
| -rw-r--r-- | tests/ref/code/ops.png | bin | 1364 -> 1211 bytes | |||
| -rw-r--r-- | tests/ref/code/repr.png | bin | 10896 -> 9874 bytes | |||
| -rw-r--r-- | tests/ref/code/while.png | bin | 811 -> 761 bytes | |||
| -rw-r--r-- | tests/ref/coma.png | bin | 59057 -> 55412 bytes | |||
| -rw-r--r-- | tests/ref/insert/circle.png | bin | 13064 -> 12600 bytes | |||
| -rw-r--r-- | tests/ref/insert/ellipse.png | bin | 7608 -> 7359 bytes | |||
| -rw-r--r-- | tests/ref/insert/image.png | bin | 219513 -> 219541 bytes | |||
| -rw-r--r-- | tests/ref/insert/rect.png | bin | 2750 -> 2542 bytes | |||
| -rw-r--r-- | tests/ref/insert/square.png | bin | 6213 -> 6124 bytes | |||
| -rw-r--r-- | tests/ref/layout/containers.png | bin | 6258 -> 5804 bytes | |||
| -rw-r--r-- | tests/ref/layout/grid-1.png | bin | 4673 -> 4685 bytes | |||
| -rw-r--r-- | tests/ref/layout/grid-2.png | bin | 10495 -> 9721 bytes | |||
| -rw-r--r-- | tests/ref/layout/grid-3.png | bin | 44758 -> 37133 bytes | |||
| -rw-r--r-- | tests/ref/layout/grid-5.png | bin | 3068 -> 2561 bytes | |||
| -rw-r--r-- | tests/ref/layout/pad.png | bin | 53197 -> 52073 bytes | |||
| -rw-r--r-- | tests/ref/layout/page.png | bin | 7368 -> 6908 bytes | |||
| -rw-r--r-- | tests/ref/layout/pagebreak.png | bin | 1368 -> 1254 bytes | |||
| -rw-r--r-- | tests/ref/layout/spacing.png | bin | 1864 -> 1744 bytes | |||
| -rw-r--r-- | tests/ref/markup/emph.png | bin | 2544 -> 2499 bytes | |||
| -rw-r--r-- | tests/ref/markup/enums.png | bin | 3066 -> 2923 bytes | |||
| -rw-r--r-- | tests/ref/markup/escape.png | bin | 5578 -> 5202 bytes | |||
| -rw-r--r-- | tests/ref/markup/heading.png | bin | 7396 -> 6611 bytes | |||
| -rw-r--r-- | tests/ref/markup/linebreak.png | bin | 593 -> 515 bytes | |||
| -rw-r--r-- | tests/ref/markup/lists.png | bin | 15207 -> 14701 bytes | |||
| -rw-r--r-- | tests/ref/markup/raw.png | bin | 6833 -> 6324 bytes | |||
| -rw-r--r-- | tests/ref/markup/shorthands.png | bin | 2621 -> 2555 bytes | |||
| -rw-r--r-- | tests/ref/markup/strong.png | bin | 2401 -> 2287 bytes | |||
| -rw-r--r-- | tests/ref/text/align.png | bin | 4008 -> 3021 bytes | |||
| -rw-r--r-- | tests/ref/text/basic.png | bin | 37176 -> 35196 bytes | |||
| -rw-r--r-- | tests/ref/text/bidi.png | bin | 15024 -> 13945 bytes | |||
| -rw-r--r-- | tests/ref/text/chinese.png | bin | 16068 -> 14390 bytes | |||
| -rw-r--r-- | tests/ref/text/decorations.png | bin | 9340 -> 9194 bytes | |||
| -rw-r--r-- | tests/ref/text/font.png | bin | 24650 -> 22792 bytes | |||
| -rw-r--r-- | tests/ref/text/linebreaks.png | bin | 10111 -> 9450 bytes | |||
| -rw-r--r-- | tests/ref/text/links.png | bin | 6947 -> 6727 bytes | |||
| -rw-r--r-- | tests/ref/text/par.png | bin | 3632 -> 3432 bytes | |||
| -rw-r--r-- | tests/ref/text/shaping.png | bin | 13298 -> 12021 bytes | |||
| -rw-r--r-- | tests/ref/text/whitespace.png | bin | 6882 -> 5322 bytes | |||
| -rw-r--r-- | tests/ref/utility/basics.png | bin | 873 -> 805 bytes | |||
| -rw-r--r-- | tests/typ/code/for.typ | 4 | ||||
| -rw-r--r-- | tests/typ/code/include.typ | 2 | ||||
| -rw-r--r-- | tests/typ/layout/grid-3.typ | 6 | ||||
| -rw-r--r-- | tests/typ/text/align.typ | 2 | ||||
| -rw-r--r-- | tests/typ/text/basic.typ | 2 | ||||
| -rw-r--r-- | tests/typ/text/bidi.typ | 14 | ||||
| -rw-r--r-- | tests/typ/text/font.typ | 10 | ||||
| -rw-r--r-- | tests/typ/text/linebreaks.typ | 4 | ||||
| -rw-r--r-- | tests/typ/text/par.typ | 7 | ||||
| -rw-r--r-- | tests/typ/text/shaping.typ | 2 | ||||
| -rw-r--r-- | tests/typ/text/whitespace.typ | 6 | ||||
| -rw-r--r-- | tests/typeset.rs | 6 |
78 files changed, 59 insertions, 55 deletions
@@ -3,13 +3,14 @@ Licenses for third party components used by this project can be found below. ================================================================================ The SIL Open Font License Version 1.1 applies to: -* EB Garamond fonts in fonts/EBGaramond-*.ttf - Copyright 2017 The EB Garamond Project Authors - (https://github.com/octaviopardo/EBGaramond12) - -* Inconsolata fonts in fonts/Inconsolata-*.ttf - Copyright 2006 The Inconsolata Project Authors - (https://github.com/cyrealtype/Inconsolata) +* IBM Plex fonts in fonts/IBMPlex-*.ttf + Copyright © 2017 IBM Corp. with Reserved Font Name "Plex" + (https://github.com/IBM/plex) + +* Noto fonts in fonts/Noto-*.ttf + Copyright 2018 The Noto Project Authors + (https://github.com/googlefonts/noto-fonts) + (https://github.com/googlefonts/noto-cjk) * PT Sans fonts in fonts/PTSans-*.ttf Copyright (c) 2010, ParaType Ltd. (http://www.paratype.com/public), diff --git a/benches/oneshot.rs b/benches/oneshot.rs index 2b3fb6ea..dda3c572 100644 --- a/benches/oneshot.rs +++ b/benches/oneshot.rs @@ -10,14 +10,12 @@ use typst::source::{SourceFile, SourceId}; use typst::Context; const SRC: &str = include_str!("bench.typ"); +const FONT: &[u8] = include_bytes!("../fonts/IBMPlexSans-Regular.ttf"); fn context() -> (Context, SourceId) { - let font = include_bytes!("../fonts/EBGaramond-Regular.ttf"); - let loader = MemLoader::new() - .with(Path::new("EBGaramond-Regular.ttf"), &font[..]) - .wrap(); + let loader = MemLoader::new().with(Path::new("font.ttf"), FONT).wrap(); let mut ctx = Context::new(loader); - let id = ctx.sources.provide(Path::new(""), SRC.to_string()); + let id = ctx.sources.provide(Path::new("src.typ"), SRC.to_string()); (ctx, id) } diff --git a/fonts/EBGaramond-Bold.ttf b/fonts/EBGaramond-Bold.ttf Binary files differdeleted file mode 100644 index f380a1c3..00000000 --- a/fonts/EBGaramond-Bold.ttf +++ /dev/null diff --git a/fonts/EBGaramond-BoldItalic.ttf b/fonts/EBGaramond-BoldItalic.ttf Binary files differdeleted file mode 100644 index a4678e1f..00000000 --- a/fonts/EBGaramond-BoldItalic.ttf +++ /dev/null diff --git a/fonts/EBGaramond-Italic.ttf b/fonts/EBGaramond-Italic.ttf Binary files differdeleted file mode 100644 index a7201b00..00000000 --- a/fonts/EBGaramond-Italic.ttf +++ /dev/null diff --git a/fonts/EBGaramond-Regular.ttf b/fonts/EBGaramond-Regular.ttf Binary files differdeleted file mode 100644 index f57146c9..00000000 --- a/fonts/EBGaramond-Regular.ttf +++ /dev/null diff --git a/fonts/IBMPlexMono-Regular.ttf b/fonts/IBMPlexMono-Regular.ttf Binary files differnew file mode 100644 index 00000000..ef3bc4b3 --- /dev/null +++ b/fonts/IBMPlexMono-Regular.ttf diff --git a/fonts/IBMPlexSans-Bold.ttf b/fonts/IBMPlexSans-Bold.ttf Binary files differnew file mode 100644 index 00000000..0e9eb07b --- /dev/null +++ b/fonts/IBMPlexSans-Bold.ttf diff --git a/fonts/IBMPlexSans-BoldItalic.ttf b/fonts/IBMPlexSans-BoldItalic.ttf Binary files differnew file mode 100644 index 00000000..07f8bc87 --- /dev/null +++ b/fonts/IBMPlexSans-BoldItalic.ttf diff --git a/fonts/IBMPlexSans-Italic.ttf b/fonts/IBMPlexSans-Italic.ttf Binary files differnew file mode 100644 index 00000000..9ef096fe --- /dev/null +++ b/fonts/IBMPlexSans-Italic.ttf diff --git a/fonts/IBMPlexSans-Regular.ttf b/fonts/IBMPlexSans-Regular.ttf Binary files differnew file mode 100644 index 00000000..f1c3da2f --- /dev/null +++ b/fonts/IBMPlexSans-Regular.ttf diff --git a/fonts/IBMPlexSerif-Regular.ttf b/fonts/IBMPlexSerif-Regular.ttf Binary files differnew file mode 100644 index 00000000..7d6dc5c1 --- /dev/null +++ b/fonts/IBMPlexSerif-Regular.ttf diff --git a/fonts/Inconsolata-Bold.ttf b/fonts/Inconsolata-Bold.ttf Binary files differdeleted file mode 100644 index 9f927258..00000000 --- a/fonts/Inconsolata-Bold.ttf +++ /dev/null diff --git a/fonts/Inconsolata-Regular.ttf b/fonts/Inconsolata-Regular.ttf Binary files differdeleted file mode 100644 index 457d262c..00000000 --- a/fonts/Inconsolata-Regular.ttf +++ /dev/null diff --git a/src/eval/state.rs b/src/eval/state.rs index b6c0c9af..a71ae39a 100644 --- a/src/eval/state.rs +++ b/src/eval/state.rs @@ -110,8 +110,8 @@ pub struct ParState { impl Default for ParState { fn default() -> Self { Self { - par_spacing: Relative::new(1.0).into(), - line_spacing: Relative::new(0.5).into(), + par_spacing: Relative::new(1.2).into(), + line_spacing: Relative::new(0.65).into(), } } } @@ -235,12 +235,12 @@ pub struct FamilyState { impl Default for FamilyState { fn default() -> Self { Self { - list: Rc::new(vec![FontFamily::Serif]), - serif: Rc::new(vec!["eb garamond".into()]), - sans_serif: Rc::new(vec!["pt sans".into()]), - monospace: Rc::new(vec!["inconsolata".into()]), + list: Rc::new(vec![FontFamily::SansSerif]), + serif: Rc::new(vec!["ibm plex serif".into()]), + sans_serif: Rc::new(vec!["ibm plex sans".into()]), + monospace: Rc::new(vec!["ibm plex mono".into()]), base: Rc::new(vec![ - "eb garamond".into(), + "ibm plex sans".into(), "latin modern math".into(), "twitter color emoji".into(), ]), diff --git a/src/loading/fs.rs b/src/loading/fs.rs index fc49d6b5..34d8e9b5 100644 --- a/src/loading/fs.rs +++ b/src/loading/fs.rs @@ -157,12 +157,12 @@ mod tests { paths.sort(); assert_eq!(paths, [ - Path::new("fonts/EBGaramond-Bold.ttf"), - Path::new("fonts/EBGaramond-BoldItalic.ttf"), - Path::new("fonts/EBGaramond-Italic.ttf"), - Path::new("fonts/EBGaramond-Regular.ttf"), - Path::new("fonts/Inconsolata-Bold.ttf"), - Path::new("fonts/Inconsolata-Regular.ttf"), + Path::new("fonts/IBMPlexMono-Regular.ttf"), + Path::new("fonts/IBMPlexSans-Bold.ttf"), + Path::new("fonts/IBMPlexSans-BoldItalic.ttf"), + Path::new("fonts/IBMPlexSans-Italic.ttf"), + Path::new("fonts/IBMPlexSans-Regular.ttf"), + Path::new("fonts/IBMPlexSerif-Regular.ttf"), Path::new("fonts/LatinModernMath.otf"), Path::new("fonts/NotoSansArabic-Regular.ttf"), Path::new("fonts/NotoSerifCJKsc-Regular.otf"), diff --git a/tests/ref/code/array.png b/tests/ref/code/array.png Binary files differindex c90898c1..752b2318 100644 --- a/tests/ref/code/array.png +++ b/tests/ref/code/array.png diff --git a/tests/ref/code/block.png b/tests/ref/code/block.png Binary files differindex afdd176b..0a43919d 100644 --- a/tests/ref/code/block.png +++ b/tests/ref/code/block.png diff --git a/tests/ref/code/call.png b/tests/ref/code/call.png Binary files differindex a6a7940b..f5e19783 100644 --- a/tests/ref/code/call.png +++ b/tests/ref/code/call.png diff --git a/tests/ref/code/closure.png b/tests/ref/code/closure.png Binary files differindex 043d4a11..17b4ef63 100644 --- a/tests/ref/code/closure.png +++ b/tests/ref/code/closure.png diff --git a/tests/ref/code/comment.png b/tests/ref/code/comment.png Binary files differindex e349b384..c5dffd67 100644 --- a/tests/ref/code/comment.png +++ b/tests/ref/code/comment.png diff --git a/tests/ref/code/dict.png b/tests/ref/code/dict.png Binary files differindex 7b7f4d8c..09751ae8 100644 --- a/tests/ref/code/dict.png +++ b/tests/ref/code/dict.png diff --git a/tests/ref/code/for.png b/tests/ref/code/for.png Binary files differindex 7178b594..852fee49 100644 --- a/tests/ref/code/for.png +++ b/tests/ref/code/for.png diff --git a/tests/ref/code/if.png b/tests/ref/code/if.png Binary files differindex bce70b89..65adcee2 100644 --- a/tests/ref/code/if.png +++ b/tests/ref/code/if.png diff --git a/tests/ref/code/import.png b/tests/ref/code/import.png Binary files differindex 00595f8a..07140364 100644 --- a/tests/ref/code/import.png +++ b/tests/ref/code/import.png diff --git a/tests/ref/code/include.png b/tests/ref/code/include.png Binary files differindex e1494643..62166c64 100644 --- a/tests/ref/code/include.png +++ b/tests/ref/code/include.png diff --git a/tests/ref/code/let.png b/tests/ref/code/let.png Binary files differindex 9805b8ee..0753ae05 100644 --- a/tests/ref/code/let.png +++ b/tests/ref/code/let.png diff --git a/tests/ref/code/ops.png b/tests/ref/code/ops.png Binary files differindex 82e49c8f..a5e06379 100644 --- a/tests/ref/code/ops.png +++ b/tests/ref/code/ops.png diff --git a/tests/ref/code/repr.png b/tests/ref/code/repr.png Binary files differindex bc29db54..4e5ebb13 100644 --- a/tests/ref/code/repr.png +++ b/tests/ref/code/repr.png diff --git a/tests/ref/code/while.png b/tests/ref/code/while.png Binary files differindex 0956fe45..e96caf95 100644 --- a/tests/ref/code/while.png +++ b/tests/ref/code/while.png diff --git a/tests/ref/coma.png b/tests/ref/coma.png Binary files differindex 2d067364..d4c6c3de 100644 --- a/tests/ref/coma.png +++ b/tests/ref/coma.png diff --git a/tests/ref/insert/circle.png b/tests/ref/insert/circle.png Binary files differindex 7e44907b..65b087ed 100644 --- a/tests/ref/insert/circle.png +++ b/tests/ref/insert/circle.png diff --git a/tests/ref/insert/ellipse.png b/tests/ref/insert/ellipse.png Binary files differindex 2e52b515..d429f66e 100644 --- a/tests/ref/insert/ellipse.png +++ b/tests/ref/insert/ellipse.png diff --git a/tests/ref/insert/image.png b/tests/ref/insert/image.png Binary files differindex 0a45e11b..6848726f 100644 --- a/tests/ref/insert/image.png +++ b/tests/ref/insert/image.png diff --git a/tests/ref/insert/rect.png b/tests/ref/insert/rect.png Binary files differindex 5f6df7b6..ad4c48e6 100644 --- a/tests/ref/insert/rect.png +++ b/tests/ref/insert/rect.png diff --git a/tests/ref/insert/square.png b/tests/ref/insert/square.png Binary files differindex 9ecadeeb..a7343a10 100644 --- a/tests/ref/insert/square.png +++ b/tests/ref/insert/square.png diff --git a/tests/ref/layout/containers.png b/tests/ref/layout/containers.png Binary files differindex 4548e2f5..1ade1243 100644 --- a/tests/ref/layout/containers.png +++ b/tests/ref/layout/containers.png diff --git a/tests/ref/layout/grid-1.png b/tests/ref/layout/grid-1.png Binary files differindex f7dda520..acec6f66 100644 --- a/tests/ref/layout/grid-1.png +++ b/tests/ref/layout/grid-1.png diff --git a/tests/ref/layout/grid-2.png b/tests/ref/layout/grid-2.png Binary files differindex 36837663..e04fdadc 100644 --- a/tests/ref/layout/grid-2.png +++ b/tests/ref/layout/grid-2.png diff --git a/tests/ref/layout/grid-3.png b/tests/ref/layout/grid-3.png Binary files differindex ec37e46e..d2882f23 100644 --- a/tests/ref/layout/grid-3.png +++ b/tests/ref/layout/grid-3.png diff --git a/tests/ref/layout/grid-5.png b/tests/ref/layout/grid-5.png Binary files differindex 37666cc3..1b29e0bd 100644 --- a/tests/ref/layout/grid-5.png +++ b/tests/ref/layout/grid-5.png diff --git a/tests/ref/layout/pad.png b/tests/ref/layout/pad.png Binary files differindex fa877d52..cdf08c78 100644 --- a/tests/ref/layout/pad.png +++ b/tests/ref/layout/pad.png diff --git a/tests/ref/layout/page.png b/tests/ref/layout/page.png Binary files differindex 42bcbe11..71c3f18a 100644 --- a/tests/ref/layout/page.png +++ b/tests/ref/layout/page.png diff --git a/tests/ref/layout/pagebreak.png b/tests/ref/layout/pagebreak.png Binary files differindex b671605c..043b5086 100644 --- a/tests/ref/layout/pagebreak.png +++ b/tests/ref/layout/pagebreak.png diff --git a/tests/ref/layout/spacing.png b/tests/ref/layout/spacing.png Binary files differindex c5a1bb80..bffa9507 100644 --- a/tests/ref/layout/spacing.png +++ b/tests/ref/layout/spacing.png diff --git a/tests/ref/markup/emph.png b/tests/ref/markup/emph.png Binary files differindex 7c07108a..d0598406 100644 --- a/tests/ref/markup/emph.png +++ b/tests/ref/markup/emph.png diff --git a/tests/ref/markup/enums.png b/tests/ref/markup/enums.png Binary files differindex f9bc552b..c1eee45d 100644 --- a/tests/ref/markup/enums.png +++ b/tests/ref/markup/enums.png diff --git a/tests/ref/markup/escape.png b/tests/ref/markup/escape.png Binary files differindex 227b1eeb..3f41a516 100644 --- a/tests/ref/markup/escape.png +++ b/tests/ref/markup/escape.png diff --git a/tests/ref/markup/heading.png b/tests/ref/markup/heading.png Binary files differindex fc3ec906..ca52644b 100644 --- a/tests/ref/markup/heading.png +++ b/tests/ref/markup/heading.png diff --git a/tests/ref/markup/linebreak.png b/tests/ref/markup/linebreak.png Binary files differindex 06f4d5f4..4f3678f8 100644 --- a/tests/ref/markup/linebreak.png +++ b/tests/ref/markup/linebreak.png diff --git a/tests/ref/markup/lists.png b/tests/ref/markup/lists.png Binary files differindex 315905b8..fef578ae 100644 --- a/tests/ref/markup/lists.png +++ b/tests/ref/markup/lists.png diff --git a/tests/ref/markup/raw.png b/tests/ref/markup/raw.png Binary files differindex f7bb2ab0..4da6a43e 100644 --- a/tests/ref/markup/raw.png +++ b/tests/ref/markup/raw.png diff --git a/tests/ref/markup/shorthands.png b/tests/ref/markup/shorthands.png Binary files differindex 0a7e4064..aa6436dd 100644 --- a/tests/ref/markup/shorthands.png +++ b/tests/ref/markup/shorthands.png diff --git a/tests/ref/markup/strong.png b/tests/ref/markup/strong.png Binary files differindex cc80690c..6e2a84e1 100644 --- a/tests/ref/markup/strong.png +++ b/tests/ref/markup/strong.png diff --git a/tests/ref/text/align.png b/tests/ref/text/align.png Binary files differindex 9415214b..bde57923 100644 --- a/tests/ref/text/align.png +++ b/tests/ref/text/align.png diff --git a/tests/ref/text/basic.png b/tests/ref/text/basic.png Binary files differindex ef265cbf..1a5a1309 100644 --- a/tests/ref/text/basic.png +++ b/tests/ref/text/basic.png diff --git a/tests/ref/text/bidi.png b/tests/ref/text/bidi.png Binary files differindex b90c6714..db8f77ac 100644 --- a/tests/ref/text/bidi.png +++ b/tests/ref/text/bidi.png diff --git a/tests/ref/text/chinese.png b/tests/ref/text/chinese.png Binary files differindex fa905df6..c47a8a2f 100644 --- a/tests/ref/text/chinese.png +++ b/tests/ref/text/chinese.png diff --git a/tests/ref/text/decorations.png b/tests/ref/text/decorations.png Binary files differindex b1e3171b..0bcba75a 100644 --- a/tests/ref/text/decorations.png +++ b/tests/ref/text/decorations.png diff --git a/tests/ref/text/font.png b/tests/ref/text/font.png Binary files differindex 2dfab870..e194b00a 100644 --- a/tests/ref/text/font.png +++ b/tests/ref/text/font.png diff --git a/tests/ref/text/linebreaks.png b/tests/ref/text/linebreaks.png Binary files differindex c5a826bd..66697a89 100644 --- a/tests/ref/text/linebreaks.png +++ b/tests/ref/text/linebreaks.png diff --git a/tests/ref/text/links.png b/tests/ref/text/links.png Binary files differindex 5ac7ee00..2449880a 100644 --- a/tests/ref/text/links.png +++ b/tests/ref/text/links.png diff --git a/tests/ref/text/par.png b/tests/ref/text/par.png Binary files differindex c3758738..fb493bd4 100644 --- a/tests/ref/text/par.png +++ b/tests/ref/text/par.png diff --git a/tests/ref/text/shaping.png b/tests/ref/text/shaping.png Binary files differindex 09f154ab..565dcb7c 100644 --- a/tests/ref/text/shaping.png +++ b/tests/ref/text/shaping.png diff --git a/tests/ref/text/whitespace.png b/tests/ref/text/whitespace.png Binary files differindex 764c7413..f1421bfe 100644 --- a/tests/ref/text/whitespace.png +++ b/tests/ref/text/whitespace.png diff --git a/tests/ref/utility/basics.png b/tests/ref/utility/basics.png Binary files differindex fd276046..0ac0447b 100644 --- a/tests/ref/utility/basics.png +++ b/tests/ref/utility/basics.png diff --git a/tests/typ/code/for.typ b/tests/typ/code/for.typ index 0785be71..63dab9b8 100644 --- a/tests/typ/code/for.typ +++ b/tests/typ/code/for.typ @@ -14,10 +14,10 @@ ] // Block body. -// Should output `[1st, 2nd, 3rd, 4th, 5th]`. +// Should output `[1st, 2nd, 3rd, 4th]`. { "[" - for v in (1, 2, 3, 4, 5) { + for v in (1, 2, 3, 4) { if v > 1 [, ] [#v] if v == 1 [st] diff --git a/tests/typ/code/include.typ b/tests/typ/code/include.typ index 8a9d0a30..83e00384 100644 --- a/tests/typ/code/include.typ +++ b/tests/typ/code/include.typ @@ -1,6 +1,8 @@ // Test include statements. --- +#page(width: 200pt) + = Document // Include a file diff --git a/tests/typ/layout/grid-3.typ b/tests/typ/layout/grid-3.typ index 59abd5c7..23c5a43c 100644 --- a/tests/typ/layout/grid-3.typ +++ b/tests/typ/layout/grid-3.typ @@ -5,9 +5,9 @@ #grid( columns: 2, gutter-rows: 3 * (8pt,), - [Lorem ipsum dolor sit amet, consectetuer adipiscing elit. + [Lorem ipsum dolor sit amet. - Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis.], + Aenean commodo ligula eget dolor. Aenean massa. Penatibus et magnis.], [Text that is rather short], [Fireflies], [Critical], @@ -71,7 +71,7 @@ [foo], rect(height: 100%, width: 100%, fill: rgb("fc0030"))[Still no height], [bar], - [The nature of being itself is in question. Am I One? Am I Many? What is being alive?], + [The nature of being itself is in question. Am I One? What is being alive?], [baz], [The answer], [42], diff --git a/tests/typ/text/align.typ b/tests/typ/text/align.typ index 9df5cd5e..9d0c48bf 100644 --- a/tests/typ/text/align.typ +++ b/tests/typ/text/align.typ @@ -25,4 +25,4 @@ L #align(right)[R] \ L --- // FIXME: There should be a line break opportunity on alignment change. -LLLLLLLLLLLLL#align(center)[CCCC] +LLLLLLLLLLLLLLLLL#align(center)[CCCC] diff --git a/tests/typ/text/basic.typ b/tests/typ/text/basic.typ index d5f0de05..0c6c8896 100644 --- a/tests/typ/text/basic.typ +++ b/tests/typ/text/basic.typ @@ -1,7 +1,7 @@ // Test simple text. --- -#page(width: 250pt, height: 110pt) +#page(width: 250pt, height: 120pt) But, soft! what light through yonder window breaks? It is the east, and Juliet is the sun. Arise, fair sun, and kill the envious moon, Who is already sick and diff --git a/tests/typ/text/bidi.typ b/tests/typ/text/bidi.typ index 078cb1f9..128e65d4 100644 --- a/tests/typ/text/bidi.typ +++ b/tests/typ/text/bidi.typ @@ -3,7 +3,7 @@ --- // Test reordering with different top-level paragraph directions. #let text = [Text טֶקסט] -#font("EB Garamond", "Noto Serif Hebrew") +#font(serif, "Noto Serif Hebrew") #lang("he") {text} #lang("de") {text} @@ -11,7 +11,7 @@ // Test that consecutive, embedded LTR runs stay LTR. // Here, we have two runs: "A" and italic "B". #let text = [أنت A_B_مطرC] -#font("EB Garamond", "Noto Sans Arabic") +#font(serif, "Noto Sans Arabic") #lang("ar") {text} #lang("de") {text} @@ -19,32 +19,32 @@ // Test that consecutive, embedded RTL runs stay RTL. // Here, we have three runs: "גֶ", bold "שֶׁ", and "ם". #let text = [Aגֶ*שֶׁ*םB] -#font("EB Garamond", "Noto Serif Hebrew") +#font(serif, "Noto Serif Hebrew") #lang("he") {text} #lang("de") {text} --- // Test embedding up to level 4 with isolates. -#font("EB Garamond", "Noto Serif Hebrew", "Twitter Color Emoji") +#font(serif, "Noto Serif Hebrew", "Twitter Color Emoji") #lang(dir: rtl) א\u{2066}A\u{2067}Bב\u{2069}? --- // Test hard line break (leads to two paragraphs in unicode-bidi). -#font("Noto Sans Arabic", "EB Garamond") +#font("Noto Sans Arabic", serif) #lang("ar") Life المطر هو الحياة \ الحياة تمطر is rain. --- // Test spacing. -#font("EB Garamond", "Noto Serif Hebrew") +#font(serif, "Noto Serif Hebrew") L #h(1cm) ריווחR \ Lריווח #h(1cm) R --- // Test inline object. -#font("Noto Serif Hebrew", "EB Garamond") +#font("Noto Serif Hebrew", serif) #lang("he") קרנפיםRh#image("../../res/rhino.png", height: 11pt)inoחיים diff --git a/tests/typ/text/font.typ b/tests/typ/text/font.typ index 6457f7a7..9b60d51c 100644 --- a/tests/typ/text/font.typ +++ b/tests/typ/text/font.typ @@ -2,9 +2,9 @@ --- // Set same font size in three different ways. -#font(22pt)[A] +#font(20pt)[A] #font(200%)[A] -#font(size: 16.5pt + 50%)[A] +#font(size: 15pt + 50%)[A] // Do nothing. #font()[Normal] @@ -19,7 +19,7 @@ #font(stretch: 50%)[Condensed] // Set family. -#font(family: "PT Sans")[Sans serif] +#font(family: serif)[Serif] // Emoji. Emoji: 🐪, 🌋, 🏞 @@ -48,7 +48,9 @@ Emoji: 🐪, 🌋, 🏞 --- // Test top and bottom edge. -#page(width: 170pt) +#page(width: 150pt) +#font(size: 8pt) + #let try(top, bottom) = rect(fill: conifer)[ #font(top-edge: top, bottom-edge: bottom) `From `#top` to `#bottom diff --git a/tests/typ/text/linebreaks.typ b/tests/typ/text/linebreaks.typ index 4d57834a..5f886381 100644 --- a/tests/typ/text/linebreaks.typ +++ b/tests/typ/text/linebreaks.typ @@ -2,7 +2,7 @@ --- // Test overlong word that is not directly after a hard break. -This is a spaceexceedinglylongishy. +This is a spaceexceedinglylongy. --- // Test two overlong words in a row. @@ -10,7 +10,7 @@ Supercalifragilisticexpialidocious Expialigoricmetrioxidation. --- // Test that there are no unwanted line break opportunities on run change. -This is partly emph_as_ized. +This is partly emp_has_ized. --- Hard \ break. diff --git a/tests/typ/text/par.typ b/tests/typ/text/par.typ index 8f8d3946..4b223684 100644 --- a/tests/typ/text/par.typ +++ b/tests/typ/text/par.typ @@ -1,7 +1,8 @@ // Test configuring paragraph properties. --- -#par(spacing: 10pt, leading: 25%) +#par(spacing: 100%, leading: 0pt) -But, soft! what light through yonder window breaks? It is the east, and Juliet -is the sun. +But, soft! what light through yonder window breaks? + +It is the east, and Juliet is the sun. diff --git a/tests/typ/text/shaping.typ b/tests/typ/text/shaping.typ index ba543e71..aa4e3c98 100644 --- a/tests/typ/text/shaping.typ +++ b/tests/typ/text/shaping.typ @@ -20,7 +20,7 @@ Le fira --- // Test font fallback. -#font("EB Garamond", "Noto Sans Arabic", "Twitter Color Emoji") +#font(sans-serif, "Noto Sans Arabic", "Twitter Color Emoji") // Font fallback for emoji. A😀B diff --git a/tests/typ/text/whitespace.typ b/tests/typ/text/whitespace.typ index aefdab34..e01b047c 100644 --- a/tests/typ/text/whitespace.typ +++ b/tests/typ/text/whitespace.typ @@ -30,11 +30,11 @@ A #for _ in (none,) {"B"}C --- // Test that a run consisting only of whitespace isn't trimmed. -A[#font("PT Sans") ]B +A[#font(serif) ]B --- // Test font change after space. -Left [#font("PT Sans")Right]. +Left [#font(serif)Right]. --- // Test that space at start of line is not trimmed. @@ -42,4 +42,4 @@ A{"\n"} B --- // Test that trailing space does not force a line break. -LLLLLLLLLLLLLL R _L_ +LLLLLLLLLLLLLLLLLL R _L_ diff --git a/tests/typeset.rs b/tests/typeset.rs index 25291cd7..778d8f6c 100644 --- a/tests/typeset.rs +++ b/tests/typeset.rs @@ -62,9 +62,9 @@ fn main() { // We want to have "unbounded" pages, so we allow them to be infinitely // large and fit them to match their content. let mut state = State::default(); - let page = state.page_mut(); - page.size = Size::new(Length::pt(120.0), Length::inf()); - page.margins = Sides::splat(Some(Length::pt(10.0).into())); + state.page_mut().size = Size::new(Length::pt(120.0), Length::inf()); + state.page_mut().margins = Sides::splat(Some(Length::pt(10.0).into())); + state.font_mut().size = Length::pt(10.0); // Hook up an assert function into the global scope. let mut std = typst::library::new(); |
