Add string_cache override for geckolib based on gecko atoms.

The work in these patches is based on Ms2ger's gecko-atom crate.
This commit is contained in:
Bobby Holley 2016-05-11 11:43:54 -07:00
parent 825f610dec
commit b521c293dc
25 changed files with 5153 additions and 185 deletions

View file

@ -133,11 +133,11 @@ struct FontCache {
fn populate_generic_fonts() -> HashMap<FontFamily, LowercaseString> {
let mut generic_fonts = HashMap::with_capacity(5);
append_map(&mut generic_fonts, FontFamily::Serif, "Times New Roman");
append_map(&mut generic_fonts, FontFamily::SansSerif, SANS_SERIF_FONT_FAMILY);
append_map(&mut generic_fonts, FontFamily::Cursive, "Apple Chancery");
append_map(&mut generic_fonts, FontFamily::Fantasy, "Papyrus");
append_map(&mut generic_fonts, FontFamily::Monospace, "Menlo");
append_map(&mut generic_fonts, FontFamily::Generic(atom!("serif")), "Times New Roman");
append_map(&mut generic_fonts, FontFamily::Generic(atom!("sans-serif")), SANS_SERIF_FONT_FAMILY);
append_map(&mut generic_fonts, FontFamily::Generic(atom!("cursive")), "Apple Chancery");
append_map(&mut generic_fonts, FontFamily::Generic(atom!("fantasy")), "Papyrus");
append_map(&mut generic_fonts, FontFamily::Generic(atom!("monospace")), "Menlo");
fn append_map(generic_fonts: &mut HashMap<FontFamily, LowercaseString>,
font_family: FontFamily,

View file

@ -72,6 +72,7 @@ extern crate simd;
extern crate skia;
extern crate smallvec;
#[macro_use]
extern crate string_cache;
extern crate style;
extern crate style_traits;