unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Default font has size 12pixels when requested 13pixels
@ 2008-02-15 20:48 Stefan Monnier
  2008-02-15 21:40 ` Jason Rumney
  2008-02-18 18:30 ` Stefan Monnier
  0 siblings, 2 replies; 10+ messages in thread
From: Stefan Monnier @ 2008-02-15 20:48 UTC (permalink / raw)
  To: emacs-devel


My default font is specified via X resources:

Emacs.font:     -misc-fixed-medium-r-semicondensed--13-*-*-*-*-*-*-*

yet with the new font-backend, I get the 12-pixel version of that font
(which happens to be a *lot* smaller).

I'm trying to track down what's going on, but am having some trouble.
I see the point-size of my faces going from 99 (corresponding to the
desired 13 pixels) to 91 (corresponding to 12 pixels) at some point, but
still can't quite figure out where that happens.

I run Emacs, placing a breakpoint on realize_default_face, and the
second call to that function seems to be the culprit.

One troubling spot comes up as follows: during this second call, when
the function calls font_find_object (around xfaces.c:7469) I see that
the returned frame_font has the following content:

   (gdb) p frame_font
   $182 = {
     i = 1754152016, 
     s = {
       val = 143539280, 
       type = Lisp_Misc
     }, 
     u = {
       val = 143539280, 
       type = Lisp_Misc
     }
   }
   (gdb) xsavevalue 
   $183 = (struct Lisp_Save_Value *) 0x88e3c50
   (gdb) p *$183
   $184 = {
     type = Lisp_Misc_Save_Value, 
     gcmarkbit = 0, 
     spacer = 0, 
     dogc = 0, 
     pointer = 0x9191a20, 
     integer = 1
   }
   (gdb) p *(struct font*)$183->pointer
   $185 = {
     font = {
       font = 0x9191080, 
       font_idx = 152641048, 
       name = 0x9191e20 "-misc-fixed-medium-r-semicondensed--*-*-75-75-c-60-koi8-r", 
       full_name = 0x9194b80 "-Misc-Fixed-Medium-R-SemiCondensed--12-110-75-75-C-60-KOI8-R", 
       charset = 73, 
       size = 6, 
       height = 12, 
       space_width = 6, 
       average_width = 6, 
       vertical_centering = 0, 
       encoding_type = 128 '\200', 
       baseline_offset = 0, 
       relative_compose = 0, 
       default_ascent = 0, 
       font_encoder = 0x40
     }, 
     entity = {
       i = 2831330056, 
       s = {
         val = 146975496, 
         type = Lisp_Vectorlike
       }, 
       u = {
         val = 146975496, 
         type = Lisp_Vectorlike
       }
     }, 
     pixel_size = 13, 
     driver = 0x8891f60, 
     format = {
       i = 1217384936, 
       s = {
         val = 143643112, 
         type = Lisp_Symbol
       }, 
       u = {
         val = 143643112, 
         type = Lisp_Symbol
       }
     }, 
     file_name = 0x0, 
     encoding_charset = 73, 
     repertory_charset = 73, 
     min_width = 6, 
     ascent = 10, 
     descent = 2, 
     scalable = 0
   }
   (gdb) 

Of course I have no idea where this
"-Misc-Fixed-Medium-R-SemiCondensed--12-110-75-75-C-60-KOI8-R", and
interestingly this "struct font" says both that its height is 12
(presumably pixels) and that it has pixel size 13.

Can anybody give me a hand here?


        Stefan




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Default font has size 12pixels when requested 13pixels
  2008-02-15 20:48 Default font has size 12pixels when requested 13pixels Stefan Monnier
@ 2008-02-15 21:40 ` Jason Rumney
  2008-02-16  0:42   ` Glenn Morris
  2008-02-18 18:30 ` Stefan Monnier
  1 sibling, 1 reply; 10+ messages in thread
From: Jason Rumney @ 2008-02-15 21:40 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier wrote:
> My default font is specified via X resources:
>
> Emacs.font:     -misc-fixed-medium-r-semicondensed--13-*-*-*-*-*-*-*
>
> yet with the new font-backend, I get the 12-pixel version of that font
> (which happens to be a *lot* smaller).
>
> I'm trying to track down what's going on, but am having some trouble.
> I see the point-size of my faces going from 99 (corresponding to the
> desired 13 pixels) to 91 (corresponding to 12 pixels) at some point, but
> still can't quite figure out where that happens.
>   
This sounds similar to the problem I was having a couple of weeks back, 
which I tracked to some changes to font.c installed on the 
emacs-unicode-2 branch between 2008-01-22 and 2008-01-25 to fix the 
problems being discussed with the subject "Unicode-2 crash by 
set-face-font". One of the fixes was to stop using a previously created 
font->font_object, and instead recreate the font using font->full_name. 
On Windows, the full names were not parsable by the font creation code, 
so the size was being lost in that recreation. 12 pixels is hard-coded 
somewhere in font.c as a fallback size.

Although in your case, it looks like the full_name is being filled in a 
format that Emacs can parse, I suspect it may still be the same code 
that is causing the problem.







^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Default font has size 12pixels when requested 13pixels
  2008-02-15 21:40 ` Jason Rumney
