当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 10 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : grub2 如何换回硬件字体
帖子发表于 : 2015-07-22 15:41 
头像

注册: 2008-07-30 23:21
帖子: 13427
地址: freebuilder@yeah.net
系统: Debian stable AMD64
送出感谢: 38
接收感谢: 127
首现,这里我不需要中文,ASCII 足矣。
我知道,下图这种比较粗的字体是硬件自带的字库。
附件:
1.png
1.png [ 17.66 KiB | 被浏览 2279 次 ]


现在的 grub 搞的确是这种细细的看不清的字体。
附件:
2.png
2.png [ 14.31 KiB | 被浏览 2279 次 ]



问题,如何让 grub2 使用那种比较粗的硬件自带的字体?

自己搞字体文件,那是伪作,我不想弄。

GRUB_TERMINAL=console
这会导致下面两行参数无效,即不能使用高分辨率
GRUB_GFXMODE=800x600x24
GRUB_GFXPAYLOAD_LINUX=keep
这也是我所不希望的。

万能的论坛,求解!


_________________
(2015-11-16 更新)适合 WM 的截图脚本
(2015-08-24 更新)Debian、Ubuntu 源列表说明
(2013-02-01 首发)文字如何绘出
▷▷ 【更 多 在 此】 ◁◁
箪食瓢饮随遇安,不求栋梁求参天。
【初韵】一门牛逼的编程语言。


页首
 用户资料  
 
2 楼 
 文章标题 : Re: grub2 如何换回硬件字体
帖子发表于 : 2015-07-22 19:38 
头像

注册: 2006-03-14 10:25
帖子: 644
送出感谢: 1
接收感谢: 4
mark :em11


页首
 用户资料  
 
3 楼 
 文章标题 : Re: grub2 如何换回硬件字体
帖子发表于 : 2015-07-22 22:16 
头像

注册: 2008-09-18 13:11
帖子: 2781
送出感谢: 1
接收感谢: 453
哈,硬件字体?难道不是下面这个
附件:
font.png
font.png [ 58.27 KiB | 被浏览 2182 次 ]


这个字体是以点阵形式编码的,具体可见内核源码 lib/fonts/font_8x16.c

系统上现成的字体,就我所知道的,以console-setup-linux包提供的/usr/share/consolefonts/Uni1-VGA16.psf.gz 最为接近
不过psf字体grub2不认,你需要去网上下载psftools工具,将其转换成其他格式如bdf,再用grub-mkfont工具转换成grub2能认的pff2格式
如果你能找到更接近的ttf字体,可以直接用grub-mkfont转换

然后/etc/default/grub里加一句GRUB_FONT=/path/to/xxx.pf2后update-grub就行了

另外你这个该发到配置美化区吧


页首
 用户资料  
 
4 楼 
 文章标题 : Re: grub2 如何换回硬件字体
帖子发表于 : 2015-07-22 22:34 
头像

注册: 2008-07-30 23:21
帖子: 13427
地址: freebuilder@yeah.net
系统: Debian stable AMD64
送出感谢: 38
接收感谢: 127
astolia, 好吧,那是内核字体,我用 fixedsys.ttf 转吧,我挺喜欢这个的。


_________________
(2015-11-16 更新)适合 WM 的截图脚本
(2015-08-24 更新)Debian、Ubuntu 源列表说明
(2013-02-01 首发)文字如何绘出
▷▷ 【更 多 在 此】 ◁◁
箪食瓢饮随遇安,不求栋梁求参天。
【初韵】一门牛逼的编程语言。


页首
 用户资料  
 
5 楼 
 文章标题 : Re: grub2 如何换回硬件字体
帖子发表于 : 2015-07-24 13:41 
头像

注册: 2006-03-14 10:25
帖子: 644
送出感谢: 1
接收感谢: 4
正好我也想请教一下,grub2 那个外边框的一圈有办法去掉么,有这一圈显着太土了 :em11


页首
 用户资料  
 
