mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
stylo: Add basic system font support, use for font-size and font-family
This commit is contained in:
parent
2b5c17c43a
commit
c1c4c8fa59
9 changed files with 261 additions and 11 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue