Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请教字体解析问题? #844

Open
ytchw101 opened this issue Jun 28, 2023 · 1 comment
Open

请教字体解析问题? #844

ytchw101 opened this issue Jun 28, 2023 · 1 comment

Comments

@ytchw101
Copy link

你好,我的目的是得到某个矢量字体(.ttf字体)中某些字的字模数据。ttf字体存在SD卡上
目前工程的做法是:

  1. asset_info_t* iter = assets_manager_load(assets_manager(), ASSET_TYPE_FONT, font_name);

  2. ttf字体加载成功后再使用font_manager_get_font 和 font_get_glyph即可得到我想要的字模数据。

问题:主要第1步骤加载字体比较耗时,字体越大越耗时 比如加载一个15M的 "宋体.ttf" 约需要2秒左右
使用预加载(assets_manager_preload)也一样耗时

想问下有无什么其他办法能直接得到SD卡中某个ttf字体中的某些字的字模数据?

(AWTK源码我是20年6月最后更新的,目前使用比较稳定,所以一直未更新)

@xianjimli
Copy link
Member

linux系统可以用mmap加载文件,速度要快一些,其它嵌入式系统好像没什么好的办法

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants