|
Fonts
字体
rEFInd's default font is a 14-point (12-point in 0.6.5 and earlier) serif monospaced font. I also include a handful of alternatives in the fonts subdirectory. rEFInd's font support is extremely rudimentary, though; it reads an image file that holds the glyphs from ASCII 32 (space) through ASCII 126 (tilde, ~), plus a glyph that's displayed for all characters outside of this range. Thus, rEFInd can't currently display non-ASCII characters or use proportional (variable-width) fonts. You can change the font from one monospaced font to another and change the font size, though.
rEFInd的默认字体是14点(0.6.5及更早版本为12点)衬线等宽字体。我还在字体子目录中包含了一些替代品。不过,rEFInd的字体支持非常初级;它读取一个图像文件,该文件包含从ASCII 32(空格)到ASCII 126(波浪号,~)的字形,以及为该范围之外的所有字符显示的字形。因此,rEFInd当前无法显示非ASCII字符或使用比例(可变宽度)字体。不过,您可以将字体从一种等宽字体更改为另一种,并更改字体大小。
If you want to create your own fonts, you can do so. If you're using Linux, the mkfont.sh script in the fonts subdirectory will convert an installed monospace font into a suitable format. (This script works properly for most fonts, but if a font is unusually thin or wide, you will have to adjust the let CellWidth= line near the end of the file.) You can use it like this:
如果你想创建自己的字体,你可以这样做。如果你使用的是Linux,字体子目录中的mkfont.sh脚本会将安装的等宽字体转换为合适的格式。(此脚本适用于大多数字体,但如果字体异常细或宽,则必须调整文件末尾附近的let CellWidth=行。)您可以这样使用它:
$ ./mkfont.sh Liberation-Mono-Italic 14 -1 liberation-mono-italic-14.png
The result is a PNG file, liberation-mono-italic-14.png, that you can copy to your rEFInd directory and load with the font token in refind.conf, as in:
得到一个PNG文件,liberation-mono-italic-14.5png,您可以将其复制到rEFInd目录中,并在rEFInd.conf中加载字体标记,如下所示:
font liberation-mono-italic-14.png
The mkfont.sh script takes four arguments:
mkfont.sh脚本接受四个参数:
The font name—Type convert -list font | less to obtain a list of fonts available on your computer. Note, however, that rEFInd requires monospaced (fixed-width) fonts, and most of the fonts installed on most computers are variable-width.
字体名称--Type convert(转换类型)-list font(字体列表) | 计算机上能获取的可用字体很少。注意,rEFInd需要等宽字体,大多数计算机上安装的字体都是可变宽度的。
The font size in points
字体大小(以点为单位)
A y offset—Many fonts require an adjustment up (negative values), or occasionally down (positive values) to fit in the PNG image area. You'll have to use trial and error to get this to work.
y偏移——许多字体需要向上调整(负值),或偶尔向下调整(正值)以适应PNG图像区域。你必须通过反复试验才能使其发挥作用。
The output filename
输出文件名
I recommend checking the PNG file in a graphics program like eog before using it. Note that the font files should have an alpha layer, which many graphics programs display as a gray-and-white checkered background. This requirement, combined with ICNS's limited set of supported sizes, makes PNG the only practical file format for rEFInd fonts.
我建议在使用之前,使用eog这样的图形程序检查PNG文件。注意,字体文件应该有一个alpha层,许多图形程序将其显示为灰色和白色的格子背景。这一要求,再加上ICNS支持的大小限制,使PNG成为rEFInd字体的唯一实用文件格式。
If you're not using Linux, or if you want to use some other method of generating fonts, you can do so. The font files must contain glyphs for the 95 characters between ASCII 32 (space) and ASCII 126 (tilde, ~), inclusive, plus a 96th glyph that rEFInd displays for out-of-range characters. To work properly, the characters must be evenly spaced and the PNG image must be a multiple of 96 pixels wide, with divisions at appropriate points. In theory, you should be able to take a screen shot of a program displaying the relevant characters and then crop it to suit your needs and convert the background color to transparency. In practice, this is likely to be tedious.
如果你没有使用Linux,或者你想使用其他方法生成字体,你可以这样做。字体文件必须包含ASCII 32(空格)和ASCII 126(波浪号,~)之间的95个字符的字形,包括首尾两个字符,以及rEFInd为超出范围的字符显示的第96个字形。为了正常工作,字符必须间隔均匀,PNG图像必须是96像素宽的倍数,并在适当的点上进行分割。理论上,您应该能够拍摄显示相关字符的程序的屏幕截图,然后根据需要进行裁剪,并将背景颜色转换为透明。在实践中,这可能会很乏味。 |
|