summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2019-04-01 12:25:31 +0200
committerLaurenz <laurmaedje@gmail.com>2019-04-01 12:25:31 +0200
commit3b4b55c59ecc85fc7446795f136baf632d0c9449 (patch)
treee2d55007d46312849ba2eaf0c5cf4ec4272379b5 /src/lib.rs
parenta34d725000791215f2793269c4bc3de7374420ff (diff)
Implement bold and italics 📜
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/lib.rs b/src/lib.rs
index f8c0c59b..d9d250b9 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -20,7 +20,7 @@
//! use typeset::export::pdf::PdfExporter;
//!
//! // Simple example source code.
-//! let src = "Hello World from Typeset! 🌍";
+//! let src = "Hello World from __Typeset__! 🌍";
//!
//! // Create a compiler with a font provider that provides three fonts
//! // (the default sans-serif fonts and a fallback for the emoji).
@@ -38,7 +38,7 @@
//! # /*
//! let file = File::create("hello-typeset.pdf").unwrap();
//! # */
-//! # let file = File::create("../target/typeset-hello.pdf").unwrap();
+//! # let file = File::create("../target/typeset-doc-hello.pdf").unwrap();
//! let exporter = PdfExporter::new();
//! exporter.export(&document, file).unwrap();
//! ```
@@ -167,16 +167,16 @@ mod test {
let document = compiler.typeset(src).unwrap();
// Write to file
- let path = format!("../target/typeset-pdf-{}.pdf", name);
+ let path = format!("../target/typeset-unit-{}.pdf", name);
let file = BufWriter::new(File::create(path).unwrap());
let exporter = PdfExporter::new();
exporter.export(&document, file).unwrap();
}
#[test]
- fn small() {
+ fn simple() {
test("parentheses", "Text with ) and ( or (enclosed) works.");
- test("multiline","
+ test("multiline-lorem","
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet
@@ -185,21 +185,22 @@ mod test {
}
#[test]
- fn unicode() {
- test("unicode", "∑mbe∂∂ed font with Unicode!");
- }
-
- #[test]
fn composite_glyph() {
test("composite-glyph", "Composite character‼");
}
#[test]
- fn mixed_emoji() {
+ fn unicode() {
+ test("unicode", "∑mbe∂∂ed font with Unicode!");
test("mixed-emoji", "Hello World 🌍!")
}
#[test]
+ fn styled() {
+ test("styled", "**Hello World**. That's __great__!");
+ }
+
+ #[test]
fn long_wikipedia() {
test("wikipedia", r#"
Typesetting is the composition of text by means of arranging physical types or the