pub fn add_memory_font(bin: &mut [u8]) -> Result<MemFont, ()> {
        use winapi::um::wingdi::AddFontMemResourceEx;

        let bin_len = bin.len();
        let mut num_fonts = 0;
        let handle = unsafe {
            AddFontMemResourceEx(
                bin.as_mut_ptr() as _,
                bin_len as _,
                ptr::null_mut(),
                &mut num_fonts,
            )
        };

        if num_fonts > 0 {
            Ok(MemFont(handle))
        } else {
            Err(())
        }
    }
/**
        Add a font resource from a binary source. Returns a memory font handle if the font was loaded succesfully.
        Send the handle to `remove_memory_font` at the end of your program to free the font from memory.
    */
Add a font resource from a binary source. Returns a memory font handle if the font was loaded succesfully.
Send the handle to `remove_memory_font` at the end of your program to free the font from memory.
Add a font resource from a binary source . Returns a memory font handle if the font was loaded succesfully . Send the handle to ` remove_memory_font ` at the end of your program to free the font from memory .
pub fn add_memory_font(bin: &mut [u8]) -> Result<MemFont, ()> {
        use winapi::um::wingdi::AddFontMemResourceEx;
        let bin_len = bin.len();
        let mut num_fonts = 0;
        let handle = unsafe {
            AddFontMemResourceEx(
                bin.as_mut_ptr() as _,
                bin_len as _,
                ptr::null_mut(),
                &mut num_fonts,
            )
        };
        if num_fonts > 0 {
            Ok(MemFont(handle))
        } else {
            Err(())
        }
    }
pub fn add_memory_font ( bin : & mut [ u8 ] ) -> Result < MemFont , ( ) > { use winapi :: um :: wingdi :: AddFontMemResourceEx ; let bin_len = bin . len ( ) ; let mut num_fonts = 0 ; let handle = unsafe { AddFontMemResourceEx ( bin . as_mut_ptr ( ) as _ , bin_len as _ , ptr :: null_mut ( ) , & mut num_fonts , ) } ; if num_fonts > 0 { Ok ( MemFont ( handle ) ) } else { Err ( ( ) ) } }
Add a font resource from a binary source.
Add a font resource from a binary source .
bin
&mut [u8]