summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-04-21 21:17:25 +0200
committerLaurenz <laurmaedje@gmail.com>2021-04-21 21:17:25 +0200
commit72478946c261f04754c11f8a6abf6eb0f43dea31 (patch)
treeb2a621804d39ace4e57ec4a51b34d40bb4a98987 /tests
parentdf58a4d89b67783b1ffc5c3b7282302d59db8c70 (diff)
Make frames serializable 📚
This also makes serialization support non-optional since it's too much feature-management for too little benefit.
Diffstat (limited to 'tests')
-rw-r--r--tests/typeset.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/typeset.rs b/tests/typeset.rs
index 6aef2746..7aaa017d 100644
--- a/tests/typeset.rs
+++ b/tests/typeset.rs
@@ -11,7 +11,7 @@ use tiny_skia::{
Color, ColorU8, FillRule, FilterQuality, Paint, Pattern, Pixmap, Rect, SpreadMode,
Transform,
};
-use ttf_parser::OutlineBuilder;
+use ttf_parser::{GlyphId, OutlineBuilder};
use walkdir::WalkDir;
use typst::color;
@@ -425,7 +425,7 @@ fn draw_text(canvas: &mut Pixmap, env: &Env, ts: Transform, shaped: &Text) {
// Try drawing SVG if present.
if let Some(tree) = ttf
- .glyph_svg_image(glyph.id)
+ .glyph_svg_image(GlyphId(glyph.id))
.and_then(|data| std::str::from_utf8(data).ok())
.map(|svg| {
let viewbox = format!("viewBox=\"0 0 {0} {0}\" xmlns", units_per_em);
@@ -448,7 +448,7 @@ fn draw_text(canvas: &mut Pixmap, env: &Env, ts: Transform, shaped: &Text) {
} else {
// Otherwise, draw normal outline.
let mut builder = WrappedPathBuilder(tiny_skia::PathBuilder::new());
- if ttf.outline_glyph(glyph.id, &mut builder).is_some() {
+ if ttf.outline_glyph(GlyphId(glyph.id), &mut builder).is_some() {
let path = builder.0.finish().unwrap();
let ts = ts.pre_scale(s, -s);
let mut paint = convert_typst_fill(shaped.color);