@ 2008-02-16  0:42   ` Glenn Morris
  0 siblings, 0 replies; 10+ messages in thread
From: Glenn Morris @ 2008-02-16  0:42 UTC (permalink / raw)
  To: Jason Rumney; +Cc: Stefan Monnier, emacs-devel

Jason Rumney wrote:

> Stefan Monnier wrote:
>> My default font is specified via X resources:
>>
>> Emacs.font:     -misc-fixed-medium-r-semicondensed--13-*-*-*-*-*-*-*
>>
>> yet with the new font-backend, I get the 12-pixel version of that font
>> (which happens to be a *lot* smaller).
[...]
> This sounds similar to the problem I was having a couple of weeks back, 

It also sounds like my problem:

http://lists.gnu.org/archive/html/emacs-devel/2008-02/msg00314.html

which still occurs, with or without font-backend. I seem to be getting
the right font, but also always in size 12.




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Default font has size 12pixels when requested 13pixels
  2008-02-15 20:48 Default font has size 12pixels when requested 13pixels Stefan Monnier
  2008-02-15 21:40 ` Jason Rumney
@ 2008-02-18 18:30 ` Stefan Monnier
  2008-02-19  8:04   ` Kenichi Handa
  1 sibling, 1 reply; 10+ messages in thread
From: Stefan Monnier @ 2008-02-18 18:30 UTC (permalink / raw)
  To: emacs-devel

> My default font is specified via X resources:

> Emacs.font:     -misc-fixed-medium-r-semicondensed--13-*-*-*-*-*-*-*

> yet with the new font-backend, I get the 12-pixel version of that font
> (which happens to be a *lot* smaller).

I believe I've tracked it down to a thinko/typo fixed by the patch below,


        Stefan


Index: src/font.c
===================================================================
RCS file: /sources/emacs/emacs/src/font.c,v
retrieving revision 1.6
diff -u -r1.6 font.c
--- src/font.c	17 Feb 2008 02:03:58 -0000	1.6
+++ src/font.c	18 Feb 2008 18:29:40 -0000
@@ -1167,7 +1167,8 @@
 	len += sprintf (f[XLFD_PIXEL_INDEX], "%d-*", i) + 1;
       else if (pixel_size > 0)
 	len += sprintf (f[XLFD_PIXEL_INDEX], "%d-*", pixel_size) + 1;
