Skip to content

Commit

Permalink
[fontc] update skrifa test to new outline API
Browse files Browse the repository at this point in the history
We recently removed the old scale module. Updating here now so this doesn't cause unnecessary breakage when we publish.
  • Loading branch information
dfrg committed Mar 14, 2024
1 parent 8981d4c commit 842a67a
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions fontc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ mod tests {
use skrifa::{
charmap::Charmap,
instance::Size,
outline::DrawSettings,
raw::{
tables::{
cmap::{Cmap, CmapSubtable},
Expand All @@ -514,7 +515,7 @@ mod tests {
types::F2Dot14,
FontData, FontRead, FontReadWithArgs, FontRef, TableProvider,
},
GlyphId, Tag,
GlyphId, MetadataProvider, Tag,
};
use tempfile::{tempdir, TempDir};
use write_fonts::{
Expand Down Expand Up @@ -1448,19 +1449,18 @@ mod tests {
let gid = Charmap::new(font).map(ch).unwrap();

let mut bp = CboxPen::new();
let mut cx = skrifa::scale::Context::new();
cx.new_scaler()
.size(Size::new(1000.0))
.normalized_coords(
coords
.into_iter()
.map(F2Dot14::from_f32)
.collect::<Vec<_>>(),
let coords = coords
.into_iter()
.map(F2Dot14::from_f32)
.collect::<Vec<_>>();
font.outline_glyphs()
.get(gid)
.unwrap()
.draw(
DrawSettings::unhinted(Size::new(1000.0), coords.as_slice()),
&mut bp,
)
.build(font)
.outline(gid, &mut bp)
.unwrap();

bp.cbox().unwrap()
}

Expand Down Expand Up @@ -1490,7 +1490,7 @@ mod tests {
}
}

impl skrifa::scale::Pen for CboxPen {
impl skrifa::outline::OutlinePen for CboxPen {
fn move_to(&mut self, x: f32, y: f32) {
self.last_move = Point::new(x as f64, y as f64);
self.update_bounds(x, y);
Expand Down

0 comments on commit 842a67a

Please sign in to comment.