all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#8046: [PATCH] Incorrect font selection in fontconfig driver
@ 2011-02-15 18:40 Kostya Stopani
  2011-08-07 20:48 ` Chong Yidong
  0 siblings, 1 reply; 2+ messages in thread
From: Kostya Stopani @ 2011-02-15 18:40 UTC (permalink / raw)
  To: 8046


[-- Attachment #1.1: Type: text/plain, Size: 2158 bytes --]

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;

  	       

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 1.txt --]
[-- Type: text/plain; charset=utf-8, Size: 34 bytes --]

-*- coding: koi8-r -*-
abc
ÁÂ×

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#8046: [PATCH] Incorrect font selection in fontconfig driver
  2011-02-15 18:40 bug#8046: [PATCH] Incorrect font selection in fontconfig driver Kostya Stopani
@ 2011-08-07 20:48 ` Chong Yidong
  0 siblings, 0 replies; 2+ messages in thread
From: Chong Yidong @ 2011-08-07 20:48 UTC (permalink / raw)
  To: Kenichi Handa; +Cc: 8046, Kostya Stopani

Handa-san, could you evaluate this proposed change?  Thanks.


Kostya Stopani <hatta@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;





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-08-07 20:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-15 18:40 bug#8046: [PATCH] Incorrect font selection in fontconfig driver Kostya Stopani
2011-08-07 20:48 ` Chong Yidong

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.