html2canvas icon indicating copy to clipboard operation
html2canvas copied to clipboard

CSS Writing Modes not working

Open brenofabio opened this issue 7 years ago • 8 comments

Hello!

Thanks for the great work in this amazing library. I've been having problems while trying to render a page with the "writing-mode" CSS property. The "transform: rotate()" works fine, but there are some differences between them, and sometimes it may not be an option.

writing-mode: vertical-lr;
-ms-writing-mode: tb-lr;
*writing-mode: tb-lr;

JS Fiddle http://jsfiddle.net/brenofabio/su9k6p6z/3/

image

More about CSS Writing Modes: https://24ways.org/2016/css-writing-modes/ https://developer.mozilla.org/en-US/docs/Web/CSS/writing-mode https://drafts.csswg.org/css-writing-modes/

brenofabio avatar Nov 02 '17 21:11 brenofabio

Updated jsfiddle for 1.0.0: http://jsfiddle.net/tw9a2d1g/

niklasvh avatar Jan 02 '18 12:01 niklasvh

Hi @niklasvh,

writing-mode still not working as you can see in Fiddle image

Prabhat2404 avatar Feb 28 '18 06:02 Prabhat2404

Hi @niklasvh, any idea about this?

bierx avatar Jan 27 '19 18:01 bierx

For CJK content (Japanese in my case), vertical-rl is often used. Unfortunately, this renders like in the screenshots above. It would be nice if this were supported

chocolatkey avatar Jun 10 '19 08:06 chocolatkey

I was trying out a JSFiddle that used an old version (0.4.1) of the library, and vertical-rl actually looked pretty good besides the spacing/rotation of punctuation in the content.

Left is original, right is screenshot: New version of lib (https://github.com/niklasvh/html2canvas/releases/download/v1.0.0-rc.3/html2canvas.min.js): image

Old version of lib (https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.min.js): image

chocolatkey avatar Sep 15 '19 23:09 chocolatkey

any updates for this?

GurvirSingh avatar Dec 31 '21 19:12 GurvirSingh

When using it in Japanese, I solved it using
and flex.

s11rikuya avatar Mar 17 '22 17:03 s11rikuya

hope someone can handle it

@s11rikuya Can you give more detail?

yanghoxom avatar Aug 08 '22 10:08 yanghoxom

Did anyone find a solution?

marvin-wtt avatar Feb 20 '23 00:02 marvin-wtt

Did anyone find a solution?

switched to dom to image library lol

pgn127 avatar Feb 20 '23 00:02 pgn127

CSS` to the cell, and put a inside the cell with this CSS

.cellStyle{ /* writing-mode: vertical-rl; transform: rotate(180deg); */ white-space: normal; vertical-align: bottom; } .spanStyle{ transform-origin: left; transform: translate(50%, 50%) rotate(-90deg); display: block; }

example:

<td class='cellStyle'>
      <span class='spanStyle'>
            Hello world
      </span>
</td>

enjoy..!

pablochi90 avatar Apr 14 '23 07:04 pablochi90

Any update?

jrichardsz avatar May 03 '23 22:05 jrichardsz

switched to dom to image too

marvin-wtt avatar May 03 '23 23:05 marvin-wtt

Turned to html to image in the end.

xulihang avatar Jul 15 '23 06:07 xulihang