How to horizontal scaling for selected text in textbox fabric js

31 Views Asked by At

If selected text only horizontally scaling textbox The problem is implementing horizontal scaling for selected text within a Fabric.js Textbox. The objective is to allow users to adjust the width of selected text within the Textbox without changing the font size or the bounding box of the Textbox itself. The solution involves manipulating the spacing between characters to simulate horizontal scaling while maintaining the overall size of the Textbox constant. This requires splitting the text into individual characters and inserting zero-width space characters between them to increase spacing. The resulting text appears horizontally scaled without altering its font size or the Textbox dimensions. The implemented solution ensures seamless interaction and visual consistency when adjusting the width of selected text within the Textbox. enter image description here

if I use style like {0:{scaleX:2,scaleY:2}} not working on textbox and Itext I need "New" text only horizontal scaling in the textbox enter image description here

0

There are 0 best solutions below