You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I check for the text size of a custom font straight after the font has been loaded for the first time, on mobile (tested only on webkit) often I get wrong results (in my case, roughly double the size).
When the font is "active" I do the following:
constnextText=document.createElement('span');nextText.style.position='absolute';nextText.style.fontFamily=style.fontFamily;nextText.style.fontWeight=style.fontWeight||'normal';nextText.textContent=nextWord;this.el.appendChild(nextText);// this.el is already added to the DOMconstrect=nextText.getBoundingClientRect();
After the font has been loaded once, the issue disappears.
Any idea how to safely postpone the check of the sizes after the new loaded font has been assigned and the new element added to the DOM? Thanks!
Dependency: "webfontloader": "^1.6.10"
The text was updated successfully, but these errors were encountered:
Would love to find a solution to this too. I've got some D3 scripts that need text measurements to do their thing, but the text size is often wrong on the first pass.
When I check for the text size of a custom font straight after the font has been loaded for the first time, on mobile (tested only on webkit) often I get wrong results (in my case, roughly double the size).
When the font is "active" I do the following:
After the font has been loaded once, the issue disappears.
Any idea how to safely postpone the check of the sizes after the new loaded font has been assigned and the new element added to the DOM? Thanks!
Dependency:
"webfontloader": "^1.6.10"
The text was updated successfully, but these errors were encountered: