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

[Bug]: fabric.js give extra space at the end of the textbox. #9831

Open
7 tasks done
niketaOptimumnbrew opened this issue Apr 29, 2024 · 2 comments
Open
7 tasks done

Comments

@niketaOptimumnbrew
Copy link

niketaOptimumnbrew commented Apr 29, 2024

CheckList

  • I agree to follow this project's Code of Conduct
  • I have read and followed the Contributing Guide
  • I have read and followed the Issue Tracker Guide
  • I have searched and referenced existing issues and discussions
  • I am filing a BUG report.
  • I have managed to reproduce the bug after upgrading to the latest version
  • I have created an accurate and minimal reproduction

Version

5.3.0

In What environments are you experiencing the problem?

No response

Node Version (if applicable)

None

Link To Reproduction

http://fabricjs.com/kitchensink

Steps To Reproduce

  1. Add below code to canvas.
  2. canvas.add(new fabric.Textbox("Sample Text",{
    left: 10,
    top: 10,
    fontFamily: 'Roboto-Regular',
    angle: 0,
    fontSize:100,
    width:509,
    splitByGrapheme: true,
    fill:'#47d788',
    textBackgroundColor: "#ff3131"
    }));
  3. It gives me extra space at the end of the text in textbox.
  4. I'have verified that even i change the width from 509 to 508 then text will split into new line so it's not the width of textbox issue , it's something that i can't indetify.

Expected Behavior

  • Please don't give extra space at the end of text in textbox.

Actual Behavior

image
Please check above image.

  • Can you please tell me that what's the issue in this ? or what I'm doing wrong in it?

Error Message & Stack Trace

No response

@obrezalovro
Copy link

Additional info

  • i am using custom font family and it only happens when font-weight is light/regular. When font is 600/700 it works

@niketaOptimumnbrew
Copy link
Author

niketaOptimumnbrew commented Apr 29, 2024

Additional info

  • i am using custom font family and it only happens when font-weight is light/regular. When font is 600/700 it works

@obrezalovro Do you have any idea that how to manage with normal fonts?

It's working with textalign:justify but not with left ,right and center.

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

2 participants