-
Notifications
You must be signed in to change notification settings - Fork 105
Implement parley_core::ShapedText
#679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
23d66c2
5277f1d
2a683ad
50b07ac
3691178
9b07375
cf7ead6
d38f258
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,32 +18,24 @@ workspace = true | |
|
|
||
| [features] | ||
| default = ["system"] | ||
| std = [ | ||
| "fontique/std", | ||
| "harfrust/std", | ||
| "parley_core/std", | ||
| "peniko/std", | ||
| "skrifa/std", | ||
| "parlance/std", | ||
| ] | ||
| libm = ["fontique/libm", "harfrust/libm", "peniko/libm", "skrifa/libm", "dep:core_maths"] | ||
| std = ["fontique/std", "parley_core/std", "peniko/std", "skrifa?/std", "parlance/std"] | ||
| libm = ["fontique/libm", "parley_core/libm", "peniko/libm", "skrifa?/libm", "dep:core_maths"] | ||
| # Enables support for system font backends | ||
| system = ["std", "fontique/system"] | ||
| accesskit = ["dep:accesskit"] | ||
| accesskit = ["dep:accesskit", "dep:skrifa"] | ||
| # Enables dictionary-based line and word breaking for complex scripts (CJK, Thai, Khmer, Lao, Myanmar). | ||
| # When disabled, a lightweight segmenter is used that falls back to character-level breaks for those scripts. | ||
| complex-scripts = ["parley_core/complex-scripts"] | ||
|
|
||
| [dependencies] | ||
| skrifa = { workspace = true } | ||
| skrifa = { workspace = true, optional = true } | ||
| linebender_resource_handle = { workspace = true } | ||
| fontique = { workspace = true } | ||
| parlance = { workspace = true } | ||
| parley_core = { workspace = true } | ||
| core_maths = { version = "0.1.1", optional = true } | ||
| accesskit = { workspace = true, optional = true } | ||
| hashbrown = { workspace = true } | ||
| harfrust = { workspace = true } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎉 |
||
|
|
||
| [dev-dependencies] | ||
| parley_dev = { workspace = true } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -168,7 +168,8 @@ fn align_impl<B: Brush, const UNDO_JUSTIFICATION: bool>( | |
| line_items | ||
| .filter(|item| item.is_text_run()) | ||
| .for_each(|line_item| { | ||
| let clusters = &mut layout.clusters[line_item.cluster_range.clone()]; | ||
| let clusters = | ||
| &mut layout.shaped_text.clusters_mut()[line_item.cluster_range.clone()]; | ||
|
Comment on lines
+171
to
+172
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🙈 - don't look here! 😆 Agree with PR description - you're right we should just expose this as a mutable until we finish the migration and discussion above. |
||
| let line_item_is_rtl = line_item.bidi_level & 1 != 0; | ||
| let clusters: &mut dyn Iterator<Item = &mut ClusterData> = | ||
| if line_item_is_rtl { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This allocation is unfortunate! Do we want to have a
bytemuckfeature or similar so that we can:Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think so, though Nico also requested the type to live in
parlance, which probably makes sense. See the comment thread at #679 (comment).I'll merge this for now and follow up in a separate PR.