From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sun Yijiang Newsgroups: gmane.emacs.devel Subject: Re: Problem with chinese gbk fonts on w32 Date: Tue, 6 Sep 2005 16:13:06 +0800 Message-ID: <5065e29005090601131862788e@mail.gmail.com> References: <5065e29005073119317520578d@mail.gmail.com> <5065e29005080101382635f42d@mail.gmail.com> <5065e2900509060043650bbe97@mail.gmail.com> <431D4CA2.9080201@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0149006015==" X-Trace: sea.gmane.org 1125996895 20602 80.91.229.2 (6 Sep 2005 08:54:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 6 Sep 2005 08:54:55 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 06 10:54:53 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ECZDV-0001BU-Sg for ged-emacs-devel@m.gmane.org; Tue, 06 Sep 2005 10:54:10 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ECZHz-00080x-Gf for ged-emacs-devel@m.gmane.org; Tue, 06 Sep 2005 04:58:47 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ECYuc-0007rx-UB for emacs-devel@gnu.org; Tue, 06 Sep 2005 04:34:39 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ECYrc-0007Xg-Uj for emacs-devel@gnu.org; Tue, 06 Sep 2005 04:33:34 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ECYoG-0006tW-5w for emacs-devel@gnu.org; Tue, 06 Sep 2005 04:28:05 -0400 Original-Received: from [64.233.184.204] (helo=wproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1ECYdi-0008Vi-Mi for emacs-devel@gnu.org; Tue, 06 Sep 2005 04:17:10 -0400 Original-Received: by wproxy.gmail.com with SMTP id i5so1171099wra for ; Tue, 06 Sep 2005 01:13:06 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=hdSXhQ+zlTv7oK5xK06oPUNuesQfx2GJrQj+ktqpIH+j2tt0BNzuMIn+JOD3xKYzzRVCKXzGgnQkvDpfmeAxEMzMMurCBmnazVMlgWD6ZHWZxYo0bA+lqHokGhy6MnHz0t1/p2Osx/Vfcf4xZ0WkCFKOh1cHLGZSD5aX+pGW+Gw= Original-Received: by 10.54.3.79 with SMTP id 79mr4687454wrc; Tue, 06 Sep 2005 01:13:06 -0700 (PDT) Original-Received: by 10.54.91.8 with HTTP; Tue, 6 Sep 2005 01:13:06 -0700 (PDT) Original-To: Jason Rumney In-Reply-To: <431D4CA2.9080201@gnu.org> X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:42648 Archived-At: --===============0149006015== Content-Type: multipart/alternative; boundary="----=_Part_36287_2678439.1125994386419" ------=_Part_36287_2678439.1125994386419 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I think I did not describe the problem properly. The problem is: 1) Only on W32 platform. 2) Has nothing to do with GBK. The problem arises together with=20 create-fontset-from-fontset-spec, no matter I use GBK or GB2312. The patch works indeed. In fact, "font->tm.tmMaxCharWidth" is double of=20 "font->tm.tmAveCharWidth", I think that's where the problem is. 2005/9/6, Jason Rumney : >=20 > Sun Yijiang wrote: >=20 > > I think I've found the problem, here is the patch of w32fns.c (against > > revision 1.256). I don't know the detail, but this patch works. > > > >=20 > --------------------------------------8<---------------------------------= ----- > > --- w32fns.c 2005-08-08 09:45:47.000000000 +0800 > > +++ w32fns-fix.c 2005-09-06 15:32:01.275812264 +0800 > > @@ -4545,7 +4545,7 @@ > > /* Fill out details in lf according to the font that was > > actually loaded. */ > > lf.lfHeight =3D font->tm.tmInternalLeading - font->tm.tmHeight; > > - lf.lfWidth =3D font->tm.tmMaxCharWidth; > > + lf.lfWidth =3D font->tm.tmAveCharWidth; > > lf.lfWeight =3D font->tm.tmWeight; > > lf.lfItalic =3D font->tm.tmItalic; > > lf.lfCharSet =3D font->tm.tmCharSet; > >=20 > --------------------------------------8<---------------------------------= ----- >=20 > How can this work? >=20 > The problem you reported was for BDF fonts used to display the GBK > character sets. > The fix above affects only Windows system fonts. >=20 > ------=_Part_36287_2678439.1125994386419 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I think I did not describe the problem properly. The problem is:
1) Only on W32 platform.
2) Has nothing to do with GBK. The problem arises together with create-font= set-from-fontset-spec, no matter I use GBK or GB2312.

The patch works indeed. In fact, "font->tm.tmMaxCharWidth" is = double of "font->tm.tmAveCharWidth", I think that's where the problem= is.

2005/9/6, Jason Rumney <jasonr@gnu.org>:
Sun Yijiang wrote:

> I think I've found the problem, here is the = patch of w32fns.c (against
> revision 1.256). I don't know the detail= , but this patch works.
>
> -----------------------------------= ---8<--------------------------------------
> --- w32fns.c    2005-08-08 09:45:47.000000000 = +0800
> +++ w32fns-fix.c    2005-09-06 15:32:01.2= 75812264 +0800
> @@ -4545,7 +4545,7 @@
>    = ;      /* Fill out details in lf according to= the font that was
>           &= nbsp; actually loaded.  */
>     &= nbsp;    lf.lfHeight =3D font->tm.tmInternalLeading - font->tm.tmHeight;
> - &n= bsp;      lf.lfWidth =3D font->tm.tmMaxCha= rWidth;
> +        lf.lfWidth= =3D font->tm.tmAveCharWidth;
>      = ;    lf.lfWeight =3D font->tm.tmWeight ;
>          lf.lfI= talic =3D font->tm.tmItalic;
>      =     lf.lfCharSet =3D font->tm.tmCharSet;
> ---= -----------------------------------8<-----------------------------------= ---

How can this work?

The problem you reported was for BDF fonts used to display the GBK<= br>character sets.
The fix above affects only Windows system fonts.
<= br>

------=_Part_36287_2678439.1125994386419-- --===============0149006015== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --===============0149006015==--