/// Opens the font file with the given `open_args` and reads the face at the given index.
Opens the font file with the given `open_args` and reads the face at the given index.
Opens the font file with the given ` open_args ` and reads the face at the given index .
pub fn open_face(&self, open_args: FTOpenArgs, index: u32) -> Result<FTFace, Error> {
        // Unsafe to call FreeType FFI. On success stores the `FT_Face` pointer in `FTFace`, which
        // calls `FT_Done_Face` in `drop()`.
        unsafe {
            let mut ft_face: FT_Face = ptr::null_mut();
            let err = FT_Open_Face(self.ft_library, open_args.as_ref(), index as i64, &mut ft_face);
            if err != FT_Err_Ok {
                return Err(format_err!(
                    "Failed to parse font {} from {:?}: FreeType error {}",
                    index,
                    open_args.source,
                    err
                ));
            }
            Ok(FTFace { ft_face, open_args })
        }
    }
pub fn open_face ( & self , open_args : FTOpenArgs , index : u32 ) -> Result < FTFace , Error > { // Unsafe to call FreeType FFI. On success stores the `FT_Face` pointer in `FTFace`, which // calls `FT_Done_Face` in `drop()`. unsafe { let mut ft_face : FT_Face = ptr :: null_mut ( ) ; let err = FT_Open_Face ( self . ft_library , open_args . as_ref ( ) , index as i64 , & mut ft_face ) ; if err != FT_Err_Ok { return Err ( format_err ! ( " " index open_args source err ) ) ; } Ok ( FTFace { ft_face , open_args } ) } }
Opens the font file with the given `open_args` and reads the face at the given index.
Opens the font file with the given ` open_args ` and reads the face at the given index .
&self
open_args
FTOpenArgs
index
u32