Commit b84da067 authored by Alex Butler's avatar Alex Butler

Merge branch 'ttf-parser-0.6' into 'master'

Update ttf-parser to 0.6

Closes #149

See merge request !155
parents 945f7869 5b2e17fe
Pipeline #7522 passed with stages
in 4 minutes and 49 seconds
## Unreleased
* Update ttf-parser -> `0.6`.
## 0.9.1
* Use crate owned_ttf_parser to provide `OwnedFont` eliminating direct unsafe usage in rusttype.
* Remove unused legacy trait `BoundingBox`.
......
......@@ -26,7 +26,7 @@ exclude = ["/dev/**"]
features = ["gpu_cache"]
[dependencies]
owned_ttf_parser = { version = "0.5.1", default-features = false }
owned_ttf_parser = { version = "0.6", default-features = false }
ab_glyph_rasterizer = { version = "0.1.1", default-features = false }
libm = { version = "0.2.1", default-features = false, optional = true }
......
......@@ -12,7 +12,6 @@ image = { version = "0.23", default-features = false, features = ["png"] }
once_cell = "1"
blake2 = "0.8"
criterion = "0.3"
ttf-parser = "0.5"
[[bench]]
name = "cache"
......
use rusttype::*;
#[test]
fn move_and_use() {
let owned_data = include_bytes!("../fonts/opensans/OpenSans-Italic.ttf").to_vec();
let pin_font = Font::try_from_vec(owned_data).unwrap();
let ascent = pin_font.v_metrics_unscaled().ascent;
// force a move
let moved = Box::new(pin_font);
assert_eq!(moved.v_metrics_unscaled().ascent, ascent);
}
......@@ -217,10 +217,13 @@ impl<'font> Font<'font> {
};
let kern = self
.inner()
.glyphs_kerning(first_id, second_id)
.kerning_subtables()
.filter(|st| st.is_horizontal() && !st.is_variable())
.filter_map(|st| st.glyphs_kerning(first_id, second_id))
.next()
.unwrap_or(0);
factor * kern as f32
factor * f32::from(kern)
}
/// Computes a scale factor to produce a font whose "height" is 'pixels'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment