Open BhargavZanzmera opened 1 year ago
Fabric grapheme abilities are not enough for hindi.
i suggest you take a grapheme splitting library like this one that covers unicode up to 15 https://github.com/orisano/graphemesplit and override fabric.util.string.graphemeSplit.
As state in docs fabric.util.string.graphemeSplit is meant to be changed with specialized libraries, since we won't be updating it to run behind unicode changes.
installed npm i graphemesplit, then
I used like this and problem solved.
import split from 'graphemesplit'; fabric.util.string.graphemeSplit = split
In v6 you need to override FabricText
And maybe it is time it is part of the repo
CheckList
Version
5.3.0
In What environments are you experiencing the problem?
Firefox, Chrome, Safari, Opera, Microsoft Edge
Node Version (if applicable)
None
Link To Reproduction
http://fabricjs.com/test/misc/itext.html
Steps To Reproduce
Note : watch below video to reproduce bug. If you are unable to create it then try some other joint word of hindi or gujarati.
screen-capture (4).webm
Expected Behavior
I-text box size should be same as per the content it has.
Actual Behavior
Error Message & Stack Trace
No response