扑来:加载非常大的飞镖数据文件块应用程序
背景
我正在使用相同字体的几种尺寸开发一个扑朔迷离的应用程序。使用这些字体进行一些图像操纵。
问题
我正在使用纯飞镖软件包image
https:// /pub.dev/packages/image 。
我将各种字体大小预先计算为list< int>
:
const _font_size_108 = const
[80,75,3,4,20,0,0,...
相同字体的大约15个大小变化导致DART文件的大约15 mb。
应用程序加载此文件的那一刻,该应用程序会轻松阻止30秒。 (随着数据的扩展,从较小的FNT文件加载这些字体大约需要同一时间。)
加载后,一切都可以再次工作。
问题
有没有办法减少加载此大字体文件所需的时间?
是否有一种更好地处理这种情况的飞镖 /颤动技术?
我应该尝试一个本地的Android Lib吗?
任何提示都赞赏。
Background
I am developing a Flutter app using several sizes of the same font. It does some image manipulation with these fonts.
Problem
I am using the pure Dart package image
https://pub.dev/packages/image.
I pre-calculate the various font sizes to lists like this List<int>
:
const _font_size_108 = const
[80,75,3,4,20,0,0,...
About 15 size variations of the same font result in a dart file with a file size of 15 MB.
The moment the app loads this file, the app is blocked for a easily 30 seconds. (Loading these fonts from way smaller FNT files takes about the same time, as the data gets expanded.)
Once loaded, everything works smoothly again.
Question
Is there a way to reduce the the time it takes to load this large font file?
Is there a Dart / Flutter technique to handle this situation better?
Should I try a native Android lib?
Any hints appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论