From: srs5694 Date: Fri, 25 Jan 2013 01:25:51 +0000 (-0500) Subject: Fonts. X-Git-Url: https://code.delx.au/refind/commitdiff_plain/5e1253402aca85205fcb7d72a589fe0e1f6cdd05?hp=b8bc7202102818ae3fbda911bac51e2d56a9bc17 Fonts. --- diff --git a/fonts/README.txt b/fonts/README.txt new file mode 100644 index 0000000..bcafc42 --- /dev/null +++ b/fonts/README.txt @@ -0,0 +1,49 @@ +This directory contains PNGs built from a couple of open source fonts: the +sans serif Liberation Mono Regular and the serif Luxi Mono Regular, in 12-, +14, and 24-point versions. All of these font files have anti-aliasing (aka +font smoothing) applied. The directory also includes the original rEFInd +font, which is a 12-point un-smoothed Times-like font. + +If you want to create your own fonts, you can do so. If you're using Linux, +the mkfont.sh script will convert an installed MONOSPACE font into a +suitable format. You can use it like this: + +./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: + +font liberation-mono-italic-14.png + +The mkfont.sh script takes four arguments: + +- 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. + +- 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. + +- 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 program display as a gray-and-white checkered background. + +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 be in PNG format (the +BMP format doesn't support an alpha layer, which is required for proper +transparency). They 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 area 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. In practice, this is likely +to be tedious. + diff --git a/fonts/damaged.png b/fonts/damaged.png new file mode 100644 index 0000000..e3efcfb Binary files /dev/null and b/fonts/damaged.png differ diff --git a/fonts/liberation-mono-regular-12.png b/fonts/liberation-mono-regular-12.png new file mode 100644 index 0000000..ed02b60 Binary files /dev/null and b/fonts/liberation-mono-regular-12.png differ diff --git a/fonts/liberation-mono-regular-14.png b/fonts/liberation-mono-regular-14.png new file mode 100644 index 0000000..47c1dba Binary files /dev/null and b/fonts/liberation-mono-regular-14.png differ diff --git a/fonts/liberation-mono-regular-24.png b/fonts/liberation-mono-regular-24.png new file mode 100644 index 0000000..7abd266 Binary files /dev/null and b/fonts/liberation-mono-regular-24.png differ diff --git a/fonts/luxi-mono-regular-12.png b/fonts/luxi-mono-regular-12.png new file mode 100644 index 0000000..dcd0cc9 Binary files /dev/null and b/fonts/luxi-mono-regular-12.png differ diff --git a/fonts/luxi-mono-regular-14.png b/fonts/luxi-mono-regular-14.png new file mode 100644 index 0000000..4a6cc31 Binary files /dev/null and b/fonts/luxi-mono-regular-14.png differ diff --git a/fonts/luxi-mono-regular-24.png b/fonts/luxi-mono-regular-24.png new file mode 100644 index 0000000..2c2b11e Binary files /dev/null and b/fonts/luxi-mono-regular-24.png differ diff --git a/fonts/mkfont.sh b/fonts/mkfont.sh new file mode 100755 index 0000000..2f035e5 --- /dev/null +++ b/fonts/mkfont.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# +# Program to generate a PNG file suitable for use as a rEFInd font +# To obtain a list of available font names, type: +# +# convert -list font | less +# +# The font used MUST be a monospaced font; searching for the string +# "Mono" will turn up most suitable candidates. +# +# Usage: +# ./mkfont.sh font-name font-size font-Y-offset bitmap-filename.png +# +# This script is part of the rEFInd package. Version numbers refer to +# the rEFInd version with which the script was released. +# +# Version history: +# +# 0.6.6 - Initial release + +if [[ $# != 4 ]] ; then + echo "Usage: $0 font-name font-size y-offset bitmap-filename.png" + echo " font-name: Name of font (use 'convert -list font | less' to get list)" + echo " NOTE: Font MUST be monospaced!" + echo " font-size: Font size in points" + echo " y-offset: pixels font is shifted (may be negative)" + echo " bitmap-filename.png: output filename" + echo "" + exit 1 +fi + +Convert=`which convert 2> /dev/null` +if [[ ! -x $Convert ]] ; then + echo "The 'convert' program is required but could not be found. It's part of the" + echo "ImagMagick program, usually installed in the 'imagemagick' package." + echo "" + exit 1 +fi + +Height=$2 +let CellWidth=(${Height}*6+5)/10 +let Width=${CellWidth}*96 +echo "Creating ${Width}x${Height} font bitmap...." +$Convert -size ${Width}x${Height} xc:transparent -gravity NorthWest -font $1 -pointsize $2 \ + -draw "text 0,$3 ' !\"#\$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~?'" $4 diff --git a/fonts/original-refind.png b/fonts/original-refind.png new file mode 100644 index 0000000..d768641 Binary files /dev/null and b/fonts/original-refind.png differ