[Newbies] 引导界面字体太小
Tofloor
poster avatar
堕天使
deepin
2022-06-19 06:19
Author

升级20.6版本,系统崩溃,重装系统后,开机引导界面的字体太小了,怎么改一下。

Reply Favorite View the author
All Replies
来自Ubuntu的某位用户
deepin
2022-06-19 06:49
#1

可以降低GRUB的分辨率

Reply View the author
老咸鱼
deepin
2022-06-19 08:35
#2

查询自己的屏幕分辨率,一般是16.9或者16.10,根据比例降到1K

商店搜索grub,安装后可以图形界面调整

Reply View the author
Comments
堕天使
2022-06-19 18:13
我的本是3:2的,我去试试
lock
deepin
2023-01-12 23:31
#3

不知道你的问题解决了吗?这个会对你有帮助,刚刚成功。

调整grub字体大小
首先生成自定义大小的字体,在终端执行:

sudo grub-mkfont -v --output=/boot/grub/themes/deepin-fallback/DejaVuSansMono30.pf2 --size=30 /usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf

参数说明:
-v表示以verbose(冗长输出),--size表示字体大小,--output表示生成字体文件保存的路径(包括文件名称DejaVuSansMono24.pf2)
DejaVuSansMono.ttf字体的路径(这里是/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf)可能因系统不同而不同,如果不同,你可以在/usr/share/fonts下搜索该字体在那个目录,之后改成相应的路径

得到输出如下:
Font name: DejaVu Sans Mono Regular 30
Max width: 28
Max height: 36
Font ascent: 31
Font descent: 11
Number of glyph: 3452

DejaVu Sans Mono Regular 30就是需要用到的字体名
用文本编辑器打开/boot/grub/themes/deepin-fallback下的theme.txt文件,将terminal-font、item_font和font修改为DejaVu Sans Mono Regular 30,如下所示:

#version:17
#lang:zh_CN.UTF-8
#themeInputDir:/usr/share/dde-api/data/grub-themes/deepin-fallback
#head end
title-text: ""
desktop-image: "background.jpg"
desktop-color: "#000000"
terminal-font: "DejaVu Sans Mono Regular 30"
terminal-box: "terminal_box_*.png"
terminal-left: "0"
terminal-top: "0"
terminal-width: "100%"
terminal-height: "100%"
terminal-border: "0"

  • boot_menu {
    left = 15%
    top = 20%
    width = 70%
    height = 60%
    item_font = "DejaVu Sans Mono Regular 30"
    item_color = "#cccccc"
    selected_item_color = "#0099ff"
    item_height = 24
    item_spacing = 12
    selected_item_pixmap_style = "select_.png"
    scrollbar_thumb = "scrollbar_thumb_
    .png"
    scrollbar_width = 6
    menu_pixmap_style = "menu_*.png"
    }
  • label {
    left = 0
    top = 97%
    width = 100%
    align = "center"
    id = "timeout"
    color = "#99E53E"
    font = "DejaVu Sans Mono Regular 30"
    text = "在 %d 秒内启动"
    }
  • label {
    left = 0
    top = 94%
    width = 100%
    align = "center"
    color = "#99E53E"
    font = "Unifont Regular 16"
    text = "使用 ↑ 和 ↓ 键移动选择条,Enter 键确认,E 键编辑启动命令,C 键进入命令行"
    }

更新grub配置文件
在终端执行:
sudo update-grub

可自行更换支持中文的字体,不然对中文无效

原作者:burglar
链接:https://www.jianshu.com/p/d8963538bcd9
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

Reply View the author