Skip to content

Conversation

@yisibl
Copy link
Collaborator

@yisibl yisibl commented Dec 16, 2025

Previously, the exposed API name was text_direction, but the HTML specification requires direction. This PR fixes and improves that, and we now fully support both LTR and RTL directions.

At the same time, this implementation offers excellent compatibility. The direction property now works seamlessly with letterSpacing and textAlign, which may be unsupported or buggy in other third-party canvas implementations.

MDN: developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/direction

Chrome 143

canvas

This PR

direction-align

Part of #1172

@yisibl yisibl force-pushed the add-direction branch 2 times, most recently from 47ec752 to 78e7851 Compare December 17, 2025 03:47
@yisibl yisibl changed the title feat: supprot rtl direction feat: basic support for RTL direction Dec 17, 2025
@yisibl yisibl changed the title feat: basic support for RTL direction feat: basic support for direction Dec 17, 2025
@yisibl yisibl requested a review from Brooooooklyn December 17, 2025 10:05
@yisibl yisibl marked this pull request as ready for review December 17, 2025 10:06
@Brooooooklyn Brooooooklyn merged commit 5c04020 into main Dec 17, 2025
41 checks passed
@Brooooooklyn Brooooooklyn deleted the add-direction branch December 17, 2025 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants