Skip to content

fix(subtitles): keep tvOS styled text size constant across content aspect ratios - #56

Merged
zZebrahz merged 1 commit into
mainfrom
fix/tvos-subtitle-aspect-ratio-scale
Jul 3, 2026
Merged

zZebrahz merged 1 commit into
mainfrom
fix/tvos-subtitle-aspect-ratio-scale

Conversation

@zZebrahz

@zZebrahz zZebrahz commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

libass keys font scaling to the video area (frame minus letterbox margins). On tvOS the subtitle overlay is full-frame with margins marking the picture, so letterboxed (wide-aspect) content rendered ~25% smaller subtitles than full-frame content. This read as "1080p vs 4K HDR" size differences in practice, since mastering (black bars cropped vs baked into the frame) correlates with those libraries.

SubtitleRenderer now compensates the renderer font scale by frameHeight / videoAreaHeight, re-keying Silo-styled text to the full frame height regardless of the content's aspect ratio. Details:

  • Compensation is computed whenever frame geometry changes and applied only when the factor actually moves, so steady-state layout passes stay cheap.
  • Native ASS tracks stay uncompensated — authored typesetting must keep tracking the picture.
  • The factor is 1.0 whenever margins are zero, so iOS/macOS (video-rect-sized overlays) are unaffected.

Test plan

  • tvOS: a letterboxed (2.39:1) file and a 16:9 file show the same subtitle size
  • tvOS: native ASS content still renders at authored size relative to the picture
  • iOS/macOS: no size change

Notes

Split out from #55 (tvOS size-ladder rebase) so the two changes land independently. Best reviewed/merged alongside it.

…ratios

libass keys font scaling to the video area (frame minus letterbox
margins), so on tvOS — where the overlay is full-frame with margins
marking the picture — wide-aspect (letterboxed) content rendered
noticeably smaller subtitles than full-frame content. This read as
'1080p vs 4K HDR' differences since mastering (bars cropped vs baked
in) correlates with those libraries.

Compensate the renderer font scale by frameHeight / videoAreaHeight so
Silo-styled text is keyed to the full frame height regardless of the
content's aspect ratio. Native ASS tracks stay uncompensated so
authored typesetting keeps tracking the picture. No-op (factor 1.0)
when margins are zero, i.e. everywhere the overlay is video-rect
sized (iOS/macOS).
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@zZebrahz, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 38 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ba57a71d-9524-4e38-b066-df0103b9c80e

📥 Commits

Reviewing files that changed from the base of the PR and between 984c867 and 67a229d.

📒 Files selected for processing (2)
  • iosApp/iosApp/Screens/Player/Subtitles/SubtitleRenderer.swift
  • iosApp/iosApp/Screens/Player/Subtitles/SubtitleStylingOverride.swift
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/tvos-subtitle-aspect-ratio-scale

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@zZebrahz
zZebrahz merged commit d840145 into main Jul 3, 2026
1 check passed
@zZebrahz
zZebrahz deleted the fix/tvos-subtitle-aspect-ratio-scale branch July 3, 2026 22:20
Quick104 added a commit that referenced this pull request Jul 4, 2026
Conflict in AVPlayerBackend.pumpSubtitleOverlay: kept this branch's
text/bitmap split (textOverlayMayHaveFrame + pumpBitmapCues) and grafted
in main's videoInsets plumbing to renderOnSessionQueue.

Semantic follow-through: main's a8fd931 makes the tvOS subtitle overlay
full-frame (video rect communicated via videoInsets), which broke this
branch's assumption that overlay bounds == videoRect for bitmap cue
placement. pumpBitmapCues now maps normalized PGS/DVD cue rects into the
video rect derived from the insets (zero on iOS/macOS, so unchanged
there), and the render key tracks the video rect instead of raw bounds.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0146hwg1Q15YdeUhd9f37NWA
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.

1 participant