polotno-project / polotno-board

Roadmap and bug-tracker for the Polotno project.
https://polotno.dev/
9 stars 1 forks source link

Different render result in browser vs node #75

Closed lavrton closed 2 weeks ago

lavrton commented 4 months ago

Try to render this design:

{"width":360,"height":360,"fonts":[],"pages":[{"id":"7850BdhOaJ","children":[{"id":"piWaIRSD3o","type":"text","name":"","opacity":1,"visible":true,"selectable":true,"removable":true,"alwaysOnTop":false,"showInExport":true,"x":196.4971491712692,"y":47.5,"width":121,"height":265,"rotation":0,"animations":[],"blurEnabled":false,"blurRadius":10,"brightnessEnabled":false,"brightness":0,"sepiaEnabled":false,"grayscaleEnabled":false,"shadowEnabled":false,"shadowBlur":5,"shadowOffsetX":0,"shadowOffsetY":0,"shadowColor":"black","shadowOpacity":1,"draggable":true,"resizable":true,"contentEditable":true,"styleEditable":true,"text":"This is the body. And there are quite some words here. This is safe. Let's see if this works or not. Hmmm.......let's see.","placeholder":"","fontSize":20,"fontFamily":"Roboto","fontStyle":"normal","fontWeight":"normal","textDecoration":"","fill":"black","align":"center","verticalAlign":"top","strokeWidth":0,"stroke":"black","lineHeight":1.2,"letterSpacing":0,"backgroundEnabled":false,"backgroundColor":"#7ED321","backgroundOpacity":1,"backgroundCornerRadius":0.5,"backgroundPadding":0.5}],"width":"auto","height":"auto","background":"white","bleed":0,"duration":5000}],"unit":"px","dpi":96}
lavrton commented 2 weeks ago

I just found that it is because of Hmmm.......let's part. 'change-font-size' text overflow behavior thinks it is one word, so is reducing font size to fit into width. Which is expected.