From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1W79UH-0005TG-Cb for mharc-grub-devel@gnu.org; Sat, 25 Jan 2014 15:05:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43830) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W79U7-0005SE-H1 for grub-devel@gnu.org; Sat, 25 Jan 2014 15:05:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W79Tz-0006q7-1Z for grub-devel@gnu.org; Sat, 25 Jan 2014 15:05:43 -0500 Received: from mail-la0-x234.google.com ([2a00:1450:4010:c03::234]:37433) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W79Ty-0006q2-Kf for grub-devel@gnu.org; Sat, 25 Jan 2014 15:05:34 -0500 Received: by mail-la0-f52.google.com with SMTP id c6so3470192lan.39 for ; Sat, 25 Jan 2014 12:05:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:in-reply-to:references:mime-version :content-type; bh=cpcjrULBfOvFBHGDH/yR3XITXvAN49sxXGOa7iep/U8=; b=gAZiR+mqpaZUq4fTFlKU9lK9aFC7b/TLmz36kmgN9ZEBgaUqPYFbcPof8Jid+4XHtT m03VqGJMONP0/UqqB9hoa9FvEl01ui/oWnqHa05cDaq6bakqZncZKQD9Ckx7zwJWxYS1 yEOSiYSVIvvysZXg7XATNpH859kETpXHidkoTyFeJ6HTJF/Y9MJOLWmLwXcKeI5A9o+v wxbMHTP5NqjlOlPRyz8Kf8/Su6bu3InvwpKzMKJGtlOqKxkC7h669/Z6BWJ0yknad93I G+UCYHiJF9HbpSfgk5bw+M4kpOCnDyaGlUAaRJHxhK8EN+7flIuWOJygH17up6a5o1CT yhOA== X-Received: by 10.112.150.100 with SMTP id uh4mr12481492lbb.3.1390680333417; Sat, 25 Jan 2014 12:05:33 -0800 (PST) Received: from opensuse.site (ppp91-76-154-95.pppoe.mtu-net.ru. [91.76.154.95]) by mx.google.com with ESMTPSA id qx1sm5843457lbb.15.2014.01.25.12.05.32 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Sat, 25 Jan 2014 12:05:32 -0800 (PST) Date: Sun, 26 Jan 2014 00:05:31 +0400 From: Andrey Borzenkov To: grub-devel@gnu.org Subject: Re: [PATCH] Improve DejaVuSans detection Message-ID: <20140126000531.2d6d1686@opensuse.site> In-Reply-To: <52DEFFDC.40607@gmail.com> References: <1389528954-24812-1-git-send-email-arvidjaar@gmail.com> <1390060691-9862-1-git-send-email-arvidjaar@gmail.com> <52DE25E1.3030006@gmail.com> <20140121201619.0b577a81@opensuse.site> <52DEFFDC.40607@gmail.com> X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.22; x86_64-suse-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/4rHrXQWnqo1ZpTe8fZLGy+w"; protocol="application/pgp-signature" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::234 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jan 2014 20:05:52 -0000 --Sig_/4rHrXQWnqo1ZpTe8fZLGy+w Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable =D0=92 Wed, 22 Jan 2014 00:16:44 +0100 Vladimir '=CF=86-coder/phcoder' Serbinenko =D0=BF=D0=B8= =D1=88=D0=B5=D1=82: > On 21.01.2014 17:16, Andrey Borzenkov wrote: > > Yes, I realized that. The problem is, unifont may be missing (user is > > free to override it with GRUB_FONT) > If user overrides our fonts and gets ugly display it's his fault. You > can assume unifont availability. >=20 Yes, but as we have just seen I cannot be sure about font *name*. The patch below makes it return the very first loaded font which in normal case is Unifont. So removing explicit font from starfield will result in loading unifont but won't depend on particular font name. From: Andrey Borzenkov Subject: [PATCH] Do not set explicit font in starfield theme DejaVuSans is proportional and looks bad in terminal window. DejaVuSansMono also results in suboptimal display. Unifont is better but apparently font name may be different on different distributions. So simply delete explicit font name for terminal window; this will cause the very first font to be lo= aded and normally the very first font is Unifont. --- grub-core/font/font.c | 12 +++++++----- themes/starfield/theme.txt | 1 - 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/grub-core/font/font.c b/grub-core/font/font.c index 14b93e1..9e92e1f 100644 --- a/grub-core/font/font.c +++ b/grub-core/font/font.c @@ -861,18 +861,20 @@ grub_font_t grub_font_get (const char *font_name) { struct grub_font_node *node; + struct grub_font_node *last_node =3D NULL; =20 - for (node =3D grub_font_list; node; node =3D node->next) + for (node =3D grub_font_list; node; last_node =3D node, node =3D node->n= ext) { grub_font_t font =3D node->value; if (grub_strcmp (font->name, font_name) =3D=3D 0) return font; } =20 - /* If no font by that name is found, return the first font in the list - as a fallback. */ - if (grub_font_list && grub_font_list->value) - return grub_font_list->value; + /* If no font by that name is found, return the last font in the list + as a fallback. Last font is the one loaded first which is Unifont in + standard grub.cfg */ + if (last_node && last_node->value) + return last_node->value; else /* The null_font is a last resort. */ return &null_font; diff --git a/themes/starfield/theme.txt b/themes/starfield/theme.txt index 5ec871b..cea799b 100644 --- a/themes/starfield/theme.txt +++ b/themes/starfield/theme.txt @@ -25,7 +25,6 @@ message-font: "DejaVu Sans Regular 12" message-color: "#000" message-bg-color: "#fff" terminal-box: "terminal_box_*.png" -terminal-font: "DejaVu Sans Regular 12" desktop-image: "starfield.png" =20 #help bar at the bottom --=20 tg: (5ae584c..) u/dejavu-path (depends on: master) --Sig_/4rHrXQWnqo1ZpTe8fZLGy+w Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iEYEARECAAYFAlLkGQsACgkQR6LMutpd94wLigCdG6LmIczsl203rDWPmcfVYBDS RTwAnR/wLP2TCH+suD7C8mk+CSEvgcWz =KOIx -----END PGP SIGNATURE----- --Sig_/4rHrXQWnqo1ZpTe8fZLGy+w--