Skip to content

Bug: RTL AI Captions (Persian/Arabic) overflow outside the background bounding box #2284

Description

@mojtabahbb

Description

When using the AI caption feature for Right-to-Left (RTL) languages like Persian, the text shaping works fine (letters are connected properly). However, the bounding box calculation or text alignment is incorrect. The RTL text shifts horizontally and renders outside/overflows the edges of the caption background container.

Steps to Reproduce

  1. Record a video speaking in Persian or Arabic.
  2. Generate AI captions using the local model.
  3. Observe the caption overlay.

Expected Behavior

The black background box should properly wrap the RTL text with correct padding, and the text should be perfectly centered/aligned inside the container.

Actual Behavior

The text aligns incorrectly and spills outside the right/left edge of the background box, getting cut off.

Please see the attached screenshots for reference:

Image Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions