EffEPi / fabric.curvedText

Allows you to create curved text - extension to fabric.js
43 stars 41 forks source link

Curved Text Character Angle #31

Closed akkivaghasiya5 closed 8 years ago

akkivaghasiya5 commented 8 years ago

I have make changes which will solve unknown reason of divide by 4 (it must be 2). You must set 'curAngle' value as angle of character instead of 'curAngleRotation'. So you don't need to set curAngleRotation. To test and see difference of this change, set radius to '200' and spacing to '575' with both files.

Here you can see difference. Upper horizontal two characterized string is using CurvedText(unchanged). Lower horizontal two characterized string is using chabed CurvedText.

akkivaghasiya5 commented 8 years ago

I'm also getting that why there should be divide by 2 and character angle as 'curAngleRotation'. But if you want to do that, then you have to change concept of spacing. Currently you are considering full space value after every character except last character.

EffEPi commented 8 years ago

can you get me an example running with your changes so I can double check the difference and that it works properly and as expected ?

akkivaghasiya5 commented 8 years ago

See this. Curved text in upper canvas is created using your curvedText extension. And curved text in lower canvas is created by changing your library. You can see the difference in angle of all characters. e.g, Angle of 'C' should be 0 as it is at exact top of centre of canvas. Same for other characters too. I hope you will understand. If not, ask again as I'm too bad to explain anything to other.