What we learned

Why Gujarati Subtitles Break in Most Video Tools — and the One-Line Fix

Gujarati captions get clipped, overlapped or split apart in most editors. The cause is almost always a single wrong measurement, and it is the same one every time.

Updated 29 Aug 2026 · 8 min read

If you have tried putting Gujarati captions on a video, you have probably seen one of four things: the tops of letters cut flat, marks from one line touching the line above, joined letters split apart, or empty rectangles where characters should be.

These look like four problems. They are two, and the first one has a single cause that we hit while building Bolo's caption renderer and that took a while to identify because nothing about it looks wrong in the code.

The measurement that causes it

A text renderer has to decide how tall a line is before it can stack lines. There are two ways to ask, and they give different answers.

The first is to measure the glyph bounding box — the rectangle around the ink actually drawn for those specific characters. The second is to ask the font what its line height is, using the metrics the type designer recorded.

For English these agree closely enough that nobody notices. Nothing in the Latin alphabet sits far above the capital height, so the ink and the font's declared ascent are near enough the same. Almost every text-rendering tutorial therefore uses the bounding box, because it is the more obvious call.

GUJARATIશ્રીજીmatras sit up hereand down hereLATINShreejiunusedunusedMeasure the line from the glyph box and Gujarati loses its matras. Measure it from the font metrics and it does not.
The same line height that fits Shreeji comfortably will clip શ્રીજી.

Why Gujarati breaks it

Gujarati is an abugida. Vowel marks — matras — attach above and below the consonant rather than sitting beside it, and some consonants join into conjunct forms that occupy more vertical space than either letter alone.

Those marks are frequently outside the glyph bounding box the renderer measured, because the box is drawn around the ink of the characters it was handed rather than around the vertical space the script needs. So the computed line height comes out too short.

Then the lines get stacked at that height. Line one looks fine, because there is nothing above it to collide with. Line two's upper matras run into line one's descenders, and if the frame is cropped at all, the tops get cut flat.

This is why a single-line test passes
Almost every quick check uses one short line, and one line cannot show the fault. We had a caption renderer that looked correct in every test we ran until we generated a two-line Gujarati caption, at which point it was obviously broken. If you are evaluating a tool, force a multi-line caption or you are not testing the thing that fails.

The fix

Measure from the font, not from the ink. In Python's PIL, that is the difference between two calls:

The two ways to ask, and what they return
CallWhat it measuresCorrect for Gujarati?
`font.getbbox(text)`The ink of these specific charactersNo — matras fall outside it
`font.getmetrics()`The font's own ascent and descentYes
The same distinction exists in every text stack under different names. If your renderer derives line height from measured text, it has this bug.

Broken conjuncts are a different fault

If joined letters are appearing as separate characters — શ્રી rendering as three distinct shapes rather than one — that is not a line-height problem and no spacing change will fix it.

That is the font. Gujarati conjuncts require the font to contain the joined forms and the substitution rules that select them. A font with partial Gujarati coverage will render individual letters correctly and fail on the joins, which reads to a Gujarati speaker as a spelling error rather than a styling choice.

Empty rectangles are the same category, one step worse: the font has no glyph for that character at all.

How to test any tool in thirty seconds

  1. Generate a caption containing શ્રીજી, દ્વારકા and પ્રશ્ન. Between them these cover conjuncts and marks both above and below the line.
  2. Force it onto two or three lines with a longer sentence. One line hides the fault entirely.
  3. Look at the top edge of the letters on lines two and three. Marks should be complete and clear of the line above.
  4. Check the joins in શ્રી and પ્ર. Two separate shapes means the font lacks the conjunct forms.
  5. Look for empty rectangles anywhere. That is a missing glyph.
Check the exported file, not the preview
Preview panels in browser-based tools often use the browser's own text engine, which handles Gujarati correctly, while the export is drawn by separate code that may not. A caption that is perfect in the editor and broken in the downloaded file is the most common surprise here, and it is why the only test that counts is watching the export on a phone.

Why so many tools have this

Not carelessness, mostly. The bounding-box approach is what nearly every tutorial teaches, it is correct for the language those tutorials are written in, and it produces no visible symptom until someone renders an Indic script on more than one line.

It also survives review easily, because the code looks right. There is no error, no warning and no failing test — the measurement is simply answering a slightly different question than the one being asked.

The practical consequence for anyone choosing a tool is that this cannot be evaluated from a feature list. A tool either had someone test it in Gujarati specifically, or it did not, and thirty seconds with the three words above will tell you which.

The short version

  • Clipped tops and overlapping lines come from measuring line height off the glyph bounding box.
  • Gujarati matras sit outside that box, so the height comes out too short.
  • Measure from the font metrics instead — `getmetrics()` rather than `getbbox()` in PIL.
  • It only shows on lines two and three. A single-line test passes on a broken renderer.
  • Split conjuncts are a font problem, not a spacing one, and need a font with the joined forms.
  • Always check the exported file on a phone, never the editor preview.
Bolo is built for people like you:
Bolo for Gujarati teachersBolo for Gujarati news creatorsBolo for shops & small businesses

Frequently asked questions

Why are the tops of my Gujarati subtitles cut off?

The line height is almost certainly being computed from the glyph bounding box rather than the font metrics. That is correct for English, where nothing sits far above the capital height, but Gujarati matras attach above the base line and fall outside that box — so the computed height is too short and the marks get clipped. In PIL the fix is to use font.getmetrics() instead of deriving height from getbbox().

Why do my Gujarati captions look fine on one line and broken on two?

Because a single line has nothing above it to collide with. The fault only appears once lines are stacked at the too-short height, when the upper matras of line two run into line one. This is why single-line tests pass on renderers that are genuinely broken, and why any evaluation has to force a multi-line caption.

Why are joined Gujarati letters splitting apart?

That is a font problem rather than a spacing one, and no line-height change will fix it. Gujarati conjuncts require the font to contain the joined forms and the rules that select them; a font with partial coverage renders individual letters correctly and fails on the joins. Empty rectangles are the same category one step worse — no glyph for that character at all.

What words should I use to test Gujarati caption rendering?

શ્રીજી, દ્વારકા and પ્રશ્ન. Between them they cover conjuncts and vowel marks both above and below the base line, which is the full set of things that break. Put them in a sentence long enough to wrap onto two or three lines, and check the top edge of the later lines.

The captions look right in the editor but wrong in the download. Why?

Browser-based preview panels frequently use the browser's own text engine, which handles Gujarati correctly, while the exported video is drawn by separate rendering code that may not. Always judge from the downloaded file watched on a phone — the preview is not testing the same code path.

Do most video tools get Gujarati captions wrong?

Many do, and usually not through carelessness. The bounding-box method is what nearly every text-rendering tutorial teaches, it is correct for English, and it produces no error or warning — the code looks right and simply answers a slightly different question. A tool either had someone test it in Gujarati specifically or it did not, and thirty seconds of testing will tell you which.