aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/flexbox/construct.rs
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2024-02-11 11:08:49 +0100
committerGitHub <noreply@github.com>2024-02-11 10:08:49 +0000
commitcdc3c369f0bbc338c20df5b50ecaa9b6781aea65 (patch)
tree1a6f418ce654dfb5e2475b264ea90eb0c9ada78a /components/layout_2020/flexbox/construct.rs
parent410ead20b074597349ce65e3d7f77682bcf938f9 (diff)
downloadservo-cdc3c369f0bbc338c20df5b50ecaa9b6781aea65.tar.gz
servo-cdc3c369f0bbc338c20df5b50ecaa9b6781aea65.zip
layout: Implement support for font fallback (#31254)
This adds an initial implementation of font fallback, on part with the one used in legacy layout. There are still issues. For instance, font matching is done per unicode character rather than based on graphemes or the shape first approach of Chrome. The idea is that these changes can be made later.
Diffstat (limited to 'components/layout_2020/flexbox/construct.rs')
-rw-r--r--components/layout_2020/flexbox/construct.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/components/layout_2020/flexbox/construct.rs b/components/layout_2020/flexbox/construct.rs
index 22215651395..55e94b35655 100644
--- a/components/layout_2020/flexbox/construct.rs
+++ b/components/layout_2020/flexbox/construct.rs
@@ -148,12 +148,13 @@ where
.into_par_iter()
.map(|job| match job {
FlexLevelJob::TextRuns(runs) => ArcRefCell::new(FlexLevelBox::FlexItem({
- let runs = runs.into_iter().map(|run| crate::flow::text_run::TextRun {
- base_fragment_info: (&run.info).into(),
- text: run.text.into(),
- parent_style: run.info.style,
- has_uncollapsible_content: false,
- shaped_text: None,
+ let runs = runs.into_iter().map(|run| {
+ crate::flow::text_run::TextRun::new(
+ (&run.info).into(),
+ run.info.style,
+ run.text.into(),
+ false, /* has_uncollapsible_content */
+ )
});
let bfc = BlockFormattingContext::construct_for_text_runs(
runs,