* bug#3081: 23.0.92; x-list-fonts no longer gives correct result - substitutes * for fixed font size @ 2009-04-22 17:03 Drew Adams 2009-04-22 17:36 ` bug#3081: 23.0.92; x-list-fonts no longer gives correct result - substitutes * forfixed " Drew Adams 2009-04-23 2:07 ` bug#3081: 23.0.92; x-list-fonts no longer gives correct result - substitutes * for fixed " Kenichi Handa 0 siblings, 2 replies; 6+ messages in thread From: Drew Adams @ 2009-04-22 17:03 UTC (permalink / raw) To: emacs-pretest-bug 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)' ^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#3081: 23.0.92; x-list-fonts no longer gives correct result - substitutes * forfixed font size 2009-04-22 17:03 bug#3081: 23.0.92; x-list-fonts no longer gives correct result - substitutes * for fixed font size Drew Adams @ 2009-04-22 17:36 ` Drew Adams 2009-04-23 2:07 ` bug#3081: 23.0.92; x-list-fonts no longer gives correct result - substitutes * for fixed " Kenichi Handa 1 sibling, 0 replies; 6+ messages in thread From: Drew Adams @ 2009-04-22 17:36 UTC (permalink / raw) To: 3081, emacs-pretest-bug 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. ^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#3081: 23.0.92; x-list-fonts no longer gives correct result - substitutes * for fixed font size 2009-04-22 17:03 bug#3081: 23.0.92; x-list-fonts no longer gives correct result - substitutes * for fixed font size Drew Adams 2009-04-22 17:36 ` bug#3081: 23.0.92; x-list-fonts no longer gives correct result - substitutes * forfixed " Drew Adams @ 2009-04-23 2:07 ` Kenichi Handa 2009-04-23 5:01 ` bug#3081: 23.0.92; x-list-fonts no longer gives correct result - substitutes * forfixed " Drew Adams 1 sibling, 1 reply; 6+ messages in thread From: Kenichi Handa @ 2009-04-23 2:07 UTC (permalink / raw) To: Drew Adams, 3081 In article <000b01c9c36c$460c3820$c2b22382@us.oracle.com>, "Drew Adams" <drew.adams@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@m17n.org ^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#3081: 23.0.92; x-list-fonts no longer gives correct result - substitutes * forfixed font size 2009-04-23 2:07 ` bug#3081: 23.0.92; x-list-fonts no longer gives correct result - substitutes * for fixed " Kenichi Handa @ 2009-04-23 5:01 ` Drew Adams 2009-04-23 11:26 ` Kenichi Handa 0 siblings, 1 reply; 6+ messages in thread From: Drew Adams @ 2009-04-23 5:01 UTC (permalink / raw) To: 'Kenichi Handa', 3081 > > 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#3081: 23.0.92; x-list-fonts no longer gives correct result - substitutes * forfixed font size 2009-04-23 5:01 ` bug#3081: 23.0.92; x-list-fonts no longer gives correct result - substitutes * forfixed " Drew Adams @ 2009-04-23 11:26 ` Kenichi Handa 2009-04-23 13:58 ` Drew Adams 0 siblings, 1 reply; 6+ messages in thread From: Kenichi Handa @ 2009-04-23 11:26 UTC (permalink / raw) To: Drew Adams; +Cc: 3081 In article <003001c9c3d0$9a15bea0$0200a8c0@us.oracle.com>, "Drew Adams" <drew.adams@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@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@m17n.org ^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#3081: 23.0.92; x-list-fonts no longer gives correct result - substitutes * forfixed font size 2009-04-23 11:26 ` Kenichi Handa @ 2009-04-23 13:58 ` Drew Adams 0 siblings, 0 replies; 6+ messages in thread From: Drew Adams @ 2009-04-23 13:58 UTC (permalink / raw) To: 'Kenichi Handa'; +Cc: 3081 > > > 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. ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-04-23 13:58 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-04-22 17:03 bug#3081: 23.0.92; x-list-fonts no longer gives correct result - substitutes * for fixed font size Drew Adams 2009-04-22 17:36 ` bug#3081: 23.0.92; x-list-fonts no longer gives correct result - substitutes * forfixed " Drew Adams 2009-04-23 2:07 ` bug#3081: 23.0.92; x-list-fonts no longer gives correct result - substitutes * for fixed " Kenichi Handa 2009-04-23 5:01 ` bug#3081: 23.0.92; x-list-fonts no longer gives correct result - substitutes * forfixed " Drew Adams 2009-04-23 11:26 ` Kenichi Handa 2009-04-23 13:58 ` Drew Adams
Code repositories for project(s) associated with this public inbox https://git.savannah.gnu.org/cgit/emacs.git This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).