-
Notifications
You must be signed in to change notification settings - Fork 28
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
Experiment: styled_text crate #209
base: main
Are you sure you want to change the base?
Experiment: styled_text crate #209
Conversation
This lets us remove the `swash` dependency from `styled_text`.
I see that the font config code in fontique does something that will need adjustment ... and there's plenty of stuff that would need to be cleaned up with imports and such ... |
a5e3275
to
ddccdc0
Compare
ddccdc0
to
a13aa93
Compare
Rename the file in `styled_text` so it matches what it contains. Just re-export from fontique's root via styled_text rather than via fontique::generic.
We then use that to get the max value for the GenericFamilyMap in fontique.
9dcaa87
to
667561e
Compare
Some things to resolve:
|
This also adds additional cases for the stretch conversion and a note in the doc comments about where these values have come from.
52eeb2c
to
48294c6
Compare
I tink there's some interesting directions for this in the future as well. Like This also could grow some easier ways to configure the various OpenType features rather than requiring knowing the details of what the tags are. (This too can be inspired by CSS Fonts 4.) It could be pretty exciting, but we need to make the first steps ... |
This looks interesting, but I think we ought to do a more conservative Parley 0.3 release before we land this. |
I think that right now, I've avoided any breaking changes in the API ... but I definitely plan to have some, like dealing with |
But I might also submit some of the breaking changes separately from this and then rebase this on top of them... |
I'm less concerned about breaking changes and more concerned about whether this crate structure makes sense. I think we ought to give ourselves more time to iterate and settle on a design rather than trying to immediately rush it into a release along with other changes that have been stewing for some time. |
This can be used in the future as part of FFI work, but for now, the `Contiguous` trait is used to provide a `MAX_VALUE` used by `GenericFamilyMap`. This is a backport of part of linebender#209 where the separation between `GenericFamily` and `GenericFamilyMap` has grown to span crates. The testing here borrows from (copies) what is done for similar testing of `bytemuck` traits in the `color` crate.
This can be used in the future as part of FFI work, but for now, the `Contiguous` trait is used to provide a `MAX_VALUE` used by `GenericFamilyMap`. This is a backport of part of linebender#209 where the separation between `GenericFamily` and `GenericFamilyMap` has grown to span crates. The testing here borrows from (copies) what is done for similar testing of `bytemuck` traits in the `color` crate. These crates already depend on `bytemuck`, so this isn't a new dependency. A decision is made here though to not use the `derive` feature as when we move this type to a vocabulary crate, we will want to avoid the `derive` feature there to avoid a dependency on proc macros.
This can be used in the future as part of FFI work, but for now, the `Contiguous` trait is used to provide a `MAX_VALUE` used by `GenericFamilyMap`. This is a backport of part of linebender#209 where the separation between `GenericFamily` and `GenericFamilyMap` has grown to span crates. The testing here borrows from (copies) what is done for similar testing of `bytemuck` traits in the `color` crate. These crates already depend on `bytemuck`, so this isn't a new dependency. A decision is made here though to not use the `derive` feature as when we move this type to a vocabulary crate, we will want to avoid the `derive` feature there to avoid a dependency on proc macros.
This exposes `from_fontconfig` functions on `FontStretch`, `FontStyle`, and `FontWeight` rather than only defining them locally within the fontconfig code. This is in preparation for a change similar to linebender#209 where these types and others get pulled into a shared vocabulary crate and this sort of constructor helper would be useful to others.
This can be used in the future as part of FFI work, but for now, the `Contiguous` trait is used to provide a `MAX_VALUE` used by `GenericFamilyMap`. This is a backport of part of linebender#209 where the separation between `GenericFamily` and `GenericFamilyMap` has grown to span crates. The testing here borrows from (copies) what is done for similar testing of `bytemuck` traits in the `color` crate. These crates already depend on `bytemuck`, so this isn't a new dependency. A decision is made here though to not use the `derive` feature as when we move this type to a vocabulary crate, we will want to avoid the `derive` feature there to avoid a dependency on proc macros.
This can be used in the future as part of FFI work, but for now, the `Contiguous` trait is used to provide a `MAX_VALUE` used by `GenericFamilyMap`. This is a backport of part of linebender#209 where the separation between `GenericFamily` and `GenericFamilyMap` has grown to span crates. The testing here borrows from (copies) what is done for similar testing of `bytemuck` traits in the `color` crate. These crates already depend on `bytemuck`, so this isn't a new dependency. A decision is made here though to not use the `derive` feature as when we move this type to a vocabulary crate, we will want to avoid the `derive` feature there to avoid a dependency on proc macros.
This can be used in the future as part of FFI work, but for now, the `Contiguous` trait is used to provide a `MAX_VALUE` used by `GenericFamilyMap`. This is a backport of part of #209 where the separation between `GenericFamily` and `GenericFamilyMap` has grown to span crates. The testing here borrows from (copies) what is done for similar testing of `bytemuck` traits in the `color` crate. These crates already depend on `bytemuck`, so this isn't a new dependency. A decision is made here though to not use the `derive` feature as when we move this type to a vocabulary crate, we will want to avoid the `derive` feature there to avoid a dependency on proc macros.
This exposes `from_fontconfig` functions on `FontStretch`, `FontStyle`, and `FontWeight` rather than only defining them locally within the fontconfig code. This is in preparation for a change similar to #209 where these types and others get pulled into a shared vocabulary crate and this sort of constructor helper would be useful to others. --------- Co-authored-by: Daniel McNab <[email protected]>
This is an experimental PR that moves some stuff from
fontique
andparley
into a newstyled_text
crate.This crate would get a rich text / attributed text or that could go in another crate.
Both
fontique
andparley
depend on this new crate, but it only depends oncore_math
and is fullyno_std
compatible.Nearly all of this should be so general that it could be used by other text systems as well.