Repository navigation
fontique: Fix synthesized slnt sign - #922
Merged
Merged
Conversation
tomcur
commented
Oct 20, 2026
Comment on lines
-173
to
+185
| use parley::setting::Tag; | ||
| use parley::style::{FontFamily, FontVariation, FontVariations}; | ||
|
|
||
| // Using Roboto Flex with slnt axis for italic/oblique effects | ||
| // TODO: FontStyle property doesn't automatically map to slnt axis for variable fonts, | ||
| // so, for this test, we use FontVariations directly | ||
| for (slnt_value, name) in [(0.0, "normal"), (-10.0, "italic"), (-10.0, "oblique")] { | ||
| let variations = FontVariations::List(Cow::Borrowed(&[FontVariation { | ||
| tag: Tag::new(b"slnt"), | ||
| value: slnt_value, | ||
| }])); | ||
| use parley::FontStyle; | ||
| use parley::style::FontFamily; | ||
|
|
||
| // Note Roboto Flex has a `slnt` axis but no `ital` axis, so italic and oblique get a `slnt` | ||
| // variation. | ||
| for (style, name) in [ | ||
| (FontStyle::Normal, "normal"), | ||
| (FontStyle::Italic, "italic"), | ||
| (FontStyle::Oblique(None), "oblique"), | ||
| ] { | ||
| let mut builder = env.ranged_builder(text); | ||
| builder.push_default(StyleProperty::FontFamily(FontFamily::named("Roboto Flex"))); | ||
| builder.push_default(StyleProperty::FontVariations(variations)); | ||
| builder.push_default(StyleProperty::FontStyle(style)); |
Member
Author
WilliamDGH
pushed a commit
to WilliamDGH/parley
that referenced
this pull request
Oct 22, 2026
<!-- Please ensure that you have reviewed our LLM ("AI") policy at
https://linebender.org/wiki/llm-policy/.
If you did not use any LLM tools, please replace `Unspecified` with
`None`. -->
LLM Contributions: Flagged it, review.
Similar to linebender#922. The OpenType angle is counter-clockwise in the positive
direction, whereas our `FontStyle::Oblique` follows CSS and is
clockwise, i.e., we need to negate.
I think this went unnoticed because, as with linebender#922, this appears to be a
relatively cold path: no fonts on my system seem to hit this branch.
<!--
If our users need to know about this change, please describe that in the
quote block below.
What you write here will be edited by us later - it doesn't need to be
perfect.
If this change doesn't need a changelog entry, please replace the next
line with `**Changelog: None**`.
-->
**Changelog**
> ### Fixed
> #### Fontique
>
> - `FontInfo::style` now reports oblique angles with the correct sign.
DJMcNab
approved these changes
Oct 22, 2026
DJMcNab
left a comment
Member
There was a problem hiding this comment.
Similarly, I don't think this is too impactful for me, but getting it out of open PRs is good.
tomcur
force-pushed
the
push-ysszszxwxmuu
branch
from
October 22, 2026 07:31
3748fb8 to
bf598fc
Compare
tomcur
enabled auto-merge
October 22, 2026 07:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


LLM Contributions: Review, updated test.
On top of #921 due to conflicts.
slntis counter-clockwise for a positive slant. That means we currently are trying to synthesize italics (ifitalis missing) with a counter-clockwise slant. We should pass in a negative angle to get a clockwise slant. CSS's oblique is clockwise in the positive direction, so its sign also needs to be inverted. Roboto Flex clamps at 0, so it simply keeps glyphs upright when given the old values.I think this wasn't caught because we normally match a font that is declared italic or oblique, so don't go through synthesis. The italic issue also only hits for fonts with
slntand withoutital. (When the test updated here was written, I think the fact that Roboto Flex stayed upright was assumed to be an indicator that we don't synthesize; but we were attempting to synthesize in the wrong direction.)Changelog