Some rendered text can exceed calculated bounds.
See original GitHub issueThe apparent issue is that titles get truncated in certain languages when padding is set to zero.
This is likely because the bounding box calculation for text marks is using some heuristics that doesn’t generalize to all languages.
Example spec to reproduce:
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"title": "Hello World สวัสดีชาวโลก",
"padding": 0
}
Expecting the Thai characters to look like:
But instead seeing:
on macOS with latest Chrome.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
UITextView's textContainer renders at the wrong frame when ...
I've tried setting and resetting the UITextView 's frame.size, I've tried manually setting the NSTextContainer 's size, and some other hacky solutions but...
Read more >Ellipses and Rendering Limits - Microsoft Learn
Name Description Value
mobile_basetextlengthlimit Base limit for text length 1024
mobile_maximumimagesize_kilobyte Size limit for images in Kbytes 100
mobile_enablelimitationondispform Flag for ellipsis rendering on Display form...
Read more >11 Visual rendering model details
This property determines what happens when an element's rendered contents exceed its height or width.
Read more >Why My Text Is Going Off Screen? The Truth about React ...
But Text-In-A-Row certainly keeps some of the Element-In-A-Row properties : it still ignores completely its row siblings, and goes out of bounds ......
Read more >When does Excel decide to overflow text into adjacent cells, or ...
For text to overflow beyond the edge of a cell, the following conditions must be true: The cell does not have "Wrap Text"...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
FWIW, this might be an issue specific to Thai typography since it can have two levels of ascending characters. Consider the following three sets of characters, containing 1-3 characters respectively: ด, ดี, ดิ์.
The occurences of two level of ascending character are actually not rare (and is perhaps quite important as my last name (วงศ์ศุภสวัสดิ์) also has it lol) .
Bounding box height for text in Vega is calculated using the specified pixel height directly. No other tricks or heuristics. Can you first verify whether browsers respects the provided text height setting? For example if a client specifies “12px” as the text size, does the resulting Thai text respect that?
Looking at the image you shared, it appears that the Thai text has annotations that exceed the requested font size. If that is indeed the case, it would be useful to find a standards document that describes how browsers / CSS are supposed to handle pixel-based font size units.