mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Correct fixed point conversion in ft_native_font
This commit is contained in:
parent
7c53467246
commit
c3170ac865
1 changed files with 3 additions and 2 deletions
|
@ -22,11 +22,11 @@ use freetype::bindgen::{
|
||||||
};
|
};
|
||||||
|
|
||||||
fn float_to_fixed_ft(f: float) -> i32 {
|
fn float_to_fixed_ft(f: float) -> i32 {
|
||||||
float_to_fixed(26, f)
|
float_to_fixed(6, f)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fixed_to_float_ft(f: i32) -> float {
|
fn fixed_to_float_ft(f: i32) -> float {
|
||||||
fixed_to_float(26, f)
|
fixed_to_float(6, f)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct FreeTypeNativeFont {
|
struct FreeTypeNativeFont {
|
||||||
|
@ -69,6 +69,7 @@ impl FreeTypeNativeFont {
|
||||||
let void_glyph = (*self.face).glyph;
|
let void_glyph = (*self.face).glyph;
|
||||||
let slot: FT_GlyphSlot = reinterpret_cast(&void_glyph);
|
let slot: FT_GlyphSlot = reinterpret_cast(&void_glyph);
|
||||||
assert slot.is_not_null();
|
assert slot.is_not_null();
|
||||||
|
debug!("metrics: %?", (*slot).metrics);
|
||||||
let advance = (*slot).metrics.horiAdvance;
|
let advance = (*slot).metrics.horiAdvance;
|
||||||
debug!("h_advance for %? is %?", glyph, advance);
|
debug!("h_advance for %? is %?", glyph, advance);
|
||||||
let advance = advance as i32;
|
let advance = advance as i32;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue