Skip to content

propagate stl alignment to ttml#141

Merged
asticode merged 2 commits intoasticode:masterfrom
dlecorfec:fix-stl-to-ttml-alignment
Feb 23, 2026
Merged

propagate stl alignment to ttml#141
asticode merged 2 commits intoasticode:masterfrom
dlecorfec:fix-stl-to-ttml-alignment

Conversation

@dlecorfec
Copy link
Contributor

The left/right alignment of STL subs was lost when converting to TTML.

@asticode
Copy link
Owner

Thanks for the PR! 👍

Could you add some tiny tests for that?

@asticode asticode merged commit dec0bf6 into asticode:master Feb 23, 2026
1 check passed
@dlecorfec
Copy link
Contributor Author

(AI-generated tests by Claude Sonnet 4.5 with prompt "add tests for commit d52237e", it generated a bit more than asked, but it seems fine)

Added TestPropagateSTLAttributes to subtitles_internal_test.go with 9 test cases:

  1. JustificationRight - Verifies that JustificationRight propagates to both WebVTTAlign and TTMLTextAlign with value "right"
  2. JustificationLeft - Verifies that JustificationLeft propagates to both WebVTTAlign and TTMLTextAlign with value "left"
  3. JustificationCentered - Verifies that JustificationCentered doesn't set TTMLTextAlign (centered is default behavior)
  4. NoJustification - Verifies that when justification is nil, no alignment attributes are set
  5. STLPositionInVision - Tests vertical position conversion for in-vision subtitles (up to 99 rows)
  6. STLPositionTeletext - Tests the special teletext conversion that subtracts 1 from position for better rendering
  7. STLPositionTeletextRow0 - Edge case where position 0 doesn't subtract 1
  8. JustificationAndPosition - Tests that both justification and position features work correctly together

@asticode
Copy link
Owner

Thanks for this PR too ❤️

Let me know whether you need a tag 👍

@dlecorfec
Copy link
Contributor Author

Thanks, I think a tag is in order to celebrate the day! 🚀

@asticode
Copy link
Owner

FYI I've created a v0.39.0 tag 👍

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