pub fn size_of(&self, text: &str) -> FontResult<(u32, u32)> {
        let c_string = RenderableText::Utf8(text).convert()?;
        let (res, size) = unsafe {
            let mut w = 0; // mutated by C code
            let mut h = 0; // mutated by C code
            let ret = ttf::TTF_SizeUTF8(self.raw, c_string.as_ptr(), &mut w, &mut h);
            (ret, (w as u32, h as u32))
        };
        if res == 0 {
            Ok(size)
        } else {
            Err(FontError::SdlError(get_error()))
        }
    }
/// Returns the width and height of the given text when rendered using this
/// font.
Returns the width and height of the given text when rendered using this
font.
Returns the width and height of the given text when rendered using this font .
pub fn size_of(&self, text: &str) -> FontResult<(u32, u32)> {
        let c_string = RenderableText::Utf8(text).convert()?;
        let (res, size) = unsafe {
            let mut w = 0; // mutated by C code
            let mut h = 0; // mutated by C code
            let ret = ttf::TTF_SizeUTF8(self.raw, c_string.as_ptr(), &mut w, &mut h);
            (ret, (w as u32, h as u32))
        };
        if res == 0 {
            Ok(size)
        } else {
            Err(FontError::SdlError(get_error()))
        }
    }
pub fn size_of ( & self , text : & str ) -> FontResult < ( u32 , u32 ) > { let c_string = RenderableText :: Utf8 ( text ) . convert ( ) ? ; let ( res , size ) = unsafe { let mut w = 0 ; // mutated by C code let mut h = 0 ; // mutated by C code let ret = ttf :: TTF_SizeUTF8 ( self . raw , c_string . as_ptr ( ) , & mut w , & mut h ) ; ( ret , ( w as u32 , h as u32 ) ) } ; if res == 0 { Ok ( size ) } else { Err ( FontError :: SdlError ( get_error ( ) ) ) } }
Returns the width and height of the given text when rendered using this
font.
Returns the width and height of the given text when rendered using this font .
&self
text
&str
&self
text
&str