6 楼 
 文章标题 : Re: grub2 如何换回硬件字体
帖子发表于 : 2015-07-24 17:08 

注册: 2009-08-04 16:33
帖子: 16886
送出感谢: 21
接收感谢: 1826
請參閱
1. https://help.ubuntu.com/community/Grub2/Displays

2. http://www.gnu.org/software/grub/manual ... ormat.html
6.2.2 Fonts
Fonts are loaded with the “loadfont” command in GRUB.
To see the list of loaded fonts, execute the “lsfonts” command.


页首
 用户资料  
 
7 楼 
 文章标题 : Re: grub2 如何换回硬件字体
帖子发表于 : 2015-07-28 18:42 
头像

注册: 2008-07-30 23:21
帖子: 13427
地址: freebuilder@yeah.net
系统: Debian stable AMD64
送出感谢: 38
接收感谢: 127
代码:
GRUB_TERMINAL=console
#GRUB_GFXMODE=800x600x24
GRUB_GFXPAYLOAD_LINUX=800x600x24

这才是我真正想要的 :em01
这个难倒不是硬件字体?


_________________
(2015-11-16 更新)适合 WM 的截图脚本
(2015-08-24 更新)Debian、Ubuntu 源列表说明
(2013-02-01 首发)文字如何绘出
▷▷ 【更 多 在 此】 ◁◁
箪食瓢饮随遇安,不求栋梁求参天。
【初韵】一门牛逼的编程语言。


页首
 用户资料  
 
8 楼 
 文章标题 : Re: grub2 如何换回硬件字体
帖子发表于 : 2015-07-28 20:17 

注册: 2009-08-04 16:33
帖子: 16886
送出感谢: 21
接收感谢: 1826
引用:
GRUB_TERMINAL=console
GRUB_GFXPAYLOAD_LINUX=800x600x24
这才是我真正想要的

1. GRUB_TERMINAL=console
Linux 的 console 分為兩類
https://en.wikipedia.org/wiki/Linux_console
Linux console
There are two main implementations: framebuffer and text mode.
1-1. Linux framebuffer
https://en.wikipedia.org/wiki/Linux_framebuffer
1-2. Text mode
https://en.wikipedia.org/wiki/Text_mode

2. http://mcs.une.edu.au/doc/grub2-tools/grub.html
‘GRUB_TERMINAL_INPUT’
‘console’ (native platform console),
The default is to use the platform’s native terminal input.
‘GRUB_TERMINAL_OUTPUT’
‘console’ (native platform console),
The default is to use the platform’s native terminal output.
‘GRUB_TERMINAL’
If this option is set, it overrides both ‘GRUB_TERMINAL_INPUT’ and ‘GRUB_TERMINAL_OUTPUT’ to the same value.
2-1. 意思是 ‘GRUB_TERMINAL’ ‘GRUB_TERMINAL_OUTPUT’ ‘GRUB_TERMINAL_INPUT’ 預設值就是 'console' 不需額外指定
2-2. sudo cat /etc/default/grub
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console
意思是 如果設定 GRUB_TERMINAL=console 將會關閉 圖形終端機

2. GRUB_GFXPAYLOAD_LINUX=800x600x24

2-1. 當已設定 GRUB_GFXPAYLOAD_LINUX=800x600x24 需要 圖形顯卡驅動 支援
2-1-1. http://mcs.une.edu.au/doc/grub2-tools/grub.html
‘GRUB_VIDEO_BACKEND’
If graphical video support is required, either because the ‘gfxterm’ graphical terminal is in use or because ‘GRUB_GFXPAYLOAD_LINUX’ is set, then grub2-mkconfig will normally load all available GRUB video drivers and use the one most appropriate for your hardware. If you need to override this for some reason, then you can set this option.
After grub2-install has been run, the available video drivers are listed in /boot/grub2/video.lst.

