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 bug with multiple text #140

Open
devilka4321 opened this issue Aug 8, 2021 · 1 comment
Open

letter-spacing bug with multiple text #140

devilka4321 opened this issue Aug 8, 2021 · 1 comment

Comments

@devilka4321
Copy link

devilka4321 commented Aug 8, 2021

Hello! Firstly: thank you for ur job, u're awesome!

And secondly I have problem:
Screen Shot 2021-08-08 at 5 42 27 PM

First element - has normal letter spacing, but second and third elements has other spacing.
I'm trying to use letter-spacing parameter in css, trying to use in js (elem.style.letterSpacing), but all of it works just on first element. What I need to do?

Part of code (I'm using svelte):

for (let i = 0; i < text.length; i++) {
    let circleType = new CircleType(text[i]);
    circleType.radius(360).dir(tabs[i].dir);
 }
  <p class="text" bind:this={text[i]} style="transform: rotate({tabs[i].rotate}deg) translate(0, {tabs[i].translate}px) scale({tabs[i].dir})">{tab.title}</p>
@devilka4321
Copy link
Author

Okay, I found reason: I'm using css transform property "rotate", and it's broken.

Now I apply this property (rotate) after generating curved text (at js). And it's works

for (let i = 0; i < text.length; i++) {
    let circleType = new CircleType(text[i]);
    circleType.radius(360).dir(tabs[i].dir);
    text[i].style.transform = 'rotate(' + tabs[i].rotate + 'deg) translate(0, ' + tabs[i].translate + 'px) scale(' + tabs[i].dir + ')'
 }
<p class="text" bind:this={text[i]}>{tab.title}</p>

Screen Shot 2021-08-08 at 6 11 37 PM

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

1 participant