incubator-weex icon indicating copy to clipboard operation
incubator-weex copied to clipboard

[iOS] weex引用原生本地自定义字体文件频繁打印error信息

Open demoker opened this issue 3 years ago • 0 comments

iOS原生与Weex页面使用同一种字体,会导致一些Weex Error打印, 猜测原因是:原生plist中会先注册一边,然后weex界面加载的时候会根据DomModule中原生提供的字体本地沙盒路径再次进行注册,字体显示是正常的,只是控制台会频繁打印error信息,影响性能

对于原生已经注册的字体,weex SDK里面应该作出相应的判断处理

Log info: <Weex>[error]WXUtility.m:568, Unable to register font, but will unregister previous one and retry with new font file, { src = "file:///private/var/containers/Bundle/Application/E62577F7-C573-414A-89BE-513D9F017BAB/%E7%95%85%E5%90%AC%E6%9E%81%E9%80%9F%E7%89%88.app/Akrobat_kw_Regular.ttf"; localSrc = file:///private/var/containers/Bundle/Application/E62577F7-C573-414A-89BE-513D9F017BAB/%E7%95%85%E5%90%AC%E6%9E%81%E9%80%9F%E7%89%88.app/Akrobat_kw_Regular.ttf; }.

<Weex>[error]WXUtility.m:573, We cannot register the font finally. Error Domain=com.apple.CoreText.CTFontManagerErrorDomain Code=105 "Could not register the CGFont '<CGFont (0x280dff680): Akrobat-kw>'" UserInfo={NSDescription=Could not register the CGFont '<CGFont (0x280dff680): Akrobat-kw>', CTFailedCGFont=<CGFont (0x280dff680): Akrobat-kw>}

demoker avatar Apr 01 '21 09:04 demoker