summaryrefslogtreecommitdiff
path: root/src/bin/main.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2019-06-22 15:32:19 +0200
committerLaurenz <laurmaedje@gmail.com>2019-06-22 15:32:19 +0200
commit099ce71aba54a40455b7ce35768c8fe003f7b16a (patch)
treed0a475e91967882d4608dea59ceb41c9a6232e07 /src/bin/main.rs
parentc7ee2b393a369325b3578557e045f2ff94ceab8f (diff)
Unify font classes + By-value-contexts ⚖
Diffstat (limited to 'src/bin/main.rs')
-rw-r--r--src/bin/main.rs30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/bin/main.rs b/src/bin/main.rs
index b2f3d405..edf639f0 100644
--- a/src/bin/main.rs
+++ b/src/bin/main.rs
@@ -6,7 +6,7 @@ use std::path::{Path, PathBuf};
use std::process;
use typeset::Typesetter;
-use typeset::{font::FileSystemFontProvider, font_info};
+use typeset::{font::FileSystemFontProvider, font};
use typeset::export::pdf::PdfExporter;
@@ -50,20 +50,20 @@ fn run() -> Result<(), Box<Error>> {
// 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![
- ("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])),
+ typesetter.add_font_provider(FileSystemFontProvider::new("../fonts", vec![
+ ("CMU-SansSerif-Regular.ttf", font!["Computer Modern", Regular, SansSerif]),
+ ("CMU-SansSerif-Italic.ttf", font!["Computer Modern", Italic, SansSerif]),
+ ("CMU-SansSerif-Bold.ttf", font!["Computer Modern", Bold, SansSerif]),
+ ("CMU-SansSerif-Bold-Italic.ttf", font!["Computer Modern", Bold, Italic, SansSerif]),
+ ("CMU-Serif-Regular.ttf", font!["Computer Modern", Regular, Serif]),
+ ("CMU-Serif-Italic.ttf", font!["Computer Modern", Italic, Serif]),
+ ("CMU-Serif-Bold.ttf", font!["Computer Modern", Bold, Serif]),
+ ("CMU-Serif-Bold-Italic.ttf", font!["Computer Modern", Bold, Italic, Serif]),
+ ("CMU-Typewriter-Regular.ttf", font!["Computer Modern", Regular, Monospace]),
+ ("CMU-Typewriter-Italic.ttf", font!["Computer Modern", Italic, Monospace]),
+ ("CMU-Typewriter-Bold.ttf", font!["Computer Modern", Bold, Monospace]),
+ ("CMU-Typewriter-Bold-Italic.ttf", font!["Computer Modern", Bold, Italic, Monospace]),
+ ("NotoEmoji-Regular.ttf", font!["Noto", Regular, SansSerif, Serif, Monospace]),
]));
// Typeset the source code.