mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
chinese word rendering
This commit is contained in:
10
src/Parse.js
10
src/Parse.js
@ -170,6 +170,16 @@ _html2canvas.Parse = function (images, options) {
|
||||
|
||||
metrics = setTextVariables(ctx, el, textDecoration, color);
|
||||
|
||||
if (options.chinese) {
|
||||
textList.forEach(function(word, index) {
|
||||
if (/.*[\u4E00-\u9FA5].*$/.test(word)) {
|
||||
word = word.split("");
|
||||
word.unshift(index, 1)
|
||||
textList.splice.apply(textList, word);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
textList.forEach(function(text, index) {
|
||||
var bounds = getTextBounds(state, text, textDecoration, (index < textList.length - 1));
|
||||
if (bounds) {
|
||||
|
@ -18,10 +18,10 @@ window.html2canvas = function(elements, opts) {
|
||||
ignoreElements: "IFRAME|OBJECT|PARAM",
|
||||
useOverflow: true,
|
||||
letterRendering: false,
|
||||
chinese: false,
|
||||
|
||||
// render options
|
||||
|
||||
flashcanvas: undefined, // path to flashcanvas
|
||||
width: null,
|
||||
height: null,
|
||||
taintTest: true, // do a taint test with all images before applying to canvas
|
||||
|
Reference in New Issue
Block a user