fix(blitz-paint): synthetic italic oblique shears in opposite direction (leans left)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
Start with the glyph transforms at packages/blitz-paint/src/text.rs:306-309 and packages/parley_code_editor/src/paint.rs:214-217, then check how each applies Affine::skew for synthetic italic or oblique text. The issue identifies the sign of the shear as the problem; done means both transforms lean glyphs forward to the right. The payload names no tests, so look for existing coverage of synthetic italic rendering before making a change.
Written by the indexing model from the issue text.
Description
Description
When synthetic italic or oblique is active (e.g. for fonts lacking an italic face when font-style: italic or font-style: oblique is specified), blitz-paint and parley_code_editor calculate the glyph skew transform using a positive horizontal shear:
Affine::skew(angle.to_radians().tan() as f64, 0.0)
In 2D graphics screen coordinates (Y-down), ascenders lie at negative Y relative to baseline (y < 0).
Kurbo's Affine::skew(skew_x, 0.0) evaluates coordinates as:
x' = x + skew_x * y
y' = y
With skew_x = +tan(angle) > 0, points above the baseline (y < 0) yield x' = x + (+tan) * (-|y|) < x, leaning ascenders to the left (\\) instead of standard italic slant to the right (/).
Negating the tangent (-angle.to_radians().tan() as f64) ensures x' = x + (-tan) * (-|y|) > x, shearing ascenders forward in the +X direction (/).
Minimal Reproduction
<!DOCTYPE html>
<html>
<head>
<style>
@font-face {
font-family: 'ReproNormalOnly';
src: local('Helvetica');
font-style: normal;
}
.italic {
font-family: 'ReproNormalOnly';
font-style: italic;
}
</style>
</head>
<body>
<p class=italic>Synthetic Italic</p>
</body>
</html>
References
- CSS Fonts Module Level 4 §2.3
font-style: https://drafts.csswg.org/css-fonts-4/#font-style-prop - CSS Fonts Module Level 4 §4.6
font-synthesis-style: https://drafts.csswg.org/css-fonts-4/#font-synthesis-style - Kurbo
Affine::skew: https://docs.rs/kurbo/latest/kurbo/struct.Affine.html#method.skew - Blitz paint glyph run transform:
packages/blitz-paint/src/text.rs:306-309 - Blitz code editor glyph transform:
packages/parley_code_editor/src/paint.rs:214-217
- Dominant language
- Rust
- Stars
- 4.4k
- Forks
- 267
- Avg merge
- 6h 38m
- Merged PRs (30d)
- 164
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DioxusLabs/blitz
-
Copy, cut and paste shortcuts don't work with Caps Lock or ShiftPossibly taken @nicoburns claimed this 6 days ago. OpenA-Events C-Bug
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
DioxusLabs/blitz#1507 ·
Maintainers usually reply within 1 day
-
Copy and cut work in password inputsPossibly taken @nicoburns claimed this 6 days ago. OpenA-Events A-Forms C-Bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
DioxusLabs/blitz#1501 ·
Maintainers usually reply within 1 day
-
Panic on live viewport resize when unstyled elements exist in display: none subtreePossibly taken @GoCoder7 claimed this 7 days ago. OpenA-Layout A-Style C-Bug I-Crash
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
DioxusLabs/blitz#1488 ·
Maintainers usually reply within 1 day
-
Right-button drag starts a text-selection drag and suppresses `contextmenu`Possibly taken @staging-devin-ai-integration claimed this 22 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
DioxusLabs/blitz#1184 ·
Maintainers usually reply within 1 day
-
dioxus-native-dom: attributes are created in the HTML namespace, so CSS attribute selectors never matchMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
DioxusLabs/blitz#1168 · 4 comments ·
Maintainers usually reply within 1 day
All issues in DioxusLabs/blitz
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
oxc-project/tsrs#1010 ·
Maintainers usually reply within 1 day
-
Link is deadOpen
Difficulty 1/5 Under an hour Newbie friendliness 63/100
nicholas-ochoa/OpenSC2K#104 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
libracoder/kiri#445 ·
Maintainers usually reply within 1 day
-
docs documentation need-triage SaaS
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day