summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2019-06-22 12:25:01 +0200
committerLaurenz <laurmaedje@gmail.com>2019-06-22 12:25:01 +0200
commitf6fe3b5cdd2805f3975985752f9cb0e04e3daf49 (patch)
treedaddf46ba6add0b7cead1f9015b8f24364672138 /src/bin
parente39a6efccff7ba2b5dd546ddf86f23d2714161e7 (diff)
Implement function layouting ✒
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/main.rs22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/bin/main.rs b/src/bin/main.rs
index 6ca1ba56..b2f3d405 100644
--- a/src/bin/main.rs
+++ b/src/bin/main.rs
@@ -48,16 +48,22 @@ fn run() -> Result<(), Box<Error>> {
let mut src = String::new();
file.read_to_string(&mut src).map_err(|_| "failed to read from source file")?;
- // Create a typesetter with a font provider that provides three fonts
- // (two sans-serif fonts and a fallback for the emoji).
+ // Create a typesetter with a font provider that provides the default fonts.
let mut typesetter = Typesetter::new();
typesetter.add_font_provider(FileSystemFontProvider::new("fonts", vec![
- ("NotoSans-Regular.ttf", font_info!(["NotoSans", "Noto", SansSerif])),
- ("NotoSans-Italic.ttf", font_info!(["NotoSans", "Noto", SansSerif], italic)),
- ("NotoSans-Bold.ttf", font_info!(["NotoSans", "Noto", SansSerif], bold)),
- ("NotoSans-BoldItalic.ttf", font_info!(["NotoSans", "Noto", SansSerif], italic, bold)),
- ("NotoSansMath-Regular.ttf", font_info!(["NotoSansMath", "Noto", SansSerif])),
- ("NotoEmoji-Regular.ttf", font_info!(["NotoEmoji", "Noto", SansSerif, Serif, Monospace])),
+ ("CMU-SansSerif-Regular.ttf", font_info!(["Computer Modern", SansSerif])),
+ ("CMU-SansSerif-Italic.ttf", font_info!(["Computer Modern", SansSerif], italic)),
+ ("CMU-SansSerif-Bold.ttf", font_info!(["Computer Modern", SansSerif], bold)),
+ ("CMU-SansSerif-Bold-Italic.ttf", font_info!(["Computer Modern", SansSerif], bold, italic)),
+ ("CMU-Serif-Regular.ttf", font_info!(["Computer Modern", Serif])),
+ ("CMU-Serif-Italic.ttf", font_info!(["Computer Modern", Serif], italic)),
+ ("CMU-Serif-Bold.ttf", font_info!(["Computer Modern", Serif], bold)),
+ ("CMU-Serif-Bold-Italic.ttf", font_info!(["Computer Modern", Serif], bold, italic)),
+ ("CMU-Typewriter-Regular.ttf", font_info!(["Computer Modern", Monospace])),
+ ("CMU-Typewriter-Italic.ttf", font_info!(["Computer Modern", Monospace], italic)),
+ ("CMU-Typewriter-Bold.ttf", font_info!(["Computer Modern", Monospace], bold)),
+ ("CMU-Typewriter-Bold-Italic.ttf", font_info!(["Computer Modern", Monospace], bold, italic)),
+ ("NotoEmoji-Regular.ttf", font_info!(["NotoEmoji", "Noto", SansSerif, Serif, Monospace])),
]));
// Typeset the source code.