-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Feature request: Different types of text justification #4361
Comments
Is not hard to do. |
I found a pull request covering the same question: #3896 Would you be interested in me continuing this? it would need some changes:
|
it mostly depends how much code is. if you want to give a shot do it. keep it simple, slim, and check current fabricjs lint rules. I cannot guarantee i ll merge it |
I am a bit stuck, i can't figure out how to find out which linebreaks are inserted by the user, _splitTextIntoLines inserts new lines as well. Do you have any ideas? if not, i'll just carry on trying. |
there are 2 versions of _splitTextIntoLines, one for the text and one for the textbox. |
Thanks, that pushed me in the right direction, i'm nearly done now |
I decided to only add the 'justify-left' option. That and the default justify style are probably the only ones people will be using anyways. This way i was able to keep it very simple, only a couple of lines were added and changed and it is backwards compatible. There was apparently no need to change the toSVG function. I tested it and it already works. If there are people that would like 'justify-right' or 'justify-center' i am willing to make those as well, but i think it would make the code more complex. Here is my pull request: #4369 |
Continued in #4441 |
With text justification, there are multiple ways to handle the alignment of the last line.
See: https://en.wikipedia.org/wiki/Typographic_alignment#Examples
fabric.js uses full justify, see this example and check the last line:
http://jsfiddle.net/rkuv7my0/1/
Would it be possible to make this a property in fabric.js?
The text was updated successfully, but these errors were encountered: