mirror of
https://github.com/servo/servo.git
synced 2025-08-08 23:15:33 +01:00
Start implementing text in layout 2020
This commit is contained in:
parent
7e143c7a05
commit
b3d30d284e
9 changed files with 210 additions and 21 deletions
|
@ -4,11 +4,13 @@
|
|||
|
||||
use crate::geom::flow_relative::{Rect, Sides};
|
||||
use crate::style_ext::{Direction, WritingMode};
|
||||
// use crate::text::ShapedSegment;
|
||||
use servo_arc::Arc;
|
||||
use gfx::text::glyph::GlyphStore;
|
||||
use servo_arc::Arc as ServoArc;
|
||||
use std::sync::Arc;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::Length;
|
||||
use style::Zero;
|
||||
use webrender_api::FontInstanceKey;
|
||||
|
||||
pub(crate) enum Fragment {
|
||||
Box(BoxFragment),
|
||||
|
@ -17,7 +19,7 @@ pub(crate) enum Fragment {
|
|||
}
|
||||
|
||||
pub(crate) struct BoxFragment {
|
||||
pub style: Arc<ComputedValues>,
|
||||
pub style: ServoArc<ComputedValues>,
|
||||
pub children: Vec<Fragment>,
|
||||
|
||||
/// From the containing block’s start corner…?
|
||||
|
@ -52,9 +54,11 @@ pub(crate) struct AnonymousFragment {
|
|||
}
|
||||
|
||||
pub(crate) struct TextFragment {
|
||||
pub parent_style: Arc<ComputedValues>,
|
||||
pub parent_style: ServoArc<ComputedValues>,
|
||||
pub content_rect: Rect<Length>,
|
||||
// pub text: ShapedSegment,
|
||||
pub ascent: Length,
|
||||
pub font_key: FontInstanceKey,
|
||||
pub glyphs: Vec<Arc<GlyphStore>>,
|
||||
}
|
||||
|
||||
impl AnonymousFragment {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue