阿拉伯语编码与html2canvas [英] Arabic Encoding with html2canvas

查看:332
本文介绍了阿拉伯语编码与html2canvas的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 html2canvas 获取一个div的图像,内容来自同一个页面,同一个域,但是它显示了阿拉伯语字母不连接,似乎html2canvas不支持阿拉伯语。

I am using html2canvas to take an image of a div, the content is from the same page, same domain, but it shows the Arabic letters disconnected, it seems that html2canvas doesn't support Arabic.

当我在其网页上阅读有关它的详细信息时,我没有找到任何有用的信息。

While I am reading the available details about it on its webpage, I didn't find any useful information.

这是我使用的简单代码:

Here is the simple code I used:

$("#import").click(function(){
    // send the contents of the email :)
    html2canvas(document.body, {
        onrendered: function(canvas) {
            document.body.appendChild(canvas);
        },
        letterRendering:true
    });
});

任何线索?

推荐答案

我想过尝试一些代码操作&它无限制地工作。答案是取代:

i thought of trying some code manipulation & It unblivably worked. The answer is to replace :

textList = (!options.letterRendering && /^(left|right|justify|auto)$/.test(textAlign) && noLetterSpacing(getCSS(el, "letterSpacing")))

with:

textList = (!options.letterRendering || /^(left|right|justify|auto)$/.test(textAlign) || noLetterSpacing(getCSS(el, "letterSpacing")))

((&))的通知由(||)代替。

notice at (&&) sign which is replaced by (||).

这篇关于阿拉伯语编码与html2canvas的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