diff options
author | Martin Robinson <mrobinson@igalia.com> | 2024-06-19 22:26:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-19 20:26:19 +0000 |
commit | cd2ab36759dc58acdeb2b8321c38b7345b524a63 (patch) | |
tree | 30b940ca93f61d937f719c214d66f22374c90b2f /components/layout_2020/flow/inline | |
parent | 9f8118abc7fd9aba49e422cf13b5243e3b582fdc (diff) | |
download | servo-cd2ab36759dc58acdeb2b8321c38b7345b524a63.tar.gz servo-cd2ab36759dc58acdeb2b8321c38b7345b524a63.zip |
Rename `gfx` to `fonts` (#32556)
This crate only takes care of fonts now as graphics related things are
split into other crates. In addition, this exposes data structures at
the top of the crate, hiding the implementation details and making it
simpler to import them.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Diffstat (limited to 'components/layout_2020/flow/inline')
-rw-r--r-- | components/layout_2020/flow/inline/line.rs | 3 | ||||
-rw-r--r-- | components/layout_2020/flow/inline/mod.rs | 3 | ||||
-rw-r--r-- | components/layout_2020/flow/inline/text_run.rs | 12 |
3 files changed, 8 insertions, 10 deletions
diff --git a/components/layout_2020/flow/inline/line.rs b/components/layout_2020/flow/inline/line.rs index 77e428aa90e..f8752298de3 100644 --- a/components/layout_2020/flow/inline/line.rs +++ b/components/layout_2020/flow/inline/line.rs @@ -6,8 +6,7 @@ use std::vec::IntoIter; use app_units::Au; use atomic_refcell::AtomicRef; -use gfx::font::FontMetrics; -use gfx::text::glyph::GlyphStore; +use fonts::{FontMetrics, GlyphStore}; use servo_arc::Arc; use style::computed_values::white_space_collapse::T as WhiteSpaceCollapse; use style::properties::ComputedValues; diff --git a/components/layout_2020/flow/inline/mod.rs b/components/layout_2020/flow/inline/mod.rs index 18aeb24734b..29ef49ab3f7 100644 --- a/components/layout_2020/flow/inline/mod.rs +++ b/components/layout_2020/flow/inline/mod.rs @@ -79,8 +79,7 @@ use std::mem; use app_units::Au; use bitflags::bitflags; use construct::InlineFormattingContextBuilder; -use gfx::font::FontMetrics; -use gfx::text::glyph::GlyphStore; +use fonts::{FontMetrics, GlyphStore}; use line::{ layout_line_items, AbsolutelyPositionedLineItem, AtomicLineItem, FloatLineItem, InlineBoxLineItem, LineItem, LineItemLayoutState, LineMetrics, TextRunLineItem, diff --git a/components/layout_2020/flow/inline/text_run.rs b/components/layout_2020/flow/inline/text_run.rs index 0b563703f46..d22e7a7c693 100644 --- a/components/layout_2020/flow/inline/text_run.rs +++ b/components/layout_2020/flow/inline/text_run.rs @@ -6,11 +6,11 @@ use std::mem; use std::ops::Range; use app_units::Au; -use gfx::font::{FontRef, ShapingFlags, ShapingOptions}; -use gfx::font_cache_thread::FontCacheThread; -use gfx::font_context::FontContext; -use gfx::text::glyph::GlyphRun; -use gfx_traits::ByteIndex; +use fonts::{ + FontCacheThread, FontContext, FontRef, GlyphRun, ShapingFlags, ShapingOptions, + LAST_RESORT_GLYPH_ADVANCE, +}; +use fonts_traits::ByteIndex; use log::warn; use range::Range as ServoRange; use serde::Serialize; @@ -371,7 +371,7 @@ impl TextRun { let space_width = font .glyph_index(' ') .map(|glyph_id| font.glyph_h_advance(glyph_id)) - .unwrap_or(gfx::font::LAST_RESORT_GLYPH_ADVANCE); + .unwrap_or(LAST_RESORT_GLYPH_ADVANCE); specified_word_spacing.to_used_value(Au::from_f64_px(space_width)) }); |