emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Emacs-unicode-2: w32_font_match


From: KOBAYASHI Yasuhiro
Subject: Emacs-unicode-2: w32_font_match
Date: Tue, 02 Nov 2004 15:09:58 +0900
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (i386-mingw-nt5.1.2600)

It seems that w32_font_match() dose't work correctly in the
case of using font name with multibyte in emacs-unicode-2.

The variable 'encoded_font_name' may include the charactor
'-', then 'xlfd_strip_height (font_name_copy)' return -1, so
I think that string_make_unibyte should not be used.

For example:
(create-fontset-from-fontset-spec
 "-*-Courier New-normal-r-*-*-12-*-*-*-c-*-fontset-TTG12c,
 japanese-jisx0208:-*-MS ゴシック-*-*-*-*-*-*-*-*-*-*-jisx0208-sjis,
 latin-jisx0201:-*-MS ゴシック-*-*-*-*-*-*-*-*-*-*-jisx0208-sjis,
 katakana-jisx0201:-*-MS ゴシック-*-*-*-*-*-*-*-*-*-*-jisx0208-sjis" t)

(gdb) b  w32_font_match
Breakpoint 4, w32_font_match (fontname=0x83e020 "-outline-?ュ?ウ 
綵202エ綵202キ綵203\203綵202ッ-normal-r-normal-normal-12-90-96-96-c-*-jisx0208-sjis", 
pattern=0x2dcc9b0 
"-outline-hgp藹211オ鐔213ア隗\222?コ?\236?シ?ッ?クub-normal-r-normal-normal-12-*-96-96-p-*-jisx0208-sjis")
 at w32fns.c:5809
(gdb) p encoded_font_name 
$3 = 35884144
(gdb) xstring 
$4 = (struct Lisp_String *) 0x2238c70
"-outline--3 エキテッ-normal-r-normal-normal-12-90-96-96-c-*-jisx0208-sjis"

The attached patch use fast_string_match for comparing
font names, just like

2004-10-18  Kenichi Handa  <address@hidden>

        * fontset.c (fs_load_font): Use fast_string_match_ignore_case for
        comparing font names.
        (fs_query_fontset): Use fast_string_match for comparing fontset names.
        (list_fontsets): Likewise.

        * search.c (fast_string_match_ignore_case): New function.

        * lisp.h (fast_string_match_ignore_case): Extern it.


-- 
KOBAYASHI Yasuhiro <address@hidden>

Attachment: w32fns.c.diff
Description: w32fns.c


reply via email to

[Prev in Thread] Current Thread [Next in Thread]