-      f[XLFD_PIXEL_INDEX] = "*-*", len += 4;
+      else
+	f[XLFD_PIXEL_INDEX] = "*-*", len += 4;
     }
   else if (FLOATP (val))
     {




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Default font has size 12pixels when requested 13pixels
  2008-02-18 18:30 ` Stefan Monnier
@ 2008-02-19  8:04   ` Kenichi Handa
  2008-02-19  9:19     ` Jason Rumney
  2008-02-19 20:00     ` Glenn Morris
  0 siblings, 2 replies; 10+ messages in thread
From: Kenichi Handa @ 2008-02-19  8:04 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

In article <jwvskzqdsr1.fsf-monnier+emacs@gnu.org>, Stefan Monnier <monnier@iro.umontreal.ca> writes:

> > My default font is specified via X resources:
> > Emacs.font:     -misc-fixed-medium-r-semicondensed--13-*-*-*-*-*-*-*

> > yet with the new font-backend, I get the 12-pixel version of that font
> > (which happens to be a *lot* smaller).

> I believe I've tracked it down to a thinko/typo fixed by the patch below,

Thank you for fixing my silly bug!

Glenn Morris <rgm@gnu.org> writes:

> Jason Rumney wrote:

> > Stefan Monnier wrote:
>>> My default font is specified via X resources:
>>> 
>>> Emacs.font:     -misc-fixed-medium-r-semicondensed--13-*-*-*-*-*-*-*
>>> 
>>> yet with the new font-backend, I get the 12-pixel version of that font
>>> (which happens to be a *lot* smaller).
> [...]
> > This sounds similar to the problem I was having a couple of weeks back, 

> It also sounds like my problem:

> http://lists.gnu.org/archive/html/emacs-devel/2008-02/msg00314.html

> which still occurs, with or without font-backend. I seem to be getting
> the right font, but also always in size 12.

Are these problems fixed too?

---
Kenichi Handa
handa@ni.aist.go.jp




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Default font has size 12pixels when requested 13pixels
  2008-02-19  8:04   ` Kenichi Handa
@ 2008-02-19  9:19     ` Jason Rumney
  2008-02-19 12:48       ` Kenichi Handa
  2008-02-19 20:00     ` Glenn Morris
  1 sibling, 1 reply; 10+ messages in thread
From: Jason Rumney @ 2008-02-19  9:19 UTC (permalink / raw)
  To: Kenichi Handa; +Cc: Stefan Monnier, emacs-devel

Kenichi Handa wrote:
>> Jason Rumney wrote:
>>     
>>> This sounds similar to the problem I was having a couple of weeks back, 
>>>       
> Are these problems fixed too?
>   
The bug on Windows is fixed, though I'm not sure that the fix of 
encoding the size into font->full_name is the best one, since the font 
is already open - why do we need to convert it to a string 
representation and reopen it?





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Default font has size 12pixels when requested 13pixels
  2008-02-19  9:19     ` Jason Rumney
@ 2008-02-19 12:48       ` Kenichi Handa
  0 siblings, 0 replies; 10+ messages in thread
From: Kenichi Handa @ 2008-02-19 12:48 UTC (permalink / raw)
  To: Jason Rumney; +Cc: monnier, emacs-devel

In article <47BA9F0C.2000808@gnu.org>, Jason Rumney <jasonr@gnu.org> writes:

> Kenichi Handa wrote:
>>> Jason Rumney wrote:
>>> 
>>>> This sounds similar to the problem I was having a couple of weeks back, 
>>>> 
> > Are these problems fixed too?
> >   
> The bug on Windows is fixed, though I'm not sure that the fix of 
> encoding the size into font->full_name is the best one, since the font 
> is already open - why do we need to convert it to a string 
> representation and reopen it?

I don't remember well but there's a place that expect a
fontname string in the case of --diable-font-backend.  I
think we can get rid of this inefficency when font-backend
is forced (and the legacy font-handling codes are deleted).

---
Kenichi Handa
handa@ni.aist.go.jp




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Default font has size 12pixels when requested 13pixels
  2008-02-19  8:04   ` Kenichi Handa
  2008-02-19  9:19     ` Jason Rumney
@ 2008-02-19 20:00     ` Glenn Morris
  2008-02-19 22:51       ` Jason Rumney
  1 sibling, 1 reply; 10+ messages in thread
From: Glenn Morris @ 2008-02-19 20:00 UTC (permalink / raw)
  To: Kenichi Handa; +Cc: Stefan Monnier, emacs-devel

Kenichi Handa wrote:

>> It also sounds like my problem:
>
>> http://lists.gnu.org/archive/html/emacs-devel/2008-02/msg00314.html
>
>> which still occurs, with or without font-backend. I seem to be getting
>> the right font, but also always in size 12.
>
> Are these problems fixed too?

With or without font-backend, this probem still occurs.




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Default font has size 12pixels when requested 13pixels
  2008-02-19 20:00     ` Glenn Morris
@ 2008-02-19 22:51       ` Jason Rumney
  2008-02-19 22:53         ` Glenn Morris
  0 siblings, 1 reply; 10+ messages in thread
From: Jason Rumney @ 2008-02-19 22:51 UTC (permalink / raw)
  To: Glenn Morris; +Cc: emacs-devel, Stefan Monnier, Kenichi Handa

Glenn Morris wrote:
> With or without font-backend, this probem still occurs.
>   

Is that after Stefan's patch?





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Default font has size 12pixels when requested 13pixels
  2008-02-19 22:51       ` Jason Rumney
@ 2008-02-19 22:53         ` Glenn Morris
  0 siblings, 0 replies; 10+ messages in thread
From: Glenn Morris @ 2008-02-19 22:53 UTC (permalink / raw)
  To: Jason Rumney; +Cc: emacs-devel, Stefan Monnier, Kenichi Handa

Jason Rumney wrote:

> Is that after Stefan's patch?

Yes.




^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-02-19 22:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-15 20:48 Default font has size 12pixels when requested 13pixels Stefan Monnier
2008-02-15 21:40 ` Jason Rumney
2008-02-16  0:42   ` Glenn Morris
2008-02-18 18:30 ` Stefan Monnier
2008-02-19  8:04   ` Kenichi Handa
2008-02-19  9:19     ` Jason Rumney
2008-02-19 12:48       ` Kenichi Handa
2008-02-19 20:00     ` Glenn Morris
2008-02-19 22:51       ` Jason Rumney
2008-02-19 22:53         ` Glenn Morris

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).