Synthetic italic transform is not applied during glyph rasterization
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 161
Description
### Bevy version
0.19.1
### What happens
For a variable font without an `ital` or `slnt` axis, text layout computes a synthetic italic transform, but the glyph atlas identity and Swash rasterization path do not carry/apply that transform. The resulting glyphs remain upright.
### Expected
Synthetic italic text should be rasterized with the skew selected during layout, and atlas keys must distinguish transformed from untransformed glyphs.
### Reproduction
Render Inter italic text using `TextFont { style: FontStyle::Italic, .. }` where the font has no italic/slant variation axis, then compare the captured glyphs with a Skia/CanvasKit reference. Layout succeeds, but Bevy produces upright glyph pixels.
In an external OPUI conformance case against Bevy 0.19.1, all adapter tests, clippy, rustdoc, mapping snapshots, and computed-layout snapshots pass. Only typography pixels fail: MAE 1.75, RMSE 12.73, max channel delta 240, thresholded differing-pixel ratio 0.0394.
### Working patch shape
A local patch fixes this by carrying the synthesis transform through `bevy_text` pipeline glyph data, including it in font atlas identity, and applying it in Swash rasterization. `bevy_ui::widget::text_input_layout` must forward the same field.
Related design context: #16901.
Contributor guide
Research direction
Start by tracing synthesis transform data through the bevy_text pipeline and inspect how glyph data and font atlas identity reach Swash rasterization. Check bevy_ui::widget::text_input_layout for the corresponding forwarding path, then run the Inter synthetic-italic reproduction and compare captured glyphs with the reference. Done means transformed glyphs rasterize correctly and atlas keys distinguish transformed and untransformed glyphs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 70/100