2-2. GRUB_GFXPAYLOAD_LINUX 可以設定為 text keep 800x600x24 等等方式
2-2-1. http://mcs.une.edu.au/doc/grub2-tools/grub.html
‘GRUB_GFXPAYLOAD_LINUX’
Set to ‘text’ to force the Linux kernel to boot in normal text mode, ‘keep’ to preserve the graphics mode set using ‘GRUB_GFXMODE’, ‘widthxheight’[‘xdepth’] to set a particular graphics mode, or a sequence of these separated by commas or semicolons to try several modes in sequence. See gfxpayload.
2-2-2. Depending on your kernel, your distribution, your graphics card, and the phase of the moon, note that using this option may cause GNU/Linux to suffer from various display problems, particularly during the early part of the boot sequence. If you have problems, set this option to ‘text’ and GRUB will tell Linux to boot in normal text mode.
2-2-3. 如果有問題 選擇 text 是被推薦的方法

3. 設定 GRUB_GFXPAYLOAD_LINUX=text 如果還有問題 參閱
http://askubuntu.com/questions/61233/wh ... linux-text
引用:
如何换回硬件字体

4. 參閱
http://askubuntu.com/a/61252/198920
cd /usr/share/grub/ . Copy the font files to another directory (cp, needs sudo, and *.pft copies the three font files at once) with sudo cp *.pf2 /boot/grub then update grub with sudo update-grub.
4-1. 如果你有偏好的字型檔 使用 root 權限 複製/貼到 /boot/grub 然後 執行 sudo update-grub
引用:
这里我不需要中文,ASCII 足矣。

5. 可以試試
GRUB_GFXPAYLOAD_LINUX=800x600x24
改為
# GRUB_GFXPAYLOAD_LINUX=800x600x24
5-1. sudo update-grub
5-2. sudo reboot
5-3. 如果 monitor 分辨率 比較大 字體將比較小
可以使用
sudo dpkg-reconfigure console-setup
調整字體大小

6. 提醒 凡是修改 /etc/default/grub
一定要 執行
sudo update-grub
sudo reboot
才生效

7. 以上一些是 參閱 Ubuntu 文件 但是 Debian 應該大部分可以適用
如果有錯誤 歡迎再貼文


页首
 用户资料  
 
9 楼 
 文章标题 : Re: grub2 如何换回硬件字体
帖子发表于 : 2015-07-28 21:09 

注册: 2009-08-04 16:33
帖子: 16886
送出感谢: 21
接收感谢: 1826
引用:
grub2 那个外边框的一圈有办法去掉么

1. 要移除边框 要自訂 customize theme
http://ubuntuforums.org/showthread.php? ... ost8675432
I don't think that is possible at the moment unless you get into theming - I believe the 'frame' is hard-coded into Grub 2.
The good news is that 'theming' is coming along, which allows great customization of the boot screen. There is a thread on GRUB2 theming for lucid? which discusses some Grub 2 alternatives/spinoffs (aka BURG) which can already produce some really nice boot themes.
And the Grub 2 devs hope to have theming ready for the rollout of Lucid, incorporating theming into Grub 1.98.

2. 如何自訂 customize theme
http://wiki.rosalab.ru/en/index.php/Gru ... _reference
Grub2 theme / reference


页首
 用户资料  
 
10 楼 
 文章标题 : Re: grub2 如何换回硬件字体
帖子发表于 : 2015-07-29 15:15 
头像

注册: 2008-07-30 23:21
帖子: 13427
地址: freebuilder@yeah.net
系统: Debian stable AMD64
送出感谢: 38
接收感谢: 127
poloshiao, 懂外文真好


_________________
(2015-11-16 更新)适合 WM 的截图脚本
(2015-08-24 更新)Debian、Ubuntu 源列表说明
(2013-02-01 首发)文字如何绘出
▷▷ 【更 多 在 此】 ◁◁
箪食瓢饮随遇安,不求栋梁求参天。
【初韵】一门牛逼的编程语言。


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 10 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 1 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译