V
V
Vitalij Rudyuk2015-08-01 15:41:01
JavaScript
Vitalij Rudyuk, 2015-08-01 15:41:01

Why do letters go far towards the side when converting canvas to png?

The fabric.js library is used.
We have a 1772px wide canvas. We make it zoom 0.4 and when we write
canvas.toDataURL({format: 'png', multiplier: 1});
we get this
i.stack.imgur.com/bUR3u.png
and when we write canvas.toDataURL({format: 'png', multiplier: 1/0.4});
we get this image i.stack.imgur.com/Zw4zS.png
As you can see, the capital letters of the names flew far to the left when the multiplier parameter was increased. The size of this font is 262px If you reduce the font (well, for example, to 100px), then in both cases it will be fine. If someone faced this problem, tell me how to solve it? In total, we get that you can reduce the multiplier or reduce the font, and only then the font will be displayed normally, otherwise this is some kind of bug.
The font used is BickhamScriptTwo.ttf
UPD: I recorded a video of what it looks like https://drive.google.com/file/d/0BwcWF1RzBeJVbVgzc...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Skahin, 2015-08-02
@pihel

Can the scale be changed not on the canvas, but on the html container through transform: scale ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question