question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Some rendered text can exceed calculated bounds.

See original GitHub issue

The 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:

image

But instead seeing:

image

on macOS with latest Chrome.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
kanitwcommented, May 27, 2020

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) .

1reaction
jheercommented, May 27, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found