all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: font-related hanging / general brokenness
       [not found] <buobq1ycd5c.fsf@dhapc248.dev.necel.com>
@ 2008-06-19  4:35 ` Miles Bader
  2008-06-19  4:52   ` Miles Bader
                     ` (2 more replies)
  2008-06-19  4:59 ` Kenichi Handa
  1 sibling, 3 replies; 22+ messages in thread
From: Miles Bader @ 2008-06-19  4:35 UTC (permalink / raw)
  To: Kenichi Handa; +Cc: Stefan Monnier, emacs-devel

[Did anyone besides Kenichi see my previous bug report?  I'm not seeing
it on gmane, and I wonder if some idiot spam-protection software has
deleted it (I used several attachements...).]

Ok, the infinite-looping seems to be caused by this change of Stefan's:

+2008-06-18  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* faces.el (face-set-after-frame-default): Don't exclude `default'.
+

After reverting that change, Emacs can start correctly using that .emacs.

However the font-selection brokenness described in my previous is still
present to some degree:

   (set-face-attribute 'default nil :family "Dejavu Sans Mono")

fails, but:

   (set-face-attribute 'default nil :family "Dejavu Sans Mono" :foundry "dejavu")

works, but uses the ugly non-antialiased verison of dejavu-sans-mono.

   (set-face-attribute 'default nil :family "Dejavu Sans Mono" :foundry "unknown")

also works, and uses the anti-aliased version of dejavu-sans-mono.

Is having a :foundry as a face-attribute really the right thing?  I
think users usually don't know or care about the foundry info, and its
presence as part of the face seems like it will cause the :family
attribute almost never work correctly (because a face which specifies
:family will almost always inherit an incorrect :foundry value from the
default face).

-Miles

-- 
Neighbor, n. One whom we are commanded to love as ourselves, and who does all
he knows how to make us disobedient.




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

* Re: font-related hanging / general brokenness
  2008-06-19  4:35 ` font-related hanging / general brokenness Miles Bader
@ 2008-06-19  4:52   ` Miles Bader
  2008-06-19  5:35   ` Kenichi Handa
  2008-06-19 14:23   ` Stefan Monnier
  2 siblings, 0 replies; 22+ messages in thread
From: Miles Bader @ 2008-06-19  4:52 UTC (permalink / raw)
  To: Kenichi Handa; +Cc: Stefan Monnier, emacs-devel

I wrote:
> Is having a :foundry as a face-attribute really the right thing?  I
> think users usually don't know or care about the foundry info, and its
> presence as part of the face seems like it will cause the :family
> attribute almost never work correctly (because a face which specifies
> :family will almost always inherit an incorrect :foundry value from the
> default face).

BTW, one possible way to make :foundry work better might be to be _very_
relaxed about matching with it:  First try matching including the face's
:foundry, and if that returns "no match", then try matching agains with
:foundy "*".

That would allow the user to specify a foundry for special cases where
it's desired -- probably almost always together with a family name --
but avoid the undesirable effects caused by inheriting a :foundry
attribute.

-Miles

-- 
(\(\
(^.^)
(")")
*This is the cute bunny virus, please copy this into your sig so it can spread.




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

* Re: font-related hanging / general brokenness
       [not found] <buobq1ycd5c.fsf@dhapc248.dev.necel.com>
  2008-06-19  4:35 ` font-related hanging / general brokenness Miles Bader
@ 2008-06-19  4:59 ` Kenichi Handa
  2008-06-19 21:49   ` Stefan Monnier
  1 sibling, 1 reply; 22+ messages in thread
From: Kenichi Handa @ 2008-06-19  4:59 UTC (permalink / raw)
  To: Miles Bader; +Cc: emacs-devel

In article <buobq1ycd5c.fsf@dhapc248.dev.necel.com>, Miles Bader <miles.bader@necel.com> writes:

> [1  <text/plain (7bit)>]
> Updating to the newest CVS Emacs, Emacs goes into an infinite-loop upon
> startup, with the following .emacs file (X resources are empty):

>    (custom-set-faces
>      ;; custom-set-faces was added by Custom.
>      ;; If you edit it by hand, you could mess it up, so be careful.
>      ;; Your init file should contain only one such instance.
>      ;; If there is more than one, they won't work right.
>     '(default ((t (:stipple nil :background "black" :foreground "white" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 90 :width normal :family "dejavu sans mono")))))

> A backtrace shows that it seems to be infinitely recursing in the hairy
> frame/face dance.

> Visually, I can see the Emacs frame continuously re-sizing, and the
> background color continously flipping between black and white.

I see this problem too, and is fixed when I revert this
change.

2008-06-18  Stefan Monnier  <monnier@iro.umontreal.ca>

	* faces.el (face-set-after-frame-default): Don't exclude `default'.

Index: faces.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/faces.el,v
retrieving revision 1.409
retrieving revision 1.410
diff -u -r1.409 -r1.410
--- faces.el	13 Jun 2008 02:04:37 -0000	1.409
+++ faces.el	18 Jun 2008 21:14:07 -0000	1.410
@@ -2045,7 +2045,10 @@
     ;; Initialize faces from face specs and X resources.  The
     ;; condition-case prevents invalid specs from causing frame
     ;; creation to fail.
-    (dolist (face (delq 'default (face-list)))
+    (dolist (face (face-list))
+      ;; This loop used to exclude the `default' face for an unknown reason.
+      ;; It lead to odd behaviors where face-spec settings on the `default'
+      ;; face weren't obeyed for new frame.
       (condition-case ()
 	  (progn
 	    (face-spec-recalc face frame)

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




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

* Re: font-related hanging / general brokenness
  2008-06-19  4:35 ` font-related hanging / general brokenness Miles Bader
  2008-06-19  4:52   ` Miles Bader
@ 2008-06-19  5:35   ` Kenichi Handa
  2008-06-19  5:41     ` Miles Bader
  2008-06-19 14:23   ` Stefan Monnier
  2 siblings, 1 reply; 22+ messages in thread
From: Kenichi Handa @ 2008-06-19  5:35 UTC (permalink / raw)
  To: Miles Bader; +Cc: monnier, emacs-devel

In article <buoy752avoo.fsf@dhapc248.dev.necel.com>, Miles Bader <miles.bader@necel.com> writes:

> However the font-selection brokenness described in my previous is still
> present to some degree:

>    (set-face-attribute 'default nil :family "Dejavu Sans Mono")

> fails, but:

I can't reproduce it.

After starting Emacs, please do:

  ESC : (setq font-log nil) RET
  ESC : (set-face-attribute 'default nil :family "Dejavu Sans Mono")
  M-x font-show-log RET

and show me the result.

>    (set-face-attribute 'default nil :family "Dejavu Sans Mono" :foundry "dejavu")

> works, but uses the ugly non-antialiased verison of dejavu-sans-mono.

>    (set-face-attribute 'default nil :family "Dejavu Sans Mono" :foundry "unknown")

> also works, and uses the anti-aliased version of dejavu-sans-mono.

It seems that you can use that font only via X font-backend.

> BTW, one possible way to make :foundry work better might be to be _very_
> relaxed about matching with it:  First try matching including the face's
> :foundry, and if that returns "no match", then try matching agains with
> :foundy "*".

The current code is doing that already (see
font_find_for_lface in font.c).  So, I think the reason why
(set-face-attribute 'default nil :family "Dejavu Sans Mono")
doesn't work for you is in the different place.

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






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

* Re: font-related hanging / general brokenness
  2008-06-19  5:35   ` Kenichi Handa
@ 2008-06-19  5:41     ` Miles Bader
  2008-06-19  5:55       ` Miles Bader
  2008-06-19  6:10       ` Kenichi Handa
  0 siblings, 2 replies; 22+ messages in thread
From: Miles Bader @ 2008-06-19  5:41 UTC (permalink / raw)
  To: Kenichi Handa; +Cc: monnier, emacs-devel

Kenichi Handa <handa@m17n.org> writes:
>>    (set-face-attribute 'default nil :family "Dejavu Sans Mono")
>> fails, but:
>
> After starting Emacs, please do:
>
>   ESC : (setq font-log nil) RET
>   ESC : (set-face-attribute 'default nil :family "Dejavu Sans Mono")
>   M-x font-show-log RET

Here it is:

xfont-list: -adobe-Dejavu Sans Mono-*-*-*-*-*-*-*-*-*-*-iso8859-1
ftfont-list: -adobe-Dejavu Sans Mono-*-iso8859-1
list: -adobe-Dejavu Sans Mono-medium-r-normal-*-iso8859-1
xfont-list: -adobe-Dejavu Sans Mono-*-*-*-*-*-*-*-*-*-*-ascii-0
ftfont-list: -adobe-Dejavu Sans Mono-*-ascii-0
list: -adobe-Dejavu Sans Mono-medium-r-normal-*-ascii-0
xfont-list: -*-Dejavu Sans Mono-*-*-*-*-*-*-*-*-*-*-iso8859-1
  -dejavu-dejavu sans mono-medium-r-normal--*-0-0-m-0-iso8859-1
  -dejavu-dejavu sans mono-medium-r-normal--*-0-0-c-0-iso8859-1
  -dejavu-dejavu sans mono-medium-o-normal--*-0-0-m-0-iso8859-1
  -dejavu-dejavu sans mono-medium-o-normal--*-0-0-c-0-iso8859-1
  -dejavu-dejavu sans mono-bold-r-normal--*-0-0-m-0-iso8859-1
  -dejavu-dejavu sans mono-bold-r-normal--*-0-0-c-0-iso8859-1
  -dejavu-dejavu sans mono-bold-o-normal--*-0-0-m-0-iso8859-1
  -dejavu-dejavu sans mono-bold-o-normal--*-0-0-c-0-iso8859-1
  -bitstream-dejavu sans mono-medium-r-normal--*-0-0-m-0-iso8859-1
  -bitstream-dejavu sans mono-medium-r-normal--*-0-0-c-0-iso8859-1
  -bitstream-dejavu sans mono-bold-o-normal--*-0-0-m-0-iso8859-1
  -bitstream-dejavu sans mono-bold-o-normal--*-0-0-c-0-iso8859-1
ftfont-list: -*-Dejavu Sans Mono-*-iso8859-1
  -unknown-DejaVu Sans Mono-bold-oblique-normal-*-m-0-iso8859-1
  -unknown-DejaVu Sans Mono-normal-normal-normal-*-m-0-iso8859-1
  -unknown-DejaVu Sans Mono-normal-oblique-normal-*-m-0-iso8859-1
  -unknown-DejaVu Sans Mono-bold-normal-normal-*-m-0-iso8859-1
list: -*-Dejavu Sans Mono-medium-r-normal-*-iso8859-1
  -bitstream-dejavu sans mono-medium-r-normal--*-0-0-c-0-iso8859-1
  -bitstream-dejavu sans mono-medium-r-normal--*-0-0-m-0-iso8859-1
  -dejavu-dejavu sans mono-medium-r-normal--*-0-0-c-0-iso8859-1
  -dejavu-dejavu sans mono-medium-r-normal--*-0-0-m-0-iso8859-1
  -unknown-DejaVu Sans Mono-normal-normal-normal-*-m-0-iso8859-1
sort-by: -*-Dejavu Sans Mono-medium-r-normal-*-16-*-iso8859-1
  x:-bitstream-dejavu sans mono-medium-r-normal--*-0-0-c-0-iso8859-1
open: -bitstream-dejavu sans mono-medium-r-normal--*-0-0-c-0-iso8859-1
list: -adobe-courier-*-r-normal--*-0-0-p-0-iso8859-1
  -adobe-courier-bold-r-normal--*-0-0-p-0-iso8859-1
  -adobe-courier-medium-r-normal--*-0-0-p-0-iso8859-1
sort-by: -adobe-courier-light-r-normal--16-*-0-0-p-0-iso8859-1
  x:-adobe-courier-medium-r-normal--*-0-0-p-0-iso8859-1
list: -adobe-courier-*-r-normal--*-0-0-p-0-iso8859-1
  -adobe-courier-bold-r-normal--*-0-0-p-0-iso8859-1
  -adobe-courier-medium-r-normal--*-0-0-p-0-iso8859-1
sort-by: -adobe-courier-bold-r-normal--16-*-0-0-p-0-iso8859-1
  x:-adobe-courier-bold-r-normal--*-0-0-p-0-iso8859-1
list: -adobe-courier-medium-*-normal--*-0-0-p-0-iso8859-1
  -adobe-courier-medium-i-normal--*-0-0-p-0-iso8859-1
  -adobe-courier-medium-o-normal--*-0-0-p-0-iso8859-1
  -adobe-courier-medium-r-normal--*-0-0-p-0-iso8859-1
sort-by: -adobe-courier-medium-italic-normal--16-*-0-0-p-0-iso8859-1
  x:-adobe-courier-medium-i-normal--*-0-0-p-0-iso8859-1


Thanks,

-Miles

-- 
Learning, n. The kind of ignorance distinguishing the studious.




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

* Re: font-related hanging / general brokenness
  2008-06-19  5:41     ` Miles Bader
@ 2008-06-19  5:55       ` Miles Bader
  2008-06-19  6:17         ` Kenichi Handa
  2008-06-19  6:10       ` Kenichi Handa
  1 sibling, 1 reply; 22+ messages in thread
From: Miles Bader @ 2008-06-19  5:55 UTC (permalink / raw)
  To: Kenichi Handa; +Cc: monnier, emacs-devel

BTW, despite the problems mentioned previously, font rendering
definitely looks better now:  Emacs seems to be correctly following
global fontconfig settings, which makes freetype-rendered fonts _much_
better looking in some cases.

[Before, Emacs seemed to completely ignore fontconfig settings for some
reason (unlike all other xft/freetype/fontconfig apps).]

-Miles

-- 
(\(\
(^.^)
(")")
*This is the cute bunny virus, please copy this into your sig so it can spread.




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

* Re: font-related hanging / general brokenness
  2008-06-19  5:41     ` Miles Bader
  2008-06-19  5:55       ` Miles Bader
@ 2008-06-19  6:10       ` Kenichi Handa
  2008-06-19  6:14         ` Miles Bader
  1 sibling, 1 reply; 22+ messages in thread
From: Kenichi Handa @ 2008-06-19  6:10 UTC (permalink / raw)
  To: Miles Bader; +Cc: monnier, emacs-devel

In article <buo4p7q7zin.fsf@dhapc248.dev.necel.com>, Miles Bader <miles.bader@necel.com> writes:

> > After starting Emacs, please do:
> >
> >   ESC : (setq font-log nil) RET
> >   ESC : (set-face-attribute 'default nil :family "Dejavu Sans Mono")
> >   M-x font-show-log RET

> Here it is:

> xfont-list: -adobe-Dejavu Sans Mono-*-*-*-*-*-*-*-*-*-*-iso8859-1
> ftfont-list: -adobe-Dejavu Sans Mono-*-iso8859-1
[...]
> sort-by: -*-Dejavu Sans Mono-medium-r-normal-*-16-*-iso8859-1
>   x:-bitstream-dejavu sans mono-medium-r-normal--*-0-0-c-0-iso8859-1
> open: -bitstream-dejavu sans mono-medium-r-normal--*-0-0-c-0-iso8859-1
> list: -adobe-courier-*-r-normal--*-0-0-p-0-iso8859-1

This is strange.  There's no record for the result of
"open".  So, it seems that opening

-bitstream-dejavu sans mono-medium-r-normal--*-0-0-c-0-iso8859-1

with pixelsize 16 failed even though that font is listed.
Please show me the result of:

% xfd -fn '-bitstream-dejavu sans mono-medium-r-normal--16-*-0-0-c-0-iso8859-1'

Which font is opened?

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




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

* Re: font-related hanging / general brokenness
  2008-06-19  6:10       ` Kenichi Handa
@ 2008-06-19  6:14         ` Miles Bader
  2008-06-19  6:19           ` Kenichi Handa
  0 siblings, 1 reply; 22+ messages in thread
From: Miles Bader @ 2008-06-19  6:14 UTC (permalink / raw)
  To: Kenichi Handa; +Cc: monnier, emacs-devel

Kenichi Handa <handa@m17n.org> writes:
> Please show me the result of:
>
> % xfd -fn '-bitstream-dejavu sans mono-medium-r-normal--16-*-0-0-c-0-iso8859-1'
>
> Which font is opened?

   $ xfd -fn '-bitstream-dejavu sans mono-medium-r-normal--16-*-0-0-c-0-iso8859-1'
   Warning: Cannot convert string "-bitstream-dejavu sans mono-medium-r-normal--16-*-0-0-c-0-iso8859-1" to type FontStruct
   xfd:  no font to display

Thanks,

-Miles

-- 
Ocean, n. A body of water covering seven-tenths of a world designed for Man -
who has no gills.




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

* Re: font-related hanging / general brokenness
  2008-06-19  5:55       ` Miles Bader
@ 2008-06-19  6:17         ` Kenichi Handa
  0 siblings, 0 replies; 22+ messages in thread
From: Kenichi Handa @ 2008-06-19  6:17 UTC (permalink / raw)
  To: Miles Bader; +Cc: monnier, emacs-devel

In article <buoy7526k9w.fsf@dhapc248.dev.necel.com>, Miles Bader <miles.bader@necel.com> writes:

> BTW, despite the problems mentioned previously, font rendering
> definitely looks better now:  Emacs seems to be correctly following
> global fontconfig settings, which makes freetype-rendered fonts _much_
> better looking in some cases.

> [Before, Emacs seemed to completely ignore fontconfig settings for some
> reason (unlike all other xft/freetype/fontconfig apps).]

Perhaps it's because of this change:

	* xftfont.c
[...]
	(xftfont_open): Call XftFontMatch.

I still don't know why that makes change, but while reading
the source code of Xft, I found that Xft implements
XftFontOpen, XftFontOpenName, XftFontOpenXlfd by calling
XftFontMatch before calling XftFontOpenPattern.

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




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

* Re: font-related hanging / general brokenness
  2008-06-19  6:14         ` Miles Bader
@ 2008-06-19  6:19           ` Kenichi Handa
  2008-06-19  6:26             ` Miles Bader
  0 siblings, 1 reply; 22+ messages in thread
From: Kenichi Handa @ 2008-06-19  6:19 UTC (permalink / raw)
  To: Miles Bader; +Cc: monnier, emacs-devel

In article <buok5gmx86q.fsf@dhapc248.dev.necel.com>, Miles Bader <miles.bader@necel.com> writes:

>    $ xfd -fn '-bitstream-dejavu sans mono-medium-r-normal--16-*-0-0-c-0-iso8859-1'
>    Warning: Cannot convert string "-bitstream-dejavu sans mono-medium-r-normal--16-*-0-0-c-0-iso8859-1" to type FontStruct
>    xfd:  no font to display

?!?!  Then what is the result of:

% xlsfonts -fn '-bitstream-dejavu sans mono-medium-r-normal--16-*-0-0-c-0-iso8859-1'

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




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

* Re: font-related hanging / general brokenness
  2008-06-19  6:19           ` Kenichi Handa
@ 2008-06-19  6:26             ` Miles Bader
  2008-06-19  6:44               ` Kenichi Handa
  0 siblings, 1 reply; 22+ messages in thread
From: Miles Bader @ 2008-06-19  6:26 UTC (permalink / raw)
  To: Kenichi Handa; +Cc: monnier, emacs-devel

Kenichi Handa <handa@m17n.org> writes:
>>    $ xfd -fn '-bitstream-dejavu sans mono-medium-r-normal--16-*-0-0-c-0-iso8859-1'
>>    Warning: Cannot convert string "-bitstream-dejavu sans mono-medium-r-normal--16-*-0-0-c-0-iso8859-1" to type FontStruct
>>    xfd:  no font to display
>
> ?!?!  Then what is the result of:
>
> % xlsfonts -fn '-bitstream-dejavu sans mono-medium-r-normal--16-*-0-0-c-0-iso8859-1'

$ xlsfonts -fn '-bitstream-dejavu sans mono-medium-r-normal--16-*-0-0-c-0-iso8859-1'
-bitstream-dejavu sans mono-medium-r-normal--16-0-0-0-c-0-iso8859-1

-Miles

-- 
Success, n. The one unpardonable sin against one's fellows.




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

* Re: font-related hanging / general brokenness
  2008-06-19  6:26             ` Miles Bader
@ 2008-06-19  6:44               ` Kenichi Handa
  2008-06-19  6:58                 ` Miles Bader
  2008-06-19  7:28                 ` Miles Bader
  0 siblings, 2 replies; 22+ messages in thread
From: Kenichi Handa @ 2008-06-19  6:44 UTC (permalink / raw)
  To: Miles Bader; +Cc: monnier, emacs-devel

In article <buoej6ux7n4.fsf@dhapc248.dev.necel.com>, Miles Bader <miles.bader@necel.com> writes:

>>> $ xfd -fn '-bitstream-dejavu sans mono-medium-r-normal--16-*-0-0-c-0-iso8859-1'
>>> Warning: Cannot convert string "-bitstream-dejavu sans mono-medium-r-normal--16-*-0-0-c-0-iso8859-1" to type FontStruct
>>> xfd:  no font to display
> >
> > ?!?!  Then what is the result of:
> >
> > % xlsfonts -fn '-bitstream-dejavu sans mono-medium-r-normal--16-*-0-0-c-0-iso8859-1'

> $ xlsfonts -fn '-bitstream-dejavu sans mono-medium-r-normal--16-*-0-0-c-0-iso8859-1'
> -bitstream-dejavu sans mono-medium-r-normal--16-0-0-0-c-0-iso8859-1

Weird.

It seems that your X, perhaps the module supporting TTF, has
a bug.  I don't know an easy workaround for such a problem.
Checking each font if it is surely openable or not in the
font-selection routine is too much costly.  Changing the
order of font drivers from x,xft to xft,x will solve
(actually just hide) the problem.  But, why don't you remove
such unusable fonts from your X font path?

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




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

* Re: font-related hanging / general brokenness
  2008-06-19  6:44               ` Kenichi Handa
@ 2008-06-19  6:58                 ` Miles Bader
  2008-06-19  7:44                   ` Kenichi Handa
  2008-06-19  7:28                 ` Miles Bader
  1 sibling, 1 reply; 22+ messages in thread
From: Miles Bader @ 2008-06-19  6:58 UTC (permalink / raw)
  To: Kenichi Handa; +Cc: monnier, emacs-devel

Kenichi Handa <handa@m17n.org> writes:
>> > % xlsfonts -fn '-bitstream-dejavu sans mono-medium-r-normal--16-*-0-0-c-0-iso8859-1'
>
>> $ xlsfonts -fn '-bitstream-dejavu sans mono-medium-r-normal--16-*-0-0-c-0-iso8859-1'
>> -bitstream-dejavu sans mono-medium-r-normal--16-0-0-0-c-0-iso8859-1
>
> Weird.
>
> It seems that your X, perhaps the module supporting TTF, has
> a bug.  I don't know an easy workaround for such a problem.
> Checking each font if it is surely openable or not in the
> font-selection routine is too much costly.  Changing the
> order of font drivers from x,xft to xft,x will solve
> (actually just hide) the problem.  But, why don't you remove
> such unusable fonts from your X font path?

Well... perhaps it is an X bug, but it's a standard debian installation
AFAIK.  If I'm having problems, I expect many more people will as well.

If use the `-l' option to xlsfonts, btw, it _doesn't_ show the bogus entry:

$ xlsfonts -fn '-*-dejavu sans mono-medium-r-normal--16-*-0-0-c-0-iso8859-1'
-bitstream-dejavu sans mono-medium-r-normal--16-0-0-0-c-0-iso8859-1
-dejavu-dejavu sans mono-medium-r-normal--16-0-0-0-c-0-iso8859-1

$ xlsfonts -l -fn '-*-dejavu sans mono-medium-r-normal--16-*-0-0-c-0-iso8859-1'
DIR  MIN  MAX EXIST DFLT PROP ASC DESC NAME
-->    0  255  some    0   36  17    6 -dejavu-dejavu sans mono-medium-r-normal--16-0-0-0-c-0-iso8859-1

-Miles

-- 
You can hack anything you want, with TECO and DDT.




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

* Re: font-related hanging / general brokenness
  2008-06-19  6:44               ` Kenichi Handa
  2008-06-19  6:58                 ` Miles Bader
@ 2008-06-19  7:28                 ` Miles Bader
  1 sibling, 0 replies; 22+ messages in thread
From: Miles Bader @ 2008-06-19  7:28 UTC (permalink / raw)
  To: Kenichi Handa; +Cc: monnier, emacs-devel

Kenichi Handa <handa@m17n.org> writes:
>> > % xlsfonts -fn '-bitstream-dejavu sans mono-medium-r-normal--16-*-0-0-c-0-iso8859-1'
>
>> $ xlsfonts -fn '-bitstream-dejavu sans mono-medium-r-normal--16-*-0-0-c-0-iso8859-1'
>> -bitstream-dejavu sans mono-medium-r-normal--16-0-0-0-c-0-iso8859-1
>
> Weird.
>
> It seems that your X, perhaps the module supporting TTF, has
> a bug.  I don't know an easy workaround for such a problem.
> Checking each font if it is surely openable or not in the
> font-selection routine is too much costly.  Changing the
> order of font drivers from x,xft to xft,x will solve
> (actually just hide) the problem.  But, why don't you remove
> such unusable fonts from your X font path?

The problem seems to come from the debian "x-ttcidfont" package; the bogus
entries are in "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType/fonts.dir".

Removing that directory from the font-path solves the problem.  I've removed
the package too (I think the only reason I installed it was to use those
fonts with the old pre-xft emacs).

I'll report this as a bug with x-ttcidfont; maybe a note should be added to
PROBLEMS as well?

Thanks,

-Miles

-- 
XML is like violence.  If it doesn't solve your problem, you're not
using enough of it.




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

* Re: font-related hanging / general brokenness
  2008-06-19  6:58                 ` Miles Bader
@ 2008-06-19  7:44                   ` Kenichi Handa
  0 siblings, 0 replies; 22+ messages in thread
From: Kenichi Handa @ 2008-06-19  7:44 UTC (permalink / raw)
  To: Miles Bader; +Cc: monnier, emacs-devel

In article <buohcbp3o81.fsf@dhapc248.dev.necel.com>, Miles Bader <miles.bader@necel.com> writes:

> Well... perhaps it is an X bug, but it's a standard debian installation
> AFAIK.  If I'm having problems, I expect many more people will as well.

Perhaps no other application can use both X and Xft fonts at
the same time.

> If use the `-l' option to xlsfonts, btw, it _doesn't_ show the bogus entry:

> $ xlsfonts -fn '-*-dejavu sans mono-medium-r-normal--16-*-0-0-c-0-iso8859-1'
> -bitstream-dejavu sans mono-medium-r-normal--16-0-0-0-c-0-iso8859-1
> -dejavu-dejavu sans mono-medium-r-normal--16-0-0-0-c-0-iso8859-1

> $ xlsfonts -l -fn '-*-dejavu sans mono-medium-r-normal--16-*-0-0-c-0-iso8859-1'
> DIR  MIN  MAX EXIST DFLT PROP ASC DESC NAME
> -->    0  255  some    0   36  17    6 -dejavu-dejavu sans mono-medium-r-normal--16-0-0-0-c-0-iso8859-1

Do you mean that you can open the font:
  -dejavu-dejavu sans mono-medium-r-normal--16-0-0-0-c-0-iso8859-1
by xfd?

If so, could you try the attached patch?  According to the
source code of xlsfonts, "-l" forces it to use
XListFontsWithInfo instead of XListFonts.

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

Index: xfont.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/xfont.c,v
retrieving revision 1.14
diff -u -r1.14 xfont.c
--- xfont.c	5 Jun 2008 04:15:44 -0000	1.14
+++ xfont.c	19 Jun 2008 07:39:43 -0000
@@ -221,13 +221,14 @@
   Lisp_Object list = Qnil;
   int i, limit, num_fonts;
   char **names;
+  XFontStruct *info;
 
   BLOCK_INPUT;
   x_catch_errors (display);
 
   for (limit = 512; ; limit *= 2)
     {
-      names = XListFonts (display, pattern, limit, &num_fonts);
+      names = XListFontsWithInfo (display, pattern, limit, &num_fonts, &info);
       if (x_had_errors_p (display))
 	{
 	  /* This error is perhaps due to insufficient memory on X
@@ -238,7 +239,7 @@
 	}
       if (num_fonts < limit)
 	break;
-      XFreeFontNames (names);
+      XFreeFontInfo (names, info, num_fonts);
     }
 
   if (num_fonts > 0)
@@ -291,7 +292,7 @@
 		  || XINT (AREF (entity, FONT_AVGWIDTH_INDEX)) > 0))
 	    list = Fcons (entity, list);
 	}
-      XFreeFontNames (names);
+      XFreeFontInfo (names, info, num_fonts);
     }
 
   x_uncatch_errors ();




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

* Re: font-related hanging / general brokenness
  2008-06-19  4:35 ` font-related hanging / general brokenness Miles Bader
  2008-06-19  4:52   ` Miles Bader
  2008-06-19  5:35   ` Kenichi Handa
@ 2008-06-19 14:23   ` Stefan Monnier
  2 siblings, 0 replies; 22+ messages in thread
From: Stefan Monnier @ 2008-06-19 14:23 UTC (permalink / raw)
  To: Miles Bader; +Cc: emacs-devel, Kenichi Handa

> [Did anyone besides Kenichi see my previous bug report?  I'm not seeing
> it on gmane, and I wonder if some idiot spam-protection software has
> deleted it (I used several attachements...).]

> Ok, the infinite-looping seems to be caused by this change of Stefan's:

> +2008-06-18  Stefan Monnier  <monnier@iro.umontreal.ca>
> +
> +	* faces.el (face-set-after-frame-default): Don't exclude `default'.

No, indeed, your email hasn't reached me.  Can you try sending it again?


        Stefan




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

* Re: font-related hanging / general brokenness
  2008-06-19  4:59 ` Kenichi Handa
@ 2008-06-19 21:49   ` Stefan Monnier
  2008-06-20  5:05     ` Miles Bader
  0 siblings, 1 reply; 22+ messages in thread
From: Stefan Monnier @ 2008-06-19 21:49 UTC (permalink / raw)
  To: Kenichi Handa; +Cc: emacs-devel, Miles Bader

>> Updating to the newest CVS Emacs, Emacs goes into an infinite-loop upon
>> startup, with the following .emacs file (X resources are empty):

>> (custom-set-faces
>> ;; custom-set-faces was added by Custom.
>> ;; If you edit it by hand, you could mess it up, so be careful.
>> ;; Your init file should contain only one such instance.
>> ;; If there is more than one, they won't work right.
>> '(default ((t (:stipple nil :background "black" :foreground "white" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 90 :width normal :family "dejavu sans mono")))))

>> A backtrace shows that it seems to be infinitely recursing in the hairy
>> frame/face dance.

Yes, it turns out the problem is that the dance takes the above face
setting and (because it's applied to the `default' face), sets up the
frame's `font' parameter accordingly.  And that x_set_font then decides
to call Qface_set_after_frame_default which starts the whole process all
over again.

Now, I looked thorugh the history, and this call to
Qface_set_after_frame_default was introduced in 1997 by Richard, but
without any explanation of what it's there for.

I can easily fix the recursion problem (there's already some code for
that purpose in faces.el), but I'm strongly tempted to remove the call
altogether since it's very unclear what it's meant to do and it seems
clear to me that it does a lot more than what it might need to do (this
function will reset *every* face, not just `default').


        Stefan




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

* Re: font-related hanging / general brokenness
  2008-06-19 21:49   ` Stefan Monnier
@ 2008-06-20  5:05     ` Miles Bader
  2008-06-20 14:00       ` Stefan Monnier
  0 siblings, 1 reply; 22+ messages in thread
From: Miles Bader @ 2008-06-20  5:05 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel, Kenichi Handa

Stefan Monnier <monnier@iro.umontreal.ca> writes:
> And that x_set_font then decides to call Qface_set_after_frame_default
> which starts the whole process all over again.
>
> I can easily fix the recursion problem (there's already some code for
> that purpose in faces.el), but I'm strongly tempted to remove the call
> altogether

I see you've done this, and Emacs now starts up properly for me, and
generally seems to work well.

Thanks,

-Miles

-- 
The secret to creativity is knowing how to hide your sources.
  --Albert Einstein




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

* Re: font-related hanging / general brokenness
  2008-06-20  5:05     ` Miles Bader
@ 2008-06-20 14:00       ` Stefan Monnier
  2008-06-22  7:48         ` Miles Bader
  0 siblings, 1 reply; 22+ messages in thread
From: Stefan Monnier @ 2008-06-20 14:00 UTC (permalink / raw)
  To: Miles Bader; +Cc: emacs-devel, Kenichi Handa

>> And that x_set_font then decides to call Qface_set_after_frame_default
>> which starts the whole process all over again.
>> 
>> I can easily fix the recursion problem (there's already some code for
>> that purpose in faces.el), but I'm strongly tempted to remove the call
>> altogether

> I see you've done this, and Emacs now starts up properly for me, and
> generally seems to work well.

Yes, when I noticed that my locally-hacked-tree has had these lines
removed for "longer than I remember" and that I haven't had a chance to
blame any bug on this change, I figured it should be safe enough.
I'm pretty sure it will introduce some undesirable change somewhere down
the line, but I expect there will be a much better way to solve it, and
we'll address it when we get there.


        Stefan




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

* Re: font-related hanging / general brokenness
  2008-06-20 14:00       ` Stefan Monnier
@ 2008-06-22  7:48         ` Miles Bader
  2008-06-23  3:05           ` Stefan Monnier
  0 siblings, 1 reply; 22+ messages in thread
From: Miles Bader @ 2008-06-22  7:48 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Kenichi Handa, emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>> And that x_set_font then decides to call Qface_set_after_frame_default
>>> which starts the whole process all over again.
>>> 
>>> I can easily fix the recursion problem (there's already some code for
>>> that purpose in faces.el), but I'm strongly tempted to remove the call
>>> altogether
>
>> I see you've done this, and Emacs now starts up properly for me, and
>> generally seems to work well.
>
> Yes, when I noticed that my locally-hacked-tree has had these lines
> removed for "longer than I remember" and that I haven't had a chance to
> blame any bug on this change, I figured it should be safe enough.
> I'm pretty sure it will introduce some undesirable change somewhere down
> the line, but I expect there will be a much better way to solve it, and
> we'll address it when we get there.

I notice that now, a `default' face setting set/saved with customize only
gets applied to the current/first frame -- subsequent frames created with
`C-x 5 2' end up using the `Emacs*Font:' xrdb setting instead (and
similarly for non-font attributes).

[I didn't notice before because I had the two settings set to identical values.]

Non-`default' faces set with customize seem to be applied properly to all frames.

-Miles

-- 
Cat, n. A soft, indestructible automaton provided by nature to be kicked when
things go wrong in the domestic circle.




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

* Re: font-related hanging / general brokenness
  2008-06-22  7:48         ` Miles Bader
@ 2008-06-23  3:05           ` Stefan Monnier
  2008-06-23  4:35             ` Miles Bader
  0 siblings, 1 reply; 22+ messages in thread
From: Stefan Monnier @ 2008-06-23  3:05 UTC (permalink / raw)
  To: Miles Bader; +Cc: Kenichi Handa, emacs-devel

> I notice that now, a `default' face setting set/saved with customize only
> gets applied to the current/first frame -- subsequent frames created with
> `C-x 5 2' end up using the `Emacs*Font:' xrdb setting instead (and
> similarly for non-font attributes).

Hmm... I don't see that.  I have "Emacs.font: fixed" in "xrdb -query"
and a .emacs that contains just (custom-set-faces '(default ((t :font
"Sans")))), and the first frame along with all subsequent ones uses
"Sans".

Can you try and come up with a more precise recipe?


        Stefan




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

* Re: font-related hanging / general brokenness
  2008-06-23  3:05           ` Stefan Monnier
@ 2008-06-23  4:35             ` Miles Bader
  0 siblings, 0 replies; 22+ messages in thread
From: Miles Bader @ 2008-06-23  4:35 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel, Kenichi Handa

Stefan Monnier <monnier@iro.umontreal.ca> writes:
> Hmm... I don't see that.  I have "Emacs.font: fixed" in "xrdb -query"
> and a .emacs that contains just (custom-set-faces '(default ((t :font
> "Sans")))), and the first frame along with all subsequent ones uses
> "Sans".
>
> Can you try and come up with a more precise recipe?

Hmm I tried to make a more precise test case.

I used the following /tmp/.emacs files (differing only in the :family of
the `default' face):

  A)
     (custom-set-faces
      '(default ((t (:stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 120 :width normal :foundry "unknown" :family "DejaVu Sans Mono")))))

  B)
     (custom-set-faces
      '(default ((t (:stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 120 :width normal :foundry "unknown" :family "Monospace")))))

and the following test cases:

  1)
      xrdb -remove
      LANG=C HOME=/tmp \emacs &

  2)
      xrdb -remove
      echo 'Emacs*Font: Dejavu Sans Mono-8' | xrdb
      LANG=C HOME=/tmp \emacs &

I've used the following abbreviations for fonts.  [The font-specs are
what's output by `C-u C-x =').  Note that "11" below corresponds to the
"8" in Dejavu Sans Mono-8", and "16" below corresponds to ":height 120"
in the custom settings, according to whatever weird relationship there
is between specified and actual point sizes.]

   DjMo16 = -unknown-DejaVu Sans Mono-normal-normal-normal-*-16-*-*-*-m-0-iso8859-1
   DjMo11 = -unknown-DejaVu Sans Mono-normal-normal-normal-*-11-*-*-*-m-0-iso8859-1
   BvMo16 = -bitstream-Bitstream Vera Sans Mono-normal-normal-normal-*-16-*-*-*-m-0-iso8859-1
   BvSa16 = -bitstream-Bitstream Vera Sans-normal-normal-normal-*-16-*-*-*-*-0-iso8859-1
   BvSa11 = -bitstream-Bitstream Vera Sans-normal-normal-normal-*-11-*-*-*-*-0-iso8859-1
   UnMo16 = -urw-nimbus mono l-regular-r-normal--16-116-100-100-p-100-iso8859-1

Here are the resulting faces; I've appended a "*" to things I think are wrong:

				A1	A2	B1	B2
   ----------------------------------------------------------------
   initial `default'		DjMo16	DjMo16	BvMo16	BvMo16
   initial `variable-pitch'	BvSa16	BvSa16	BvSa16	BvSa16
   C-x 5 2 `default'		DjMo16	DjMo16	UnMo16*	DjMo11*
   C-x 5 2 `variable-pitch'	BvSa16	BvSa11*	BvSa16	BvSa11*

The "UnMo16" result seems particular bizarre...

-Miles

-- 
"Don't just question authority,
Don't forget to question me."
-- Jello Biafra




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

end of thread, other threads:[~2008-06-23  4:35 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <buobq1ycd5c.fsf@dhapc248.dev.necel.com>
2008-06-19  4:35 ` font-related hanging / general brokenness Miles Bader
2008-06-19  4:52   ` Miles Bader
2008-06-19  5:35   ` Kenichi Handa
2008-06-19  5:41     ` Miles Bader
2008-06-19  5:55       ` Miles Bader
2008-06-19  6:17         ` Kenichi Handa
2008-06-19  6:10       ` Kenichi Handa
2008-06-19  6:14         ` Miles Bader
2008-06-19  6:19           ` Kenichi Handa
2008-06-19  6:26             ` Miles Bader
2008-06-19  6:44               ` Kenichi Handa
2008-06-19  6:58                 ` Miles Bader
2008-06-19  7:44                   ` Kenichi Handa
2008-06-19  7:28                 ` Miles Bader
2008-06-19 14:23   ` Stefan Monnier
2008-06-19  4:59 ` Kenichi Handa
2008-06-19 21:49   ` Stefan Monnier
2008-06-20  5:05     ` Miles Bader
2008-06-20 14:00       ` Stefan Monnier
2008-06-22  7:48         ` Miles Bader
2008-06-23  3:05           ` Stefan Monnier
2008-06-23  4:35             ` Miles Bader

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.