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:
Martin Robinson 2024-06-19 22:26:19 +02:00 committed by GitHub
parent 9f8118abc7
commit cd2ab36759
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
159 changed files with 224 additions and 266 deletions

View file

@ -21,8 +21,8 @@ canvas_traits = { workspace = true }
embedder_traits = { workspace = true }
euclid = { workspace = true }
fnv = { workspace = true }
gfx = { path = "../gfx" }
gfx_traits = { workspace = true }
fonts = { path = "../fonts" }
fonts_traits = { workspace = true }
html5ever = { workspace = true }
ipc-channel = { workspace = true }
lazy_static = { workspace = true }

View file

@ -11,8 +11,7 @@ use std::thread;
use base::id::PipelineId;
use fnv::FnvHasher;
use gfx::font_cache_thread::FontCacheThread;
use gfx::font_context::FontContext;
use fonts::{FontCacheThread, FontContext};
use net_traits::image_cache::{
ImageCache, ImageCacheResult, ImageOrMetadataAvailable, UsePlaceholder,
};

View file

@ -20,7 +20,7 @@ use embedder_traits::Cursor;
use euclid::default::{Point2D, Rect, SideOffsets2D as UntypedSideOffsets2D, Size2D};
use euclid::{rect, SideOffsets2D};
use fnv::FnvHashMap;
use gfx::text::glyph::ByteIndex;
use fonts::ByteIndex;
use ipc_channel::ipc;
use log::{debug, warn};
use net_traits::image_cache::UsePlaceholder;

View file

@ -16,7 +16,7 @@ use base::text::is_bidi_control;
use bitflags::bitflags;
use canvas_traits::canvas::{CanvasId, CanvasMsg};
use euclid::default::{Point2D, Rect, Size2D, Vector2D};
use gfx::text::glyph::ByteIndex;
use fonts::ByteIndex;
use html5ever::{local_name, namespace_url, ns};
use ipc_channel::ipc::IpcSender;
use log::debug;

View file

@ -11,7 +11,7 @@ use app_units::{Au, MIN_AU};
use base::print_tree::PrintTree;
use bitflags::bitflags;
use euclid::default::{Point2D, Rect, Size2D};
use gfx::font::FontMetrics;
use fonts::FontMetrics;
use log::debug;
use range::{int_range_index, Range, RangeIndex};
use script_layout_interface::wrapper_traits::PseudoElementType;

View file

@ -10,9 +10,10 @@ use std::sync::Arc;
use app_units::Au;
use base::text::is_bidi_control;
use gfx::font::{self, FontMetrics, FontRef, RunMetrics, ShapingFlags, ShapingOptions};
use gfx::font_cache_thread::FontIdentifier;
use gfx::text::glyph::ByteIndex;
use fonts::{
self, ByteIndex, FontIdentifier, FontMetrics, FontRef, RunMetrics, ShapingFlags,
ShapingOptions, LAST_RESORT_GLYPH_ADVANCE,
};
use log::{debug, warn};
use range::Range;
use style::computed_values::text_rendering::T as TextRendering;
@ -211,7 +212,7 @@ impl TextRunScanner {
font.glyph_index(' ')
.map(|glyph_id| font.glyph_h_advance(glyph_id))
})
.unwrap_or(font::LAST_RESORT_GLYPH_ADVANCE);
.unwrap_or(LAST_RESORT_GLYPH_ADVANCE);
inherited_text_style
.word_spacing
.to_used_value(Au::from_f64_px(space_width))

View file

@ -8,8 +8,9 @@ use std::slice::Iter;
use std::sync::Arc;
use app_units::Au;
use gfx::font::{FontMetrics, FontRef, RunMetrics, ShapingFlags, ShapingOptions};
use gfx::text::glyph::{ByteIndex, GlyphRun, GlyphStore};
use fonts::{
ByteIndex, FontMetrics, FontRef, GlyphRun, GlyphStore, RunMetrics, ShapingFlags, ShapingOptions,
};
use log::debug;
use range::Range;
use serde::{Deserialize, Serialize};