pub fn init() -> Result<Sdl2TtfContext, InitError> {
    unsafe {
        if ttf::TTF_WasInit() == 1 {
            Err(InitError::AlreadyInitializedError)
        } else if ttf::TTF_Init() == 0 {
            Ok(Sdl2TtfContext)
        } else {
            Err(InitError::InitializationError(io::Error::last_os_error()))
        }
    }
}
/// Initializes the truetype font API and returns a context manager which will
/// clean up the library once it goes out of scope.
Initializes the truetype font API and returns a context manager which will
clean up the library once it goes out of scope.
Initializes the truetype font API and returns a context manager which will clean up the library once it goes out of scope .
pub fn init() -> Result<Sdl2TtfContext, InitError> {
    unsafe {
        if ttf::TTF_WasInit() == 1 {
            Err(InitError::AlreadyInitializedError)
        } else if ttf::TTF_Init() == 0 {
            Ok(Sdl2TtfContext)
        } else {
            Err(InitError::InitializationError(io::Error::last_os_error()))
        }
    }
}
pub fn init ( ) -> Result < Sdl2TtfContext , InitError > { unsafe { if ttf :: TTF_WasInit ( ) == 1 { Err ( InitError :: AlreadyInitializedError ) } else if ttf :: TTF_Init ( ) == 0 { Ok ( Sdl2TtfContext ) } else { Err ( InitError :: InitializationError ( io :: Error :: last_os_error ( ) ) ) } } }
Initializes the truetype font API and returns a context manager which will
clean up the library once it goes out of scope.
Initializes the truetype font API and returns a context manager which will clean up the library once it goes out of scope .