GNU bug report logs -
#3081
23.0.92; x-list-fonts no longer gives correct result - substitutes * for fixed font size
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 3081 in the body.
You can then email your comments to 3081 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3081
; Package
emacs
.
(Wed, 22 Apr 2009 17:10:05 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
"Drew Adams" <drew.adams <at> oracle.com>
:
New bug report received and forwarded. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Wed, 22 Apr 2009 17:10:05 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):
I have this defcustom, which I use to choose a small font:
(defcustom palette-font
(and window-system
(or (car (x-list-fonts
"-*-Courier-*-*-*-*-5-*-*-*-*-*-iso8859-1" nil nil 1)) ; 1
(car (x-list-fonts "-*-fixed-*-*-*-*-5-*-*-*-*-*-iso8859-1"
nil nil 1)) ; 2
(car (x-list-fonts
"-*-Terminal-*-*-*-*-5-*-*-*-*-*-iso8859-1" nil nil 1)) ; 3
(car (x-list-fonts "-*-*-*-*-*-*-5-*-*-*-*-*-iso8859-1" nil
nil 1)))) ;4
"...")
[Ignore the fact that perhaps (display-graphic-p) should be used in
place of window-system.]
In Emacs 23, the x-list-fonts sexps return these values (in MS
Windows XP with the fonts I have on my laptop):
1. ("-outline-Courier-normal-i-normal-normal-5-37-96-96-c-*-iso8859-1")
2. nil
3. nil
4. ("-outline-Souvenir Lt
BT-normal-i-normal-normal-5-37-96-96-p-*-iso8859-1")
In Emacs 23, these are the values:
1. ("-outline-Courier-bold-normal-normal-mono-*-*-*-*-c-*-iso8859-1")
2. nil
3. nil
4. ("-outline-Lucida Sans
Typewriter-bold-normal-normal-sans-*-*-*-*-c-*-iso8859-1")
The first difference to notice is #4: a completely different font
family is used. Why should this be? Anyway, I don't really have a
problem with this.
The problem is that the font size is not correct: * instead of a real
font size. The whole point of this defcustom is to try to find a
default value for the option that provides a tiny font that the user
has available. It tries to match various fonts of size 5, until it
finds a match.
In Emacs 23, this size info seems to be ignored, and the generic * is
used. That has the result of using a very large font (for this
application, which needs a tiny font). Which defeats the purpose of
the defcustom.
In GNU Emacs 23.0.92.1 (i386-mingw-nt5.1.2600)
of 2009-03-30 on SOFT-MJASON
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4)'
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3081
; Package
emacs
.
(Wed, 22 Apr 2009 17:45:03 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
"Drew Adams" <drew.adams <at> oracle.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Wed, 22 Apr 2009 17:45:03 GMT)
Full text and
rfc822 format available.
Message #10 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):
Some more info.
In the frames that use this font as their default font, I see these differences:
Emacs 22:
(font . "-outline-Courier-normal-i-normal-normal-5-37-96-96-c-*-iso8859-1")
Emacs 23:
(font . "-outline-Courier-bold-normal-normal-mono-14-*-*-*-c-*-iso8859-1")
(font-parameter . "-*-Lucida Console-normal-r-*-*-14-112-96-96-c-*-iso8859-1")
(font-backend uniscribe gdi)
Dunno if that helps you figure out the problem. The frame's font size (height)
in Emacs 22 is 5, as defined by my user option `palette-font' (that's the whole
point of the option).
The font size in Emacs 23 is 14. Perhaps that came indirectly from
`default-frame-alist' somehow? The `font' parameter in `default-frame-alist' is
this (in both Emacs 22 and 23):
(font . "-*-Lucida Console-normal-r-*-*-14-112-96-96-c-*-iso8859-1")
This behavior is in any case completely wrong. My code explicitly sets the
`font' frame parameter to the value of `palette-font' (using
`modify-frame-parameters'). But in Emacs 23 that value incorrectly has a *, not
a 5, for the font height.
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3081
; Package
emacs
.
(Wed, 22 Apr 2009 17:45:04 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
"Drew Adams" <drew.adams <at> oracle.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Wed, 22 Apr 2009 17:45:04 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3081
; Package
emacs
.
(Thu, 23 Apr 2009 02:15:03 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Kenichi Handa <handa <at> m17n.org>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Thu, 23 Apr 2009 02:15:03 GMT)
Full text and
rfc822 format available.
Message #20 received at 3081 <at> emacsbugs.donarmstrong.com (full text, mbox):
In article <000b01c9c36c$460c3820$c2b22382 <at> us.oracle.com>, "Drew Adams" <drew.adams <at> oracle.com> writes:
> I have this defcustom, which I use to choose a small font:
> (defcustom palette-font
> (and window-system
> (or (car (x-list-fonts
> "-*-Courier-*-*-*-*-5-*-*-*-*-*-iso8859-1" nil nil 1)) ; 1
> (car (x-list-fonts "-*-fixed-*-*-*-*-5-*-*-*-*-*-iso8859-1"
> nil nil 1)) ; 2
> (car (x-list-fonts
> "-*-Terminal-*-*-*-*-5-*-*-*-*-*-iso8859-1" nil nil 1)) ; 3
> (car (x-list-fonts "-*-*-*-*-*-*-5-*-*-*-*-*-iso8859-1" nil
> nil 1)))) ;4
> "...")
[...]
> In Emacs 23, these are the values:
> 1. ("-outline-Courier-bold-normal-normal-mono-*-*-*-*-c-*-iso8859-1")
> 2. nil
> 3. nil
> 4. ("-outline-Lucida Sans
> Typewriter-bold-normal-normal-sans-*-*-*-*-c-*-iso8859-1")
> The first difference to notice is #4: a completely different font
> family is used. Why should this be? Anyway, I don't really have a
> problem with this.
If you don't specify a family, which family is selected is
completely arbitrary.
> The problem is that the font size is not correct: * instead of a real
> font size. The whole point of this defcustom is to try to find a
> default value for the option that provides a tiny font that the user
> has available. It tries to match various fonts of size 5, until it
> finds a match.
I installed a fix. Please try again.
---
Kenichi Handa
handa <at> m17n.org
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3081
; Package
emacs
.
(Thu, 23 Apr 2009 05:10:03 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
"Drew Adams" <drew.adams <at> oracle.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Thu, 23 Apr 2009 05:10:03 GMT)
Full text and
rfc822 format available.
Message #25 received at 3081 <at> emacsbugs.donarmstrong.com (full text, mbox):
> > I have this defcustom, which I use to choose a small font:
> > (defcustom palette-font
> > (and window-system
> > (or (car (x-list-fonts
> > "-*-Courier-*-*-*-*-5-*-*-*-*-*-iso8859-1" nil nil 1)) ; 1
> > (car (x-list-fonts
> "-*-fixed-*-*-*-*-5-*-*-*-*-*-iso8859-1"
> > nil nil 1)) ; 2
> > (car (x-list-fonts
> > "-*-Terminal-*-*-*-*-5-*-*-*-*-*-iso8859-1" nil nil 1)) ; 3
> > (car (x-list-fonts
> "-*-*-*-*-*-*-5-*-*-*-*-*-iso8859-1" nil
> > nil 1)))) ;4
> > "...")
> [...]
> > In Emacs 23, these are the values:
>
> > 1.
> ("-outline-Courier-bold-normal-normal-mono-*-*-*-*-c-*-iso8859-1")
> > 2. nil
> > 3. nil
> > 4. ("-outline-Lucida Sans
> > Typewriter-bold-normal-normal-sans-*-*-*-*-c-*-iso8859-1")
>
> > The first difference to notice is #4: a completely different font
> > family is used. Why should this be? Anyway, I don't really have a
> > problem with this.
>
> If you don't specify a family, which family is selected is
> completely arbitrary.
I guess you're speaking about #2 and #3 - the nil values. That's OK. (And thanks
for the explanation.)
> > The problem is that the font size is not correct: * instead
> > of a real font size. The whole point of this defcustom is to try to find a
> > default value for the option that provides a tiny font that the user
> > has available. It tries to match various fonts of size 5, until it
> > finds a match.
>
> I installed a fix. Please try again.
Thanks for the quick fix.
What do I need to pick up, to try it? Is this a Lisp fix (which library)?
If not, I don't build Emacs, so I'll just take your word for it, and I'll check
it in the next MS Windows binary that I can get hold of.
Thx - Drew
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3081
; Package
emacs
.
(Thu, 23 Apr 2009 11:35:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Kenichi Handa <handa <at> m17n.org>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Thu, 23 Apr 2009 11:35:02 GMT)
Full text and
rfc822 format available.
Message #30 received at 3081 <at> emacsbugs.donarmstrong.com (full text, mbox):
In article <003001c9c3d0$9a15bea0$0200a8c0 <at> us.oracle.com>, "Drew Adams" <drew.adams <at> oracle.com> writes:
> > > I have this defcustom, which I use to choose a small font:
> > > (defcustom palette-font
> > > (and window-system
> > > (or (car (x-list-fonts
> > > "-*-Courier-*-*-*-*-5-*-*-*-*-*-iso8859-1" nil nil 1)) ; 1
> > > (car (x-list-fonts
> > "-*-fixed-*-*-*-*-5-*-*-*-*-*-iso8859-1"
> > > nil nil 1)) ; 2
> > > (car (x-list-fonts
> > > "-*-Terminal-*-*-*-*-5-*-*-*-*-*-iso8859-1" nil nil 1)) ; 3
> > > (car (x-list-fonts
> > "-*-*-*-*-*-*-5-*-*-*-*-*-iso8859-1" nil
> > > nil 1)))) ;4
> > > "...")
> > [...]
> > > In Emacs 23, these are the values:
> >
> > > 1.
> > ("-outline-Courier-bold-normal-normal-mono-*-*-*-*-c-*-iso8859-1")
> > > 2. nil
> > > 3. nil
> > > 4. ("-outline-Lucida Sans
> > > Typewriter-bold-normal-normal-sans-*-*-*-*-c-*-iso8859-1")
> >
> > > The first difference to notice is #4: a completely different font
> > > family is used. Why should this be? Anyway, I don't really have a
> > > problem with this.
> >
> > If you don't specify a family, which family is selected is
> > completely arbitrary.
> I guess you're speaking about #2 and #3 - the nil values. That's OK. (And thanks
> for the explanation.)
No, I'm speaking about #4. In #2 and #3 you specify family
name ("fixed" and "terminal" respectively).
> > > The problem is that the font size is not correct: * instead
> > > of a real font size. The whole point of this defcustom is to try to find a
> > > default value for the option that provides a tiny font that the user
> > > has available. It tries to match various fonts of size 5, until it
> > > finds a match.
> >
> > I installed a fix. Please try again.
> Thanks for the quick fix.
> What do I need to pick up, to try it? Is this a Lisp fix (which library)?
No, the change was in src/xfaces.c.
2009-04-23 Kenichi Handa <handa <at> m17n.org>
* xfaces.c (Fx_list_fonts): If a font size is specified in
PATTERN, set it in returned scalable fonts.
Index: xfaces.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/xfaces.c,v
retrieving revision 1.432
retrieving revision 1.433
diff -u -r1.432 -r1.433
--- xfaces.c 16 Apr 2009 01:08:24 -0000 1.432
+++ xfaces.c 23 Apr 2009 01:33:33 -0000 1.433
@@ -1904,7 +1904,22 @@
}
args[0] = Flist_fonts (font_spec, frame, maximum, font_spec);
for (tail = args[0]; CONSP (tail); tail = XCDR (tail))
- XSETCAR (tail, Ffont_xlfd_name (XCAR (tail), Qnil));
+ {
+ Lisp_Object font_entity;
+
+ font_entity = XCAR (tail);
+ if ((NILP (AREF (font_entity, FONT_SIZE_INDEX))
+ || XINT (AREF (font_entity, FONT_SIZE_INDEX)) == 0)
+ && ! NILP (AREF (font_spec, FONT_SIZE_INDEX)))
+ {
+ /* This is a scalable font. For backward compatibility,
+ we set the specified size. */
+ font_entity = Fcopy_font_spec (font_entity);
+ ASET (font_entity, FONT_SIZE_INDEX,
+ AREF (font_spec, FONT_SIZE_INDEX));
+ }
+ XSETCAR (tail, Ffont_xlfd_name (font_entity, Qnil));
+ }
if (NILP (frame))
/* We don't have to check fontsets. */
return args[0];
---
Kenichi Handa
handa <at> m17n.org
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3081
; Package
emacs
.
(Thu, 23 Apr 2009 14:05:05 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
"Drew Adams" <drew.adams <at> oracle.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Thu, 23 Apr 2009 14:05:05 GMT)
Full text and
rfc822 format available.
Message #35 received at 3081 <at> emacsbugs.donarmstrong.com (full text, mbox):
> > > If you don't specify a family, which family is selected is
> > > completely arbitrary.
>
> > I guess you're speaking about #2 and #3 - the nil values.
> > That's OK. (And thanks for the explanation.)
>
> No, I'm speaking about #4. In #2 and #3 you specify family
> name ("fixed" and "terminal" respectively).
Oh, right. That's OK too.
> + /* This is a scalable font. For backward compatibility,
> + we set the specified size. */
It's not important, but I disagree a bit with that characterization. This is not
just for backward compatibility. If you provide size in the input pattern, then
it should be taken into account, regardless of the Emacs version (going backward
or forward). Same thing with other input fields - they need to be matched and
retained.
I mention this because that comment might lead someone to believe at some point
that this was no longer needed.
Thx.
bug closed, send any further explanations to "Drew Adams" <drew.adams <at> oracle.com>
Request was from
Chong Yidong <cyd <at> stupidchicken.com>
to
control <at> emacsbugs.donarmstrong.com
.
(Sat, 25 Apr 2009 01:40:06 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> emacsbugs.donarmstrong.com
.
(Sun, 24 May 2009 14:24:09 GMT)
Full text and
rfc822 format available.
This bug report was last modified 16 years and 30 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.