purplebamboo / font-carrier

font-carrier是一个功能强大的字体操作库,使用它你可以随心所欲的操作字体。让你可以在svg的维度改造字体的展现形状。

Home Page:http://purplebamboo.github.io/font-carrier/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

not conrect in function 'function toUnicode(str)'

peacess opened this issue · comments

下面的代码运行不正常:
import FontCarrier from 'font-carrier';
const t = FontCarrier.transfer('t.ttf');
const s = '𠀀';
const newFont = t.min(s);
newFont.get(s) === undefined;

出错的原因在函中
function toUnicode(str) {
var uArray = []
var u = str2unicode(str)// 这一行不正确, 因为'𠀀'字符用utf-16时是4bytes,不是通常的2bytes
....
}