stylo: Add basic system font support, use for font-size and font-family

This commit is contained in:
Manish Goregaokar 2017-03-21 20:38:12 -07:00 committed by Manish Goregaokar
parent 2b353e04f0
commit 2c5ac9fc2d
9 changed files with 260 additions and 11 deletions

View file

@ -8,9 +8,11 @@
use gecko_bindings::bindings::Gecko_AddRefAtom;
use gecko_bindings::bindings::Gecko_Atomize;
use gecko_bindings::bindings::Gecko_Atomize16;
use gecko_bindings::bindings::Gecko_ReleaseAtom;
use gecko_bindings::structs::nsIAtom;
use precomputed_hash::PrecomputedHash;
use nsstring::nsAString;
use std::borrow::{Cow, Borrow};
use std::char::{self, DecodeUtf16};
use std::fmt::{self, Write};
@ -281,6 +283,17 @@ impl<'a> From<&'a str> for Atom {
}
}
impl<'a> From<&'a nsAString> for Atom {
#[inline]
fn from(string: &nsAString) -> Atom {
unsafe {
Atom(WeakAtom::new(
Gecko_Atomize16(string)
))
}
}
}
impl<'a> From<Cow<'a, str>> for Atom {
#[inline]
fn from(string: Cow<'a, str>) -> Atom {