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.

Default autosize doesn't work with custom font

See original GitHub issue

With default font, default autosize works properly. The labels are clipped only at the end:

1

With custom font, labels are cut off at beginning and end:

2

I expect labels to be clipped only at the end.

Repro:

  • Online editor with spec
  • Open Chrome Developer Tools. Run in Console:
    var link = document.createElement('link');
    link.href = "https://fonts.googleapis.com/css?family=Montserrat";
    link.rel = "stylesheet";
    document.body.prepend(link);
    
  • Now text is clipped.
  • If you delete second Montserrat line, text will no longer be clipped.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
melissachangcommented, Mar 7, 2019

Thanks. Preloading the font was difficult with Create React App. Here’s how I did it, in case it helps anyone else.

0reactions
jheercommented, Mar 7, 2019

Thanks for sharing!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Autosizing of TextView doesn't work (Android O)
It should be automatically resized so it displays the whole text (all characters + not cropped) in the biggest possible textSize .
Read more >
Autosize TextViews - Android Developers
There are three ways you can set up the autosizing of TextView , described in the sections that follow: Default; Granularity; Preset sizes....
Read more >
Scaling Fonts Automatically | Apple Developer Documentation
In Interface Builder, select the text style from the Font menu, then select the Automatically Adjust Font checkbox to the right of Dynamic...
Read more >
Use Custom Fonts - Tableau Help
To use a custom font in Tableau, the first step is to install it on the computers that are ... To resolve this...
Read more >
How to use Dynamic Type with a custom font - a free SwiftUI ...
To work around this we need to create a custom ViewModifier that can scale up our font size based on the current accessibility...
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