如何将 ttf 字体转换为 pff2?

发布于 2025-01-04 15:54:49 字数 282 浏览 4 评论 0原文

我正在研究 grub2 主题,但似乎无法将 ttf 转换为 grub 的本机格式。

我尝试这样做:

➜  asdfafdsgsgsg  ttf2bdf -p 32 Oxygen_Regular_Oxygen.ttf > oxygen.bdf
➜  asdfafdsgsgsg  grub-mkfont -s 32 -o oxygen.pf2 oxygen.bdf          
grub-mkfont: error: can't set 32x32 font size.

I'm looking into grub2 themes, and i can't seem to convert ttf to grub's native format.

I tried to do this:

➜  asdfafdsgsgsg  ttf2bdf -p 32 Oxygen_Regular_Oxygen.ttf > oxygen.bdf
➜  asdfafdsgsgsg  grub-mkfont -s 32 -o oxygen.pf2 oxygen.bdf          
grub-mkfont: error: can't set 32x32 font size.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦亿 2025-01-11 15:54:49

生成 Grub2 PF2 字体需要极大的耐心,因为我必须多次尝试转换。

如果您从 TTF 出发 -> PF2,您应该首先尝试跳过BDF中间阶段。像这样的命令,

grub2-mkfont -o ./oxygen.pf2 -s 24 ./Oxygen_Regular_Oxygen.ttf

如果只是 -p 32 导致了该错误,我会按面值接受该输出。除非您知道其他字体可以成功指定如此大的磅值。另外,我希望 grub-mkfont 不会被允许生成大小超过 Grub2 限制的字体。不过我应该提到,grub-mkfont 历史上一直缺乏适当的维护。目前情况可能并非如此,并且预计上游早已纠正了这一问题,但分发往往滞后。

Generating Grub2 PF2 fonts requires significant patience, as I had to attempt the conversion multiple times.

If your going from TTF -> PF2, you should first try skipping the BDF intermediate stage. Something like this command,

grub2-mkfont -o ./oxygen.pf2 -s 24 ./Oxygen_Regular_Oxygen.ttf

If it was only the -p 32 which caused that error, I would accept that output at face value. Unless you know of other fonts, which successfully specified such a large point size. Additionally I would hope grub-mkfont wouldn't be allowed to generate a font, whose size exceeds Grub2 limitations. However I should mention, grub-mkfont historically had been lacking in proper maintenance. This might not currently be the case, and would expect upstream has rectified this long ago, but distributions often lag behind.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文