mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
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>
This commit is contained in:
parent
9f8118abc7
commit
cd2ab36759
159 changed files with 224 additions and 266 deletions
|
@ -23,8 +23,8 @@ embedder_traits = { workspace = true }
|
|||
euclid = { workspace = true }
|
||||
fnv = { workspace = true }
|
||||
fxhash = { workspace = true }
|
||||
gfx = { path = "../gfx" }
|
||||
gfx_traits = { workspace = true }
|
||||
fonts = { path = "../fonts" }
|
||||
fonts_traits = { workspace = true }
|
||||
html5ever = { workspace = true }
|
||||
icu_segmenter = { workspace = true }
|
||||
ipc-channel = { workspace = true }
|
||||
|
|
|
@ -6,8 +6,7 @@ use std::sync::Arc;
|
|||
|
||||
use base::id::PipelineId;
|
||||
use fnv::FnvHashMap;
|
||||
use gfx::font_cache_thread::FontCacheThread;
|
||||
use gfx::font_context::FontContext;
|
||||
use fonts::{FontCacheThread, FontContext};
|
||||
use net_traits::image_cache::{
|
||||
ImageCache, ImageCacheResult, ImageOrMetadataAvailable, UsePlaceholder,
|
||||
};
|
||||
|
|
|
@ -10,7 +10,7 @@ use base::WebRenderEpochToU16;
|
|||
use embedder_traits::Cursor;
|
||||
use euclid::{Point2D, SideOffsets2D, Size2D};
|
||||
use fnv::FnvHashMap;
|
||||
use gfx::text::glyph::GlyphStore;
|
||||
use fonts::GlyphStore;
|
||||
use net_traits::image_cache::UsePlaceholder;
|
||||
use servo_geometry::MaxRect;
|
||||
use style::color::{AbsoluteColor, ColorSpace};
|
||||
|
@ -962,7 +962,7 @@ fn glyphs(
|
|||
mut baseline_origin: PhysicalPoint<Length>,
|
||||
justification_adjustment: Length,
|
||||
) -> Vec<wr::GlyphInstance> {
|
||||
use gfx_traits::ByteIndex;
|
||||
use fonts_traits::ByteIndex;
|
||||
use range::Range;
|
||||
|
||||
let mut glyphs = vec![];
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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))
|
||||
});
|
||||
|
||||
|
|
|
@ -7,8 +7,7 @@ use std::sync::Arc;
|
|||
use app_units::Au;
|
||||
use base::id::{BrowsingContextId, PipelineId};
|
||||
use base::print_tree::PrintTree;
|
||||
use gfx::font::FontMetrics;
|
||||
use gfx::text::glyph::GlyphStore;
|
||||
use fonts::{FontMetrics, GlyphStore};
|
||||
use serde::Serialize;
|
||||
use servo_arc::Arc as ServoArc;
|
||||
use style::properties::ComputedValues;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue