GNU bug report logs - #2667
23.0.91; Inconsistent fonts

Previous Next

Package: emacs;

Reported by: David Kastrup <dak <at> gnu.org>

Date: Fri, 13 Mar 2009 21:35:03 UTC

Severity: serious

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Kenichi Handa <handa <at> m17n.org>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: 2667 <at> debbugs.gnu.org, cyd <at> stupidchicken.com
Subject: bug#2667: Still seeing inconsistent fonts
Date: Thu, 21 May 2009 10:15:56 +0900
In article <jwvbppnefy5.fsf-monnier+emacsbugreports <at> gnu.org>, Stefan Monnier <monnier <at> IRO.UMontreal.CA> writes:

> > But, if we can use this heuristic:

> >    X fonts that have the same property values except for
> >    size related properties supports the same set of
> >    characters on all display.  For example, all these fonts 
[...]

> That assumption is obviously not guaranteed to hold, and I
> don't think it really holds in practice, but it looks like
> an acceptable tradeoff, since the cases where it doesn't
> hold shouldn't be too frequent.

So, you mean that we should install that change, right?

> > -static Lisp_Object xfont_list_pattern P_ ((Lisp_Object, Display *, char *));
> > +static int xfont_chars_supported P_ ((Lisp_Object, XFontStruct *,
> > +				      struct charset *, struct charset *));

> Please just use ANSI-style declarations rather than K&R in new code.

Ah, I didn't realize that we switched to ANSI-style.

> > +  /* Two special cases to avoid opening rather big fonts.  */
> > +  if (AREF (props, 2), Qja)
> > +    return Fcons (intern ("kana"), Fcons (intern ("han"), Qnil));
> > +  if (AREF (props, 2), Qko)
> > +    return Fcons (intern ("hangul"), Qnil);

> You need EQ (..) around those two tests.

Of course, sorry for the incorrect patch.

> > +  if (NILP (val))
> > +    script = Qnil;
> > +  else
> > +    script = XCDR (val);

> Aka: script = CDR (val);

Ok.  I didn't know CDR macro.

> > +  if (! repertory && NILP (xfont_scripts_cache))
> > +    {
> > +      Lisp_Object args[2];
> > +
> > +      args[0] = QCtest;
> > +      args[1] = Qequal;
> > +      xfont_scripts_cache = Fmake_hash_table (2, args);
> > +    }
> [...]
> > @@ -996,6 +1173,8 @@
> >  void
> >  syms_of_xfont ()
> >  {
> > +  staticpro (&xfont_scripts_cache);
> > +  xfont_scripts_cache = Qnil;
> >    xfont_driver.type = Qx;
> >    register_font_driver (&xfont_driver, NULL);
> >  }

> Why not just:

> @@ -996,6 +1173,8 @@
>  void
>  syms_of_xfont ()
>  {
> +  staticpro (&xfont_scripts_cache);
> +  {
> +    Lisp_Object args[2];
> +    args[0] = QCtest;
> +    args[1] = Qequal;
> +    xfont_scripts_cache = Fmake_hash_table (2, args);
> +  }
>    xfont_driver.type = Qx;
>    register_font_driver (&xfont_driver, NULL);
>  }

I usually hesitate using a Lisp symbol Qxxxx in syms_of_XXX
if I don't know where it is initialized, and wanted to avoid
increasing the temacs size where possible.

---
Kenichi Handa
handa <at> m17n.org




This bug report was last modified 16 years and 55 days ago.

Previous Next


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