扑来:加载非常大的飞镖数据文件块应用程序

发布于 2025-02-13 19:18:47 字数 720 浏览 2 评论 0原文

背景

我正在使用相同字体的几种尺寸开发一个扑朔迷离的应用程序。使用这些字体进行一些图像操纵。

问题

我正在使用纯飞镖软件包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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文