#2284·Cap

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

Author: mojtabahbbCreated Sep 12, 2026Updated Sep 13, 2026

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