hiloteam / Hilo

A Cross-end HTML5 Game development solution
https://hiloteam.github.io/
MIT License
5.93k stars 863 forks source link

【BUG】Hilo.Text创建的文本在IOS/安卓下展示不一致 #160

Open lmzhu opened 4 years ago

lmzhu commented 4 years ago

调试发现,安卓下canvas.fillText绘制的文本line-height强制为1
IOS下强制为normal
不得不在使用的时候做适配
const createHiloFontSize = (fontSize) => `${fontSize}px/${isIOS() ? 'normal' : `${fontSize}px`}`; 建议优化Hilo.Text.measureFontHeight 方法来修复问题

wickedcode01 commented 4 years ago

字体大小怎么控制,setFont设置根本没用啊。。