Skip to content
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

Font size is miscalculated because of line-height #21

Closed
kmamal opened this issue Dec 27, 2019 · 3 comments
Closed

Font size is miscalculated because of line-height #21

kmamal opened this issue Dec 27, 2019 · 3 comments
Labels

Comments

@kmamal
Copy link

kmamal commented Dec 27, 2019

In function getRealFontSize you are creating an em-block (<div>M</div>) and measuring it's height to get a scaling factor. However the height of that block is affected by the CSS line-height property. In our application we set line-height to 1.5 and so all the subtitles appear smaller than they should be.

We have made a workaround by setting line-height to 1.2 in the container element. We think however that this is better done inside the ASS-fix-font-size class in your code.

@weizhenye
Copy link
Owner

line-height is not a specific value with different font-size and font-family, set it to 1.2 will cause more inconsistent.

@weizhenye
Copy link
Owner

Oh, I should set line-height: normal; inside ASS-fix-font-size

@kmamal
Copy link
Author

kmamal commented Jan 8, 2020

@weizhenye Thanks for addressing this! You're right, line-height: normal is the correct approach.

But the problem is not completely solved: the lines of the subtitles themselves are displayed with the wrong line height. Could you also add line-height: normal to the subtitles themselves?

weizhenye added a commit that referenced this issue Jan 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants