GNU bug report logs - #8046
[PATCH] Incorrect font selection in fontconfig driver

Previous Next

Package: emacs;

Reported by: Kostya Stopani <hatta <at> depni.sinp.msu.ru>

Date: Tue, 15 Feb 2011 18:32:01 UTC

Severity: normal

Tags: patch

Merged with 10193

Fixed in version 24.0.93

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 8046 in the body.
You can then email your comments to 8046 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8046; Package emacs. (Tue, 15 Feb 2011 18:32:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kostya Stopani <hatta <at> depni.sinp.msu.ru>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 15 Feb 2011 18:32:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Kostya Stopani <hatta <at> depni.sinp.msu.ru>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Incorrect font selection in fontconfig driver
Date: Tue, 15 Feb 2011 21:40:10 +0300
[Message part 1 (text/plain, inline)]
Attached file in koi8-r encoding displays incorrectly on Linux with
default DejaVu (from fontset-startup) and some other fonts (on
emacs-24.0.50.12). Cyrillic characters are rendered in oblique style
instead of normal. Here's a part of M-x font-show-log showing this:

default fontset: font for: 1057
ftfont-list: -unknown-DejaVu Sans Mono-*-k-koi8-r
  -unknown-DejaVu Sans Mono-bold-oblique-normal-*-m-0-isoso6060646-1
  -unknown-DejaVu Sans Mono-normal-oblique-normal-*-m-0-iso10646-1
  -unknown-DejaVu Sans Mono-bold-normal-normal-*-0soso101064646-1
xfont-list: -unknown-DejaVu Sans Mono-*-*-*-*-*-*-*-*-*-*-koi8-r
list: -unknown-DejaVu Sans Mono-*-k-koi8-r
  -unknown-DejaVu Sans Mono-bold-oblique-normal-*-m-0-isoso6060646-1
  -unknown-DejaVu Sans Mono-normal-oblique-normal-*-m-0-iso10646-1
  -unknown-DejaVu Sans Mono-bold-normal-normal-*-0soso101064646-1
sort-by: -*-normal-normal-normal-*-13-*
  xft:-unknown-DejaVu Sans Mono-normal-oblique-normal-*-m-0-iso10646-1
open: -unknown-DejaVu Sans Mono-normal-oblique-normal-*-m-0-iso10646-1
  xft:-unknown-DejaVu Sans Mono-normal-oblique-normal-*-13-*-m-0-iso10646-1



The reason is that ftfont_list function filters out fonts when its
langname parameter doesn't match font's adstyle property. But adstyle
really most of the time has neutral values like "Book" or
"Semicondensed". As far as I know it can contain language codes only
for PCF japanese and korean fonts (respectively "ja" and "ko"). A
patch to fix this behaviour is below.


* src/ftfont.c (ftfont_list): reject fonts using langname only if
adstyle is "ja" or "ko".


=== modified file 'src/ftfont.c'
*** src/ftfont.c	2011-02-05 22:30:14 +0000
--- src/ftfont.c	2011-02-15 18:13:28 +0000
*************** ftfont_list (Lisp_Object frame, Lisp_Obj
*** 1026,1031 ****
--- 1026,1032 ----
  				  SSDATA (SYMBOL_NAME (this_adstyle))) != 0))
  	    continue;
  	  if (langname
+ 	      && (xstrcasecmp (langname, "ja") == 0 || xstrcasecmp (langname, "ko") == 0)
  	      && ! NILP (this_adstyle)
  	      && xstrcasecmp (langname, SSDATA (SYMBOL_NAME (this_adstyle))))
  	    continue;

  	       
[1.txt (text/plain, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8046; Package emacs. (Sun, 07 Aug 2011 20:50:02 GMT) Full text and rfc822 format available.

Message #8 received at 8046 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Kenichi Handa <handa <at> m17n.org>
Cc: 8046 <at> debbugs.gnu.org, Kostya Stopani <hatta <at> depni.sinp.msu.ru>
Subject: Re: bug#8046: [PATCH] Incorrect font selection in fontconfig driver
Date: Sun, 07 Aug 2011 16:48:18 -0400
Handa-san, could you evaluate this proposed change?  Thanks.


Kostya Stopani <hatta <at> depni.sinp.msu.ru> writes:

> Attached file in koi8-r encoding displays incorrectly on Linux with
> default DejaVu (from fontset-startup) and some other fonts (on
> emacs-24.0.50.12). Cyrillic characters are rendered in oblique style
> instead of normal.
>
> The reason is that ftfont_list function filters out fonts when its
> langname parameter doesn't match font's adstyle property. But adstyle
> really most of the time has neutral values like "Book" or
> "Semicondensed". As far as I know it can contain language codes only
> for PCF japanese and korean fonts (respectively "ja" and "ko"). A
> patch to fix this behaviour is below.
>
> * src/ftfont.c (ftfont_list): reject fonts using langname only if
> adstyle is "ja" or "ko".
>
>
> === modified file 'src/ftfont.c'
> *** src/ftfont.c	2011-02-05 22:30:14 +0000
> --- src/ftfont.c	2011-02-15 18:13:28 +0000
> *************** ftfont_list (Lisp_Object frame, Lisp_Obj
> *** 1026,1031 ****
> --- 1026,1032 ----
>   				  SSDATA (SYMBOL_NAME (this_adstyle))) != 0))
>   	    continue;
>   	  if (langname
> + 	      && (xstrcasecmp (langname, "ja") == 0 || xstrcasecmp (langname, "ko") == 0)
>   	      && ! NILP (this_adstyle)
>   	      && xstrcasecmp (langname, SSDATA (SYMBOL_NAME (this_adstyle))))
>   	    continue;




Merged 8046 10193. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 02 Dec 2011 17:35:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 24.0.93, send any further explanations to 10193 <at> debbugs.gnu.org and Werner LEMBERG <wl <at> gnu.org> Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 06 Dec 2011 08:37:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 03 Jan 2012 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 189 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.