directwrite 0.1.4

A safe abstraction for interacting with DirectWrite, intended initially to be used with direct2d for easy text rendering.
Documentation
use factory::Factory;
use winapi::um::dwrite::IDWriteFontFile;
use wio::com::ComPtr;

pub use self::builder::FontFileBuilder;
pub mod builder;

#[repr(C)]
#[derive(Clone)]
pub struct FontFile {
    ptr: ComPtr<IDWriteFontFile>,
}

impl FontFile {
    pub fn create(factory: &Factory) -> FontFileBuilder {
        unsafe { FontFileBuilder::new(&*factory.get_raw()) }
    }

    pub unsafe fn from_raw(raw: *mut IDWriteFontFile) -> Self {
        FontFile {
            ptr: ComPtr::from_raw(raw),
        }
    }

    pub unsafe fn get_raw(&self) -> *mut IDWriteFontFile {
        self.ptr.as_raw()
    }
}

unsafe impl Send for FontFile {}
unsafe impl Sync for FontFile {}