Skip to content

Commit a722a97

Browse files
committed
Add some design TODO notes
1 parent 8d74812 commit a722a97

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

parley_engine/src/itemize.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ pub struct Item<'a> {
5252
pub char_end: u32,
5353

5454
/// The options to shape this item with.
55+
//
56+
// TODO: should users instead be allowed to build `options` at the `Segment` level (i.e.,
57+
// through some callback)? The motivation is for users to have access to the segment's `Script`
58+
// and be able to set font features based on that. If the entirety of `ShapeOptions` moves
59+
// there, it would allow users to set, e.g., a font size per segment, even though it's not
60+
// necessarily an item boundary; and note an item then doesn't mean a whole lot anymore. We
61+
// could also allow only some options to be per-segment. In any case, we're probably moving
62+
// towards a future where items reset grapheme segmentation, but segments do not (note Gecko and
63+
// Blink also reset grapheme segmentation when something like font size changes, but not when
64+
// the script changes).
5565
pub options: ShapeOptions<'a>,
5666
// TODO: we probably should allow users to pass in some data (like we allow passing
5767
// style_indices elsewhere), which we copy onto `ShapedRun`. That allows users to easily

parley_engine/src/shape/shaper.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ pub struct ShapeOptions<'a> {
3333
pub variations: &'a [FontVariation],
3434
/// The per-character style indices.
3535
// TODO: rename to something like `user_data` (s.t. we don't assume it's a style per se).
36+
// TODO: probably move this out of `ShapeOptions`, and supply it as a parameter on
37+
// `Shaper::shape_text`.
3638
pub char_style_indices: &'a [u16],
3739
}
3840

0 commit comments

Comments
 (0)