Validate that translations fit within pixel-based layout constraints directly from the Editor
The Pixel-Based Length Check (PBLC) allows you to verify whether translations fit within defined layout constraints -- such as maximum width, height, and number of lines -- directly from the GL Strings Editor. Instead of exporting files and running external tools, you can run the check in-editor and immediately see which strings pass or fail.
The PBLC measures the pixel dimensions of each translation using the font and layout parameters you define via custom metadata fields. It then compares the measured dimensions against your specified bounding box constraints and assigns a status to each string:
Each checked string also receives a comment with detailed measurement information.
To run the PBLC, you need to provide layout metadata on your strings using custom metadata fields prefixed with GLS_. These fields define the font, size, and bounding box for each string.
The following fields are required for every string you want to check:
| Metadata Field | Description | Example Value |
|---|---|---|
GLS_FontName |
Google Fonts family name | Roboto |
GLS_FontSize |
Font size in pixels (must be > 0) | 16 |
GLS_BoundingBoxWidth |
Maximum allowed width in pixels (must be > 0) | 200 |
These fields allow fine-grained control over the text rendering. If not provided, defaults are applied.
| Metadata Field | Description | Default | Valid Values |
|---|---|---|---|
GLS_FontWeight |
Font weight | 400 |
100-900 or names like bold, light, normal, etc |
GLS_BoundingBoxHeight |
Maximum allowed height in pixels | -- | Any positive number |
GLS_MaxLines |
Maximum number of lines before truncation | -- | Any positive integer |
GLS_LetterSpacing |
Additional space between characters (px) | 0 |
Any number (including negative) |
GLS_WordSpacing |
Additional space between words (px) | 0 |
Any number (including negative) |
GLS_LineHeight |
Vertical distance between lines (multiplier) | 1.0 |
Any positive number |
GLS_TextTransform |
Text transformation | -- | uppercase, lowercase, capitalize |
GLS_FontStyle |
Font style | normal |
normal, italic, oblique |
GLS_FontVariant |
Font variant | normal |
normal, small-caps |
GLS_Kerning |
Enable or disable kerning | on |
on, off |
GLS_WordWrap |
Word wrapping behavior | normal |
normal, break-word |
Note: If neither
GLS_BoundingBoxHeightnorGLS_MaxLinesis provided, only the width constraint is checked.

After the check runs, each string receives a status and a descriptive comment.
The translation fits within all defined constraints.
Example comment:
[Pixel-Based Length Check] Text is 142px wide, which is within the max 200px.

The translation exceeds one or more of the defined constraints.
Example comments:
[Pixel-Based Length Check] Text width (256px) exceeds max width (200px) by 56px.
[Pixel-Based Length Check] Text height (72px) exceeds max height (48px) by 24px.
[Pixel-Based Length Check] Text requires 4 lines but only 2 are allowed.

The check could not be executed. This happens when:
GLS_FontName or GLS_FontSize defined.450 is not a standard weight.Example comments:
[Pixel-Based Length Check] Missing mandatory metadata fields: GLS_FontName, GLS_FontSize
[Pixel-Based Length Check] Failed to fetch font 'MyCustomFont'. Currently only Google Fonts are supported.
[Pixel-Based Length Check] Invalid font weight: '450'. Must be one of: 100, 200, 300, 400, 500, 600, 700, 800, 900 or their names (e.g. bold, light).
