measureText 计算 fontSize 有误
zhiqingchen opened this issue · comments
tony chen commented
Lines 75 to 79 in e5d275f
DEFAULT_FONT 为 12px sans-serif
运行时为 normal normal 12px sans-serif
font = font || DEFAULT_FONT;
const res = /^([0-9]*?)px$/.exec(font);
const fontSize = +(res && res[1]) || DEFAULT_FONT_SIZE;
res 为 null, fontSize 只能为 DEFAULT_FONT_SIZE
Wenli Zhang commented
normal normal 12px sans-serif
是怎么来的?请提供一个调用时的代码