浏览代码

Merge pull request #13998 from mooncaker816/splitByUnicode

Font: handle unicode string split properly
Mr.doob 7 年之前
父节点
当前提交
c64a4527da
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/extras/core/Font.js

+ 1 - 1
src/extras/core/Font.js

@@ -40,7 +40,7 @@ Object.assign( Font.prototype, {
 
 function createPaths( text, size, divisions, data ) {
 
-	var chars = String( text ).split( '' );
+	var chars = Array.from ? Array.from( text ) : String( text ).split( '' ); // see #13988
 	var scale = size / data.resolution;
 	var line_height = ( data.boundingBox.yMax - data.boundingBox.yMin + data.underlineThickness ) * scale;