mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
stylo: Store font metrics provider in thread local style context
This commit is contained in:
parent
2ea8d61fbf
commit
e402c72d0e
19 changed files with 158 additions and 35 deletions
|
@ -73,11 +73,9 @@ impl FontRelativeLength {
|
|||
/// font-family list.
|
||||
pub fn find_first_available_font_metrics(context: &Context) -> Option<FontMetrics> {
|
||||
use font_metrics::FontMetricsQueryResult::*;
|
||||
if let Some(ref metrics_provider) = context.font_metrics_provider {
|
||||
for family in context.style().get_font().font_family_iter() {
|
||||
if let Available(metrics) = metrics_provider.query(family.atom()) {
|
||||
return metrics;
|
||||
}
|
||||
for family in context.style().get_font().font_family_iter() {
|
||||
if let Available(metrics) = context.font_metrics_provider.query(family.atom()) {
|
||||
return metrics;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue