Skip to main content

Prevent Clipped Thai, Vietnamese, and Arabic Text Under Fixed Line Heights

2026-12-02

Prevent Clipped Thai, Vietnamese, and Arabic Text Under Fixed Line Heights

Your Thai build passes review, then a user sends a screenshot of Thai text cut off at the top of every button. The tone marks are gone. In Vietnamese, the accent on a capital Ễ is sliced in half, and Arabic vowel marks under the baseline vanish into the next row. Nothing is missing from the translation file. The text was rendered and then clipped.

This guide explains why scripts with tall or stacked marks clip in layouts tuned for Latin, which platform settings cause it on Android, iOS, the web, React Native, and Flutter, and how to test for it so the fix survives the next design token change or SDK upgrade.

The short answer

  1. Treat vertical room as a per-script property. Thai, Vietnamese, Arabic, Myanmar, and several Indic scripts need more height per line than English.
  2. Let text containers grow with their content. Remove fixed heights, overflow: hidden, and shrinkable flex boxes from text before you touch line height.
  3. Keep font padding and fallback line spacing on where your platform offers them, or replace them with a line height that is large enough for every script you ship.
  4. On Android, test with elegantTextHeight true now, because Android 16 ignores the attribute once you target it.
  5. Keep a fixture set of real stacked strings for each script, and screenshot it in the production font at the largest text size.

Why tall and stacked scripts get clipped

Latin text has a predictable vertical profile. Lowercase letters sit near the x-height, a few letters rise or descend, and accents on capitals are uncommon in English UI copy. Many design systems pick a line height and a font padding rule that fit exactly that profile.

Other scripts do not fit it. r12a's Thai orthography notes describe how Thai places vowel and tone marks above base characters, one above the other, and can add marks below the line, so clearly readable Thai needs more vertical resolution and more interline spacing than Latin. Vietnamese stacks a tone mark on top of a vowel diacritic, which pushes accents on capitals well above the cap height. Arabic places short vowel marks above and below the letters.

When the box is shorter than the ink, something has to give. Either the marks overlap the next line or the renderer clips them at the edge of the box. Apple's documentation for NSParagraphStyle.maximumLineHeight states that glyphs exceeding the maximum height overlap neighboring lines. Flutter's StrutStyle.forceStrutHeight guarantees uniform line spacing, and its documentation warns that text in adjacent lines may overlap.

Practitioner reports show the same failure across stacks. A Stack Overflow question about Thai and Arabic diacritics clipped in a UILabel reports that only a custom Latin font clipped, while the system font did not. An egui issue filed on 1 November 2026 reports that TextEdit clips Thai, Vietnamese, and Arabic marks that overshoot the row. These are author reports, but the mechanism they describe matches the platform documentation.

Find where the clip happens

Before changing any setting, work out which of two boxes cut the glyph.

The line box is the vertical space the text engine reserves for each line. It comes from the font's ascent and descent, the line height you set, and any padding the platform adds. If the line box is too short, marks spill into the next line or above the first line.

The container is the view or element that holds the text: a button, a table cell, a chip, a calendar block. If the container has a fixed height or clips its children, it cuts whatever spills out of the line box, even when the text engine measured the ink correctly.

Most clipped marks are cut by the container, not the line box: a fixed height, overflow hidden, or flex shrink removes ink the text engine already measured, so let text containers size to their content before you tune line height.

Two recent reports show the pattern. In the egui case, the issue explains that the text layout already reports the overshoot through its mesh bounds, but the widget clips painting to its inner rectangle. In a godxjp-ui timeline issue from October 2026, a production user saw a Vietnamese event title cut through the letters because a flex column with overflow: hidden shrank the title box to 11.3px for a 16.7px line. In both cases the line height was fine and the container did the clipping.

The two causes need different fixes. If you raise the line height to fix a container clip, you make every Latin screen looser and still clip the next time the container shrinks. Diagnose first with a simple test: remove the container's clip temporarily. If the marks reappear, fix the container. If they now overlap the neighboring line, fix the line box.

Fix the container first

Text containers should size to their content in the vertical direction. Design systems break that rule in a few predictable places:

  • Buttons and chips with a fixed height token, such as 32 or 36 points, and a single line of text.
  • Table and list rows with a fixed row height chosen for Latin.
  • Calendar or timeline blocks whose height comes from data (an event's duration) rather than from the text.
  • Cards and tiles that truncate with a hidden overflow and a line clamp.

For each of these, prefer a minimum height over a fixed height, and let the content push the box taller when a script needs it. On the web, MDN's overflow reference notes that hidden clips content at the element's padding box, so a hidden overflow on a text container cuts marks that extend past it. If you need hidden overflow for horizontal truncation, apply it to the axis you mean and give the vertical axis room, or add vertical padding that covers the overshoot.

.chip {
  min-height: 2rem;
  padding-block: 0.25rem;
  line-height: 1.5;
}

.chip-label {
  overflow-x: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

When the height must stay fixed, as in a calendar block for a 15-minute event, change what you render rather than clipping it. The godxjp-ui report describes the expected behavior: lay text out in whole lines, show fewer lines in a short block, and expose the full name as a tooltip and accessible name.

Give the line box enough room

Once containers can grow, check the line box on each platform. The settings differ, but they all control the same two things: how tall a line is, and whether the platform reserves extra room for marks above the first line and below the last.

Android views

Android's TextView reference documents includeFontPadding as leaving enough room for ascenders and descenders instead of using the font ascent and descent strictly, normally true. Teams often turn it off to align text with icons. A long-running Stack Overflow question asks what includeFontPadding is for and whether turning it off is bad, and an older one asks directly whether you risk cropping international characters when you set it to false.

The same reference documents setFallbackLineSpacing, added in API level 28 and true by default. It makes the line respect the ascent and descent of fallback fonts used to display the text, and the reference says it is required when text could be in languages like Burmese or Tibetan, which are much taller or deeper than Latin. Leave it on. If a style sets it to false to keep a strict baseline grid, tall scripts lose the room the fallback font asked for.

A forced line height interacts with both settings. A water-rs issue from September 2026 reports that includeFontPadding=false with a forced line height measured rows short, so the layout allocated a smaller box than the line height and clipped the text. If you set an exact line height, measure the resulting view height in a test instead of assuming it matches.

The Android 15 and 16 change

For years, Android used a compact font for some scripts with large vertical metrics so that layouts built for Latin would not break. According to Android 15's behavior changes, apps targeting API level 35 get elegantTextHeight set to true by default, which replaces that compact font with a more readable one. The same page says Android 13 already prevents many breakages by stretching line height through fallbackLineSpacing, and it asks apps that support Arabic, Lao, Myanmar, Tamil, Gujarati, Kannada, Malayalam, Odia, Telugu, or Thai to test with elegantTextHeight set to true.

On Android 15 you could still set the attribute to false. Android 16's behavior changes deprecate it, and the attribute is ignored once your app targets Android 16. The page tells developers to adapt layouts for consistent rendering in the same list of scripts. If the attribute is new to you, a Stack Overflow question asking what elegantTextHeight does collects the common explanations.

Raising targetSdk to 35 or 36 changes how Thai, Arabic, Myanmar, and several Indic scripts are measured, so rerun tall-script screenshots on every target SDK bump, not only when you add a language.

A checklist that only triggers script testing when a language is added will miss this change, because it arrives through a build setting that a platform team may raise for store policy reasons. Add the tall-script fixture screens to the checklist for target SDK upgrades, and remove any elegantTextHeight="false" override from your themes so you see the new rendering before Android ignores the override for you.

Android 15 also changed horizontal measurement: the same page notes that some cursive fonts and complex shapes used to draw into the neighboring character's area and were clipped at the start or end of a line, and that TextView now allocates width for them. Include a line that starts and ends with such letters in your fixtures as well.

Jetpack Compose

Compose made the trimmed behavior the default. The Compose paragraph styling guide says includeFontPadding is a legacy property that adds padding based on font metrics at the top of the first line and bottom of the last, and that it is false by default starting from Compose BOM 2024.01.01. The guide pairs lineHeight with the LineHeightStyle API, whose alignment and trim options decide where text sits in the line and whether extra space is removed.

With that default, a Compose Text in a fixed-height container has less slack for Thai or Vietnamese than the equivalent view-based TextView. A Stack Overflow report on Compose line height not respecting font padding describes single-line text measuring well below the line height the author set.

val bodyTall = TextStyle(
    fontSize = 16.sp,
    lineHeight = 1.6.em,
    lineHeightStyle = LineHeightStyle(
        alignment = LineHeightStyle.Alignment.Center,
        trim = LineHeightStyle.Trim.None
    )
)

Choose the trim per use. Trimming the first line top and last line bottom suits Latin headings aligned to a grid. For body text and controls that show tall scripts, keep Trim.None and give the line height room, or select a taller style when the current locale uses one of those scripts.

React Native

React Native's text style props describe includeFontPadding on Android as padding intended to make space for certain ascenders and descenders, default true, and suggest setting it to false when text looks misaligned when centered vertically. That suggestion is fine for an English-only label next to an icon. In a shared component used for every locale, it removes the room tall scripts need. If you turn it off for alignment, set an explicit lineHeight large enough for your tallest script and test it on Android, where the prop applies.

Flutter

Flutter computes each line's height from the metrics of the runs in it, unless a strut overrides them. forceStrutHeight makes every line use the strut's height and, as the documentation warns, adjacent lines may overlap. Use it for numeric displays or Latin-only UI where a strict rhythm matters, not in widgets that render translated copy.

iOS

On iOS, clipping usually comes from a custom font with tight ascent and descent values, a paragraph style with a maximum line height, or a view with a fixed height constraint. The UILabel report above found that the system font did not clip while the custom Latin font did, likely because the custom font's line metrics are tighter than the marks need. Leave maximumLineHeight at its default of 0, which means no limit, for any style used with localized copy, and let Auto Layout size labels vertically.

Web

On the web, MDN's line-height reference says the normal value depends on the user agent and is roughly 1.2 in desktop browsers, depending on the font family, and recommends a unitless value so line height scales with font size. A fixed pixel line height copied from a design file is the usual source of web clipping. Use a unitless value, and raise it for scripts that need it with a language selector on the root element.

:root { line-height: 1.5; }
:lang(th), :lang(vi), :lang(my) { line-height: 1.8; }

Treat the numbers above as starting points to verify with your fonts, not as standards.

Test with real stacked strings

Pseudolocalization catches a lot of layout problems, and the text expansion guide explains how accented pseudolanguages help find vertical clipping in Latin. They have limits for this problem.

Accented Latin pseudolocalization does not reproduce below-baseline marks or fallback-font metrics, so keep a fixture set of real stacked strings per script and render it in the production font at the largest text size.

This is a recommendation based on how the pieces fit together rather than a documented rule. Accented Latin adds marks above capitals, but it does not add Thai marks below the line or Arabic marks under letters, and it renders with your Latin font. The Android TextView documentation explains that line spacing can grow when fallback fonts are used, and the font fallback guide explains that a fallback face can have different ascent and descent values. A pseudo string never exercises that path, so a screen can pass every pseudolocale and still clip Thai.

Build a small fixture file per script with strings a reviewer has checked. A good fixture set covers:

  • Thai with stacked marks above and a mark below, such as น้ำ, ปั้น, and ครู.
  • Vietnamese capitals with stacked accents, such as TIẾNG VIỆT and ỄỖẪ.
  • Arabic with short vowel marks above and below, such as شُكْرًا.
  • Myanmar and at least one Indic script you ship, such as မြန်မာ.
  • A line that starts and ends with a complex-shaped or cursive letter.

Render each fixture in every text style your design system defines, in the shipping font, at the default size and the largest accessibility size. Planning notes in a job tracker issue for Burmese, Khmer, and Lao list "Very tall glyphs: no clipped text" as an acceptance item next to line breaking and font fallback. Write the same check into your own acceptance criteria.

Verify the fix

Screenshots catch clipping that unit tests miss, but you can make them deterministic:

  1. For each text style, render every fixture string in a container with no clipping and record the ink bounds. Then render it in the real component and assert that the component's bounds contain the ink bounds.
  2. On Android, run the fixture screens with the current target SDK and the next one. A diff after a target SDK bump is expected; review it instead of approving it blindly.
  3. On the web, run the same fixtures with each lang value you ship, so :lang() overrides are covered.
  4. In visual regression tools, keep separate baselines per script. A single Latin baseline cannot show that Thai lost its tone marks.
  5. Recheck after any change to fonts, line-height tokens, or container heights in the design system, since those affect every locale at once.

A reviewer who reads the script is still the final check. A tone mark that moved to the wrong letter or collided with another mark can pass an automated bounds test.

Common mistakes

  • Raising the global line height to fix one clipped button. Fix the container, then tune per script.
  • Turning off includeFontPadding in a shared text component to fix icon alignment, which removes room for every locale.
  • Keeping elegantTextHeight="false" in a theme and assuming it will keep working after the target SDK changes.
  • Copying fixed pixel line heights from a design file into web CSS.
  • Testing only with Latin pseudolocales and calling the layout verified.
  • Clamping calendar and timeline text with hidden overflow instead of rendering fewer whole lines.

Next step

Pick the three components most likely to clip, usually buttons, list rows, and anything with a fixed height, and render the fixture strings above in each one in your shipping font at the largest text size. Where Thai text is cut off or Vietnamese accents are sliced, remove the fixed height or hidden overflow first, then adjust line height for the scripts that still need it. Then add the fixture screens to the checklist for your next target SDK upgrade.