-
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
Rename Stretch
, Style
, Weight
to have Font
prefix
#211
Rename Stretch
, Style
, Weight
to have Font
prefix
#211
Conversation
I'm sort of mixed on this, but:
So it would be nice to have a single name for these. In this PR, I chose |
f27a037
to
16e9600
Compare
linebender/xilem#778 shows why having a single name in Parley and Fontique will be good (and why that name should be |
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.
In this PR, I chose
Font*
because of the mapping to what the CSS Fonts specifications use.
Sgtm. I think we should generally try to mirror CSS naming moving forward.
In a subsequent PR, I will suggest renaming |
This brings them into line with how they're used in `parley::style` as well as closer to how they're named in CSS where these properties are `font-stretch` (since renamed to `font-width`), `font-style`, and `font-weight`. This is a precursor to extracting this code into a separate crate for styling text.
16e9600
to
2501041
Compare
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#211 where these types and others get pulled into a shared vocabulary crate and this sort of constructor helper would be useful to others.
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#211 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#211 where the separation between `GenericFamily` and `GenericFamilyMap` has grown to span crates.
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#211 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 brings them into line with how they're used in
parley::style
as well as closer to how they're named in CSS where these properties arefont-stretch
(since renamed tofont-width
),font-style
, andfont-weight
.This is a precursor to extracting this code into a separate crate for styling text.