mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Handle fallback to default variable font in case of nonexistant generic
This commit is contained in:
parent
7fc01437f4
commit
03e9264ea0
3 changed files with 19 additions and 0 deletions
|
@ -54,6 +54,7 @@ use gecko::values::convert_rgba_to_nscolor;
|
|||
use gecko::values::GeckoStyleCoordConvertible;
|
||||
use gecko::values::round_border_to_device_pixels;
|
||||
use logical_geometry::WritingMode;
|
||||
use media_queries::Device;
|
||||
use properties::animated_properties::TransitionProperty;
|
||||
use properties::longhands;
|
||||
use properties::{Importance, LonghandId};
|
||||
|
@ -1374,6 +1375,12 @@ fn static_assert() {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn fixup_none_generic(&mut self, device: &Device) {
|
||||
unsafe {
|
||||
bindings::Gecko_nsStyleFont_FixupNoneGeneric(&mut self.gecko, &*device.pres_context)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_font_family(&mut self, v: longhands::font_family::computed_value::T) {
|
||||
use properties::longhands::font_family::computed_value::FontFamily;
|
||||
use gecko_bindings::structs::FontFamilyType;
|
||||
|
@ -1381,6 +1388,8 @@ fn static_assert() {
|
|||
let list = &mut self.gecko.mFont.fontlist;
|
||||
unsafe { Gecko_FontFamilyList_Clear(list); }
|
||||
|
||||
self.gecko.mGenericID = structs::kGenericFont_NONE;
|
||||
|
||||
for family in &v.0 {
|
||||
match *family {
|
||||
FontFamily::FamilyName(ref f) => {
|
||||
|
@ -1428,6 +1437,7 @@ fn static_assert() {
|
|||
|
||||
pub fn copy_font_family_from(&mut self, other: &Self) {
|
||||
unsafe { Gecko_CopyFontFamilyFrom(&mut self.gecko.mFont, &other.gecko.mFont); }
|
||||
self.gecko.mGenericID = other.gecko.mGenericID;
|
||||
}
|
||||
|
||||
// FIXME(bholley): Gecko has two different sizes, one of which (mSize) is the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue