-
Notifications
You must be signed in to change notification settings - Fork 57
Add text_style + styled_text crates (CSS-like resolution + document blocks)
#495
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
base: main
Are you sure you want to change the base?
Add text_style + styled_text crates (CSS-like resolution + document blocks)
#495
Conversation
|
There's at least one big problem with this ... This is a great bike shedding opportunity for people (the name). |
|
This also doesn't yet lower to Parley and have an example ... coming soon. Other things too. |
|
I will also peel off the |
5eac6a3 to
ea54de2
Compare
|
I'm still reading through this but my general feeling is that we'll want a simpler vocabulary crate that only provides the fundamental resolved property types. Things like * A zero alloc language type the only captures language, script and region subtags would be nice. We don't really care about the rest. |
I agree with this. And would say that I think it would be useful to have the "computed" styles (and likely a few other complementary low-level types like |
|
I'll be pushing a proposal to address some of this shortly... and then I'll be passing out. :) |
05f976d to
d060b90
Compare
|
@dfrg I think the last set of changes adding If so, I could separate that out from this PR and submit a new PR that contains just that and the changes to have Parley / Fontique use it. (After I sleep...) |
|
(It would still need some of the code that we have for some of these types in the existing stuff ... like parse functions, display impls, and bytemuck stuff. But that's easy to bring over.) |
d060b90 to
45c2c0f
Compare
Yes, this looks much better to me and I think it makes sense to split it out into a separate PR so we can bikeshed a bit on name and get it merged. Thanks! |
|
Splitting a very small |
Adding this to |
+1 for this. I think basically everything that's a computed style in Parley makes sense here (I'm assuming that where this is headed is that Parley will end up with less style resolution than it currently has (basically only things that can't be computed ahead of time becuase they depend on the font metrics or font fallback).
Some kind In my case my source will be https://docs.rs/stylo/latest/style/values/computed/font/struct.FontFamilyList.html which is itself an |
|
Another part of this has been pulled out and turned into #501. |
45c2c0f to
87ea50e
Compare
e49e03d to
46972b7
Compare
…wering) - Add `text_style`: a `no_std` + `alloc` style vocabulary for text (inline + paragraph declarations with `Specified` semantics). - Add `text_style_resolve`: engine layer for specified→computed resolution, including OpenType settings parsing and structured errors. - Add `styled_text`: span application and a lightweight block/document model built on `attributed_text` + `text_style`, yielding resolved run iterators. - Add `styled_text_parley`: Parley backend that lowers resolved runs into `parley::StyleProperty` calls to build `parley::Layout`.
46972b7 to
6093676
Compare
text_style: ano_std+allocstyle vocabulary for text (inline + paragraph declarations withSpecifiedsemantics).text_style_resolve: engine layer for specified→computed resolution, including OpenType settings parsing and structured errors.styled_text: span application and a lightweight block/document model built onattributed_text+text_style, yielding resolved run iterators.styled_text_parley: Parley backend that lowers resolved runs intoparley::StylePropertycalls to buildparley::Layout.