mirror of
https://github.com/encounter/rust-sdl2.git
synced 2026-07-10 21:18:41 -07:00
Make the font heights back into i32s, as the descent was actually signed
This commit is contained in:
@@ -413,31 +413,31 @@ impl Font {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn height(&self) -> u16 {
|
||||
pub fn height(&self) -> i32 {
|
||||
//! Get font maximum total height.
|
||||
unsafe {
|
||||
ffi::TTF_FontHeight(self.raw) as u16
|
||||
ffi::TTF_FontHeight(self.raw) as i32
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the font's highest ascent (height above base).
|
||||
pub fn ascent(&self) -> u16 {
|
||||
pub fn ascent(&self) -> i32 {
|
||||
unsafe {
|
||||
ffi::TTF_FontAscent(self.raw) as u16
|
||||
ffi::TTF_FontAscent(self.raw) as i32
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the font's lowest descent (height below base).
|
||||
pub fn descent(&self) -> u16 {
|
||||
pub fn descent(&self) -> i32 {
|
||||
unsafe {
|
||||
ffi::TTF_FontDescent(self.raw) as u16
|
||||
ffi::TTF_FontDescent(self.raw) as i32
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the recommended line spacing for text rendered with this font.
|
||||
pub fn recommended_line_spacing(&self) -> u16 {
|
||||
pub fn recommended_line_spacing(&self) -> i32 {
|
||||
unsafe {
|
||||
ffi::TTF_FontLineSkip(self.raw) as u16
|
||||
ffi::TTF_FontLineSkip(self.raw) as i32
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user