mirror of
https://github.com/servo/servo.git
synced 2025-08-26 07:38:21 +01:00
fonts: Add support for format(*-variations)
to @font-face
(#38832)
This is necessary to fully support font variations. Testing: This will be tested once variations are enabled. Fixes: This is part of #38800. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
09db6b8669
commit
16ba172ba8
1 changed files with 11 additions and 4 deletions
|
@ -20,6 +20,7 @@ use net_traits::request::{Destination, Referrer, RequestBuilder};
|
||||||
use net_traits::{CoreResourceThread, FetchResponseMsg, ResourceThreads, fetch_async};
|
use net_traits::{CoreResourceThread, FetchResponseMsg, ResourceThreads, fetch_async};
|
||||||
use parking_lot::{Mutex, RwLock};
|
use parking_lot::{Mutex, RwLock};
|
||||||
use servo_arc::Arc as ServoArc;
|
use servo_arc::Arc as ServoArc;
|
||||||
|
use servo_config::pref;
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use style::Atom;
|
use style::Atom;
|
||||||
use style::computed_values::font_variant_caps::T as FontVariantCaps;
|
use style::computed_values::font_variant_caps::T as FontVariantCaps;
|
||||||
|
@ -364,10 +365,16 @@ impl FontContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
if let FontFaceSourceFormat::String(string) = format_hint {
|
if let FontFaceSourceFormat::String(string) = format_hint {
|
||||||
return string == "truetype" ||
|
if string == "truetype" || string == "opentype" || string == "woff" || string == "woff2"
|
||||||
string == "opentype" ||
|
{
|
||||||
string == "woff" ||
|
return true;
|
||||||
string == "woff2";
|
}
|
||||||
|
|
||||||
|
return pref!(layout_variable_fonts_enabled) &&
|
||||||
|
(string == "truetype-variations" ||
|
||||||
|
string == "opentype-variations" ||
|
||||||
|
string == "woff-variations" ||
|
||||||
|
string == "woff2-variations");
|
||||||
}
|
}
|
||||||
|
|
||||||
false
|
false
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue