Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 12 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ taffy = { version = "0.9", default-features = false, features = ["std", "flexbox
color = "0.3"
peniko = "0.4"
kurbo = "0.11"
parley = { version = "0.5", default-features = false, features = ["std"] }
parley = { path = "../parley/parley", version = "0.5", default-features = false, features = ["std"] }
skrifa = { version = "0.31" } # Should match parley version
wgpu = "24"
softbuffer = "0.4"
Expand Down
6 changes: 3 additions & 3 deletions packages/blitz-dom/src/layout/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ impl BaseDocument {
TextAlignKeyword::Start => Alignment::Start,
TextAlignKeyword::Left => Alignment::Left,
TextAlignKeyword::Right => Alignment::Right,
TextAlignKeyword::Center => Alignment::Middle,
TextAlignKeyword::Justify => Alignment::Justified,
TextAlignKeyword::Center => Alignment::Center,
TextAlignKeyword::Justify => Alignment::Justify,
TextAlignKeyword::End => Alignment::End,
TextAlignKeyword::MozCenter => Alignment::Middle,
TextAlignKeyword::MozCenter => Alignment::Center,
TextAlignKeyword::MozLeft => Alignment::Left,
TextAlignKeyword::MozRight => Alignment::Right,
}
Expand Down
6 changes: 6 additions & 0 deletions packages/blitz-dom/src/stylo_to_parley.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use crate::util::ToColorColor;

// Module of type aliases so we can refer to stylo types with nicer names
pub(crate) mod stylo {
pub(crate) use style::computed_values::text_wrap_mode::T as TextWrapMode;
pub(crate) use style::computed_values::white_space_collapse::T as WhiteSpaceCollapse;
pub(crate) use style::properties::ComputedValues;
pub(crate) use style::values::computed::OverflowWrap;
Expand Down Expand Up @@ -174,6 +175,10 @@ pub(crate) fn style(
.map(TextBrush::from_color);

// Wrapping and breaking
let text_wrap_mode = match itext_styles.text_wrap_mode {
stylo::TextWrapMode::Wrap => parley::TextWrapMode::Wrap,
stylo::TextWrapMode::Nowrap => parley::TextWrapMode::NoWrap,
};
let word_break = match itext_styles.word_break {
stylo::WordBreak::Normal => parley::WordBreakStrength::Normal,
stylo::WordBreak::BreakAll => parley::WordBreakStrength::BreakAll,
Expand Down Expand Up @@ -209,5 +214,6 @@ pub(crate) fn style(
letter_spacing,
overflow_wrap,
word_break,
text_wrap_mode,
}
}
Loading