Skip to content

Text align style option#11

Merged
davefowler merged 1 commit intomainfrom
cursor/text-align-style-option-c1d7
Jan 28, 2026
Merged

Text align style option#11
davefowler merged 1 commit intomainfrom
cursor/text-align-style-option-c1d7

Conversation

@davefowler
Copy link
Collaborator

Add text_align style option to control horizontal text alignment in SVG output.


Open in Cursor Open in Web

- Add TextAlign literal type (left, center, right)
- Add text_align field to Style class with default 'left'
- Add get_text_anchor() helper method to map to SVG text-anchor values
- Update SVGRenderer._render_text_block to apply text-anchor attribute
- Calculate x position based on alignment (left edge, center, right edge)
- Export TextAlign and CodeBlockOverflow types from __init__.py
- Add tests for all alignment options
- Update README with text alignment example and documentation

Co-authored-by: davefowler <davefowler@gmail.com>
@cursor
Copy link

cursor bot commented Jan 28, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@davefowler davefowler marked this pull request as ready for review January 28, 2026 23:54
@davefowler davefowler merged commit 5c42723 into main Jan 28, 2026
5 checks passed
@davefowler davefowler deleted the cursor/text-align-style-option-c1d7 branch January 28, 2026 23:54
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.

2 participants