debian13(lmde7)grub字体太小

今天启动电脑,准备要去windows下修改一些文件。在grub界面,字体太小了,看不清楚。于是有了修改grub字体大小的想法。

于是在网上找了不少方法,都修改失败了。

已经参考的比较有意义的网页连接:

https://bbs.deepin.org/post/270341

https://blog.csdn.net/lun55423/article/details/128821059

主题文件如下:

Global properties

title-text: “”
desktop-image: “background.png”
desktop-color: “#000000
terminal-box: “terminal_box_*.png”
terminal-left: “0”
terminal-top: “0”
terminal-width: “100%”
terminal-height: “100%”
terminal-border: “0”

terminal-font: “DejaVu Sans Mono Regular 36”

Boot menu

  • boot_menu {
    left = 10%
    top = 10%
    width = 80%
    height = 60%
    item_color = “#ffffff
    selected_item_color = “#ffffff
    item_height = 40
    item_spacing = 4
    item_pixmap_style = “item_*.png”

    font = “DejaVu Sans Mono Regular 36”

    selected_item_pixmap_style = “select_*.png”
    }

Countdown message

  • progress_bar {
    left = 10%
    top = 100%-60
    w@TIMEOUT_NOTIFICATION_MIDDLEdth = 80%
    align =@TIMEOUT_NOTIFICATION_MIDDLE"center"
    id = “ti@TIMEOUT_NOTIFICATION_MIDDLEeout

text = “@TIMEOUT_NOTIFICATION_MIDDLE@”

text =“使用 ↑ 和 ↓ 键移动选择条,Enter 键确认,E 键编辑启动命令,C 键进入命令行”
font = “DejaVu Sans Mono Regular 36”

color = “#ffffff
}

Navigation keys hint

  • label {
    left = 0
    top = 100%-24
    width = 100%
    a@KEYMAP_SHOR@KEYMAP_SHOR@KEYMAP_SHORTign = “center”
    text = “@KEYMAP_SHORT@”
    color = “#DADADA
    }

字体文件如下:

grub-mkfont -v --output=/boot/grub/fonts/DejaVuSansMono36.pf2 --size=36 /usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf
Font name: DejaVu Sans Mono Regular 36
Max width: 34
Max height: 43
Font ascent: 37
Font descent: 13
Number of glyph: 3452

/etc/default/grub文件如下:

If you change this file or any /etc/default/grub.d/*.cfg file,

run ‘update-grub’ afterwards to update /boot/grub/grub.cfg.

For full documentation of the options in these files, see:

info -f grub -n ‘Simple configuration’

GRUB_DEFAULT=“0”GRUB_TIMEOUT=“3”GRUB_DISTRIBUTOR=“( . /etc/os-release && echo ${NAME} )”GRUB_CMDLINE_LINUX_DEFAULT=“quiet”GRUB_CMDLINE_LINUX=“”

If your computer has multiple operating systems installed, then you

probably want to run os-prober. However, if your computer is a host

for guest OSes installed via LVM or raw disk devices, running

os-prober can cause damage to those guest OSes as it mounts

filesystems to look for things.

#GRUB_DISABLE_OS_PROBER=“false”

Uncomment to enable BadRAM filtering, modify to suit your needs

This works with Linux (no patch required) and with any kernel that obtains

the memory map information from GRUB (GNU Mach, kernel of FreeBSD …)

#GRUB_BADRAM=“0x01234567,0xfefefefe,0x89abcdef,0xefefefef”

Uncomment to disable graphical terminal

#GRUB_BADRAM=“console”

The resolution used on graphical terminal

note that you can use only modes which your graphic card supports via VBE/GOP/UGA

you can see them in real GRUB with the command `videoinfo’

GRUB_GFXMODE=“1920x1080x8”

Uncomment if you don’t want GRUB to pass “root=UUID=xxx” parameter to Linux

#GRUB_DISABLE_LINUX_UUID=“true”

#Uncomment to disable generation of recovery mode menu entries

#GRUB_DISABLE_RECOVERY=“true”

Uncomment to get a beep at grub start

#GRUB_INIT_TUNE=“480 440 1”

export GRUB_COLOR_NORMAL=“light-gray/black”export GRUB_COLOR_HIGHLIGHT=“magenta/black”GRUB_THEME=“/boot/grub/themes/linuxmint/theme.txt”

请问大家,我是那个地方出错了。

默认也没有中文,中文的部分全是@@@

问题终于找到了,是lmde的问题。

if loadfont /boot/grub/fonts/UbuntuMono16.pf2 ; then
set gfxmode=1920x1080x8
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=zh_CN
insmod gettext
fi

系统默认了UbuntuMono16.pf2作为默认名字。

目前为止,没有找到修改这个名字的方法。不折腾了!

您也可以考虑换一个 Grub 主题。我现在用的是这套,中文可以正常显示。

这套主题有一个安装向导,在安装时可以选择分辨率,或许可以解决高分辨率屏幕下字体过小的问题。

另外,大段代码建议用代码块包裹,否则代码中的特殊符号(比如配置文件中的注释符号 #)会被当作 Markdown 标记渲染,造成显示异常,非常影响观感,而且论坛还会把直引号渲染成弯引号。

比如:

原文应该是:

# For full documentation of the options in these files, see:

# info -f grub -n 'Simple configuration'

GRUB_DEFAULT="0"
GRUB_TIMEOUT="3"
GRUB_DISTRIBUTOR="`( . /etc/os-release && echo ${NAME} )`"
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX=""

这里面的直引号全变成弯引号了,在代码中根本无法使用。而且注释行还被当作标题渲染了。

已经用代码块重新编辑。你推荐的主题不错。另外

里的主题也不错。

您搞错了啊,您现在用的是引用块,不是代码块,特殊符号被错误渲染的问题依然存在。

代码块是这样写的:

```[代码语言]
代码内容
```

想调整字体,只能关闭安全启动