Closed maniac-0s closed 2 years ago
Not sure if OpentypeJS is the culprit here, I don't see how feeding a series of Path to fabric.js could generate a newline at any point. Is there some other metadata that could help fabric.js understand that this specific glyph is a special character (backspace, breakline ...) ?
Closing as the issue seems stale. Do not hesitate to re-open of something new comes up
Any update about this break line issue with opentype js and fabric js ? thx
I create text on the canvas using fabric.js and then render an SVG containing paths. Using fabric.js "iText" object I can have word wrapping, line break, centered text ect.
I use opentype.js to iterate over each iText-object, generate a path from it and feed the path back into fabric.Path(path.toPathData()) and then use fabric.js' SVG export to get the SVG file:
When I export the SVG directly from fabric, the line break works, but when I convert it into a path using opentype.js, the line break becomes a square and the whole text is in one line.![Screenshot_2021-07-15_17-47-08](https://user-images.githubusercontent.com/78015362/125817828-051f460b-583f-4e04-8086-b42caf53fe7f.png)
I found this old closed issue https://github.com/opentypejs/opentype.js/issues/352 and I wanted to ask what's with this now. opentype-layout was last committd 5 years ago and I am kinda hesitating to use such old code in production. What do you think?