Correct fixed point conversion in ft_native_font

This commit is contained in:
Brian Anderson 2012-10-12 00:29:11 -07:00
parent 7c53467246
commit c3170ac865

View file

@ -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;