-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Miscalculation when using custom fonts #80
Comments
@danielbitzer Sorry for the delayed repsonse. Thanks for the info. I will keep this in mind for future changes. |
Thank you for the fix to '1' I found the word 'normal' in the current vanilla js version and it works great now! |
Oh well. Works great on headlines, but on small chunks of text that I use it on, it's very odd. Too bad this can't be tweaked per class with some arguments. |
@redmunds Here's a fiddle that demonstrates this behavior: https://jsfiddle.net/jsL7qh96/ Note that I was able to fix this by removing this line from the source:
Out of curiosity, why remove the line height in the first place? |
@daveyjones Normalizing the line-height fixes the case where line-height is much larger than font-size. See LINE HEIGHT TEST case in test/test1.htm . |
I can confirm that changing it to 1 instead of normal fixes it for me too, thanks. |
Thanks for developing this amazing script!
I just wanted to flag this issue in case anyone else has experienced it.
I only notice the issue when loading a custom font (from MyFonts) where the text is be balanced across too many lines, so text that could easily fit on 2 lines would render over 3 lines.
I think the issue can be traced back to the nowrapHeight calculation. I've fixed the issue for myself by changing line 313 from
$this.css('line-height', 'normal');
to$this.css('line-height', '1');
The text was updated successfully, but these errors were encountered: