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

letter-spacing not taken into account #59

Closed
DanDeMicco opened this issue Sep 22, 2017 · 2 comments
Closed

letter-spacing not taken into account #59

DanDeMicco opened this issue Sep 22, 2017 · 2 comments

Comments

@DanDeMicco
Copy link

Hi, thanks for creating an maintaining this repo.

I am running into an issue where the truncating is not working as expected. If i specify there to be 2 lines to be shown, it will show something like

lorem ipsum
lorem ipsum
lorem...

I did some debugging as I found it worked elsewhere, and found out removing letter-spacing makes it work correctly. Looking through the source, it indeed appears there is no mention of letter-spacing in the css properties.

Is there a way in which the letter spacing can be taken into account when calculating the width, either automatically or by specifying a custom prop?

Here is a WebpackBin of the problem https://www.webpackbin.com/bins/-KueNc5FP6xDfCRLM4zp

@pablosichert
Copy link
Owner

Hi, thanks for reporting this issue.

Unfortunately, the canvas context.font API (which this component relies on) does not support a letter spacing / word spacing argument. So there's no way to easily support that feature.

See #30 (comment) for similar context.

@whatyoubendoing
Copy link

Chrome now supports letter-spacing in v56 see CreateJS/EaselJS#872. Could be viable to provide a flag to expose the functionality or in 56=< choose to include line-height.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants