all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Emacs Display Recangular blocks instead of fonts
@ 2013-05-26 23:32 Kumar, Amit
  2013-05-27  2:03 ` Stefan Monnier
  2013-05-27  2:43 ` Stephen J. Turnbull
  0 siblings, 2 replies; 10+ messages in thread
From: Kumar, Amit @ 2013-05-26 23:32 UTC (permalink / raw
  To: emacs-devel@gnu.org

[-- Attachment #1: Type: text/plain, Size: 3285 bytes --]

Dear All,

I am here is a deadlock situation and can't figure out this font problem: I have extensively looked online for a solution and none seems to work, and have been very disturbed by the fact that I can get this to work.
I get this very famous error, but my efforts have been futile to fix this:
Warning: Cannot convert string "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*" to type FontStruct
Warning: Cannot convert string "-*-helvetica-medium-r-*--*-120-*-*-*-*-iso8859-1" to type FontStruct

What I don't understand is why is emacs resorting to these fonts, if it has problems can't it use some other fonts to display a normal screen? Instead it displays rectangular boxes for each letter.
Below here are the details of the version of the OS and packages installed and further details. Hope you can help me understand the problem that can lead me to a solution, and make me feel better in helping me fix this. It has been a day-mare!
Best Regards,
Amit


Linux: Scientific Linux SL release 5.5
$ rpm -qa | grep emacs
emacs-common-21.4-20.el5
emacspeak-23.0-3.el5
emacs-21.4-20.el5
emacs-leim-21.4-20.el5
$ rpm -qa | grep fonts
xorg-x11-fonts-misc-7.1-2.1.el5
xorg-x11-fonts-ISO8859-15-100dpi-7.1-2.1.el5
bitstream-vera-fonts-1.10-7
xorg-x11-fonts-ISO8859-1-75dpi-7.1-2.1.el5
xorg-x11-fonts-Type1-7.1-2.1.el5
xorg-x11-fonts-ISO8859-15-75dpi-7.1-2.1.el5
urw-fonts-2.3-6.1.1
xorg-x11-fonts-ISO8859-2-75dpi-7.1-2.1.el5
xorg-x11-fonts-ISO8859-9-100dpi-7.1-2.1.el5
xorg-x11-fonts-ISO8859-9-75dpi-7.1-2.1.el5
xorg-x11-fonts-ISO8859-14-100dpi-7.1-2.1.el5
xorg-x11-fonts-100dpi-7.1-2.1.el5
xorg-x11-fonts-syriac-7.1-2.1.el5
xorg-x11-fonts-ISO8859-14-75dpi-7.1-2.1.el5
xorg-x11-fonts-base-7.1-2.1.el5
xorg-x11-fonts-75dpi-7.1-2.1.el5
ghostscript-fonts-5.50-13.1.1
tetex-fonts-3.0-33.8.el5_5.5
xorg-x11-fonts-ISO8859-1-100dpi-7.1-2.1.el5
xorg-x11-fonts-truetype-7.1-2.1.el5
xorg-x11-fonts-cyrillic-7.1-2.1.el5
liberation-fonts-1.0-1.el5
xorg-x11-fonts-ethiopic-7.1-2.1.el5
xorg-x11-fonts-ISO8859-2-100dpi-7.1-2.1.el5


Fonts directory listed in /etc/fonts/fonts.conf
.....
<!-- Font directory list -->
  <dir>/usr/share/fonts</dir>
  <dir>/usr/share/X11/fonts/Type1</dir>
  <dir>/usr/share/X11/fonts/OTF</dir>
  <dir>/usr/share/X11/fonts/100dpi</dir>
  <dir>/usr/share/X11/fonts/75dpi</dir>
  <dir>/usr/share/X11/fonts/cyrillic</dir>
  <dir>/usr/share/X11/fonts/encodings</dir>
  <dir>/usr/share/X11/fonts/misc</dir>
  <dir>/usr/share/X11/fonts/TTF</dir>
  <dir>/usr/share/X11/fonts/util</dir>
  <dir>~/.fonts</dir>
....
Directory contents:
$ ls /usr/share/fonts/
bitstream-vera  default  java  liberation
$ ls /usr/share/X11/fonts/
100dpi  75dpi  cyrillic  encodings  misc  OTF  TTF  Type1  util

I also ran `fc-cache -f -s -v`  in addition to `xset fp rehash` to clean up cache and rehash it.

$ fc-list | grep -i "courier"
Courier:style=Bold Italic
Courier:style=Regular
Courier 10 Pitch:style=Bold Italic
Courier:style=Oblique
Courier 10 Pitch:style=Italic
Courier:style=Bold Oblique
Courier 10 Pitch:style=Regular
Courier:style=Italic
Courier 10 Pitch:style=Bold

$ fc-list | grep -i helvetica
Helvetica:style=Oblique
Helvetica:style=Bold
Helvetica:style=Regular
Helvetica:style=Bold Oblique


[-- Attachment #2: Type: text/html, Size: 17163 bytes --]

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

* Re: Emacs Display Recangular blocks instead of fonts
  2013-05-26 23:32 Emacs Display Recangular blocks instead of fonts Kumar, Amit
@ 2013-05-27  2:03 ` Stefan Monnier
  2013-05-27  2:43 ` Stephen J. Turnbull
  1 sibling, 0 replies; 10+ messages in thread
From: Stefan Monnier @ 2013-05-27  2:03 UTC (permalink / raw
  To: Kumar, Amit; +Cc: emacs-devel@gnu.org

> emacs-21.4-20.el5

That's a bit dated.  You might like to upgrade to 24.3 which might solve
those problems.


        Stefan



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

* Emacs Display Recangular blocks instead of fonts
  2013-05-26 23:32 Emacs Display Recangular blocks instead of fonts Kumar, Amit
  2013-05-27  2:03 ` Stefan Monnier
@ 2013-05-27  2:43 ` Stephen J. Turnbull
  2013-05-27  7:07   ` Kumar, Amit
                     ` (2 more replies)
  1 sibling, 3 replies; 10+ messages in thread
From: Stephen J. Turnbull @ 2013-05-27  2:43 UTC (permalink / raw
  To: Kumar, Amit; +Cc: emacs-devel@gnu.org

Kumar, Amit writes:

 > Cannot convert string "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*" to type FontStruct
 > Warning: Cannot convert string "-*-helvetica-medium-r-*--*-120-*-*-*-*-iso8859-1" to type FontStruct

These are the old-style "server-side" font objects.  These warnings
are from Xlib, and indicate that you have a badly configured
installation of X11.  It's not really an Emacs problem; your distro is
broken.

 > What I don't understand is why is emacs resorting to these fonts,
 > if it has problems can't it use some other fonts to display a
 > normal screen?

It should be doing so; I don't know why it doesn't.  I would guess
that Emacs is not able to find any fonts at all.  You do seem to have
the appropriate fonts installed in your file system (the ones in
/usr/share/X11/fonts), so there's a problem with the X server.

I don't recall exactly how modern X servers handle server-side fonts.
You may need a separate "font server" running to use the bitmap and
other old-style fonts you have installed.  Look for a font-server
package (or change distros, see below).

 > Fonts directory listed in /etc/fonts/fonts.conf

This a configuration file for fontconfig, which is irrelevant to
FontStruct.  It's probable that your Emacs was built only with
server-side fonts (21.4 is very old), but your server doesn't
understand how to render them.  So it substitutes boxes.

The current series of Emacs is 24.x, and older Emacs versions are
officially unsupported.  That doesn't mean you won't get help, but it
does mean that there are no problems with Emacs 21 where the default
solution is anything but "Upgrade, then come talk to us".

If upgrading is possible, you really should do so (for many reasons,
not just to make it easier for us to support you).

(Aside: If Scientific Linux [sic] distributes such an old Emacs,
what other problems may be hiding in the distro?  All of the main
distros keep up with Emacs releases with a lag of only a couple weeks.
Many provide a "bleeding edge" beta package as well.  The evidence is
strong that Emacs is both a valuable package and one that is easy to
keep up to date.  If Scientific Linux doesn't do so ....)

 > $ fc-list | grep -i "courier"
 > Courier:style=Regular
 > $ fc-list | grep -i helvetica
 > Helvetica:style=Regular

These are again fontconfig specs; since fontconfig finds these fonts,
that's strong evidence that your Emacs is too old to render them.




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

* RE: Emacs Display Recangular blocks instead of fonts
  2013-05-27  2:43 ` Stephen J. Turnbull
@ 2013-05-27  7:07   ` Kumar, Amit
  2013-05-27 11:12   ` Per Starbäck
  2013-05-27 13:24   ` James Cloos
  2 siblings, 0 replies; 10+ messages in thread
From: Kumar, Amit @ 2013-05-27  7:07 UTC (permalink / raw
  To: Stephen J. Turnbull, Stefan Monnier; +Cc: emacs-devel@gnu.org

Hi Stephen and Stefan,

Thank for the detailed answer and suggestion. 
I installed it from the source(v24.2) and it works like a charm!

Although when I tried to install the latest version 24.3 it failed to make
Somehow I couldn't find where exactly is "tparm"defined. Nothing fancy simple configure, make fails for this but worked for v24.2
I looked if the function was defined in any of the object files but could not find a reference at all, hope it makes more sense to you guys.
Please let me know what you think.

Thanks for your prompt weekend help!

make[1]: Entering directory `/root/emacs-24.3/src'
gcc -std=gnu99 -nostdlib -Demacs  -I. -I/root/emacs-24.3/src -I../lib -I/root/emacs-24.3/src/../lib   -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12   -I/usr/include/freetype2       -I/usr/include/libxml2     -I/usr/include/freetype2      -MMD -MF deps/.d -MP     -g3 -O2   -Wl,-znocombreloc  \
          -o temacs pre-crt0.o /usr/lib64/crt1.o /usr/lib64/crti.o dispnew.o frame.o scroll.o xdisp.o menu.o xmenu.o window.o charset.o coding.o category.o ccl.o character.o chartab.o bidi.o cm.o term.o terminal.o xfaces.o xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o xgselect.o gtkutil.o   emacs.o keyboard.o macros.o keymap.o sysdep.o buffer.o filelock.o insdel.o marker.o minibuf.o fileio.o dired.o cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o alloc.o data.o doc.o editfns.o callint.o eval.o floatfns.o fns.o font.o print.o lread.o syntax.o unexelf.o bytecode.o process.o gnutls.o callproc.o region-cache.o sound.o atimer.o doprnt.o intervals.o textprop.o composite.o xml.o profiler.o     xfont.o ftfont.o xftfont.o ftxfont.o  fontset.o fringe.o image.o  terminfo.o lastfile.o    vm-limit.o   ../lib/libgnu.a      -ltiff -ljpeg -lpng -lz -lm -lgif -lXpm -L/lib64 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0   -lSM -lICE -lX11 -lXrender -lXft -lXrender -lfontconfig -lfreetype -lX11      -lrt -lrt    -lxml2 -lz -lm      -ltermcap   -lselinux -lfreetype   -lfontconfig      -lpthread   -lm -lgcc -lc -lgcc /usr/lib64/crtn.o
fns.o: In function `sxhash_float':
/root/emacs-24.3/src/fns.c:4139: warning: memset used with constant zero length parameter; this could be due to transposed parameters
/root/emacs-24.3/src/fns.c:4139: warning: memset used with constant zero length parameter; this could be due to transposed parameters
/root/emacs-24.3/src/fns.c:4139: warning: memset used with constant zero length parameter; this could be due to transposed parameters
terminfo.o: In function `tparam':
/root/emacs-24.3/src/terminfo.c:50: undefined reference to `tparm'
collect2: ld returned 1 exit status
make[1]: *** [temacs] Error 1
make[1]: Leaving directory `/root/emacs-24.3/src'
make: *** [src] Error 2 

-----Original Message-----
From: Stephen J. Turnbull [mailto:stephen@xemacs.org] 
Sent: Sunday, May 26, 2013 9:43 PM
To: Kumar, Amit
Cc: emacs-devel@gnu.org
Subject: Emacs Display Recangular blocks instead of fonts

Kumar, Amit writes:

 > Cannot convert string "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*" to type FontStruct  > Warning: Cannot convert string "-*-helvetica-medium-r-*--*-120-*-*-*-*-iso8859-1" to type FontStruct

These are the old-style "server-side" font objects.  These warnings are from Xlib, and indicate that you have a badly configured installation of X11.  It's not really an Emacs problem; your distro is broken.

 > What I don't understand is why is emacs resorting to these fonts,  > if it has problems can't it use some other fonts to display a  > normal screen?

It should be doing so; I don't know why it doesn't.  I would guess that Emacs is not able to find any fonts at all.  You do seem to have the appropriate fonts installed in your file system (the ones in /usr/share/X11/fonts), so there's a problem with the X server.

I don't recall exactly how modern X servers handle server-side fonts.
You may need a separate "font server" running to use the bitmap and other old-style fonts you have installed.  Look for a font-server package (or change distros, see below).

 > Fonts directory listed in /etc/fonts/fonts.conf

This a configuration file for fontconfig, which is irrelevant to FontStruct.  It's probable that your Emacs was built only with server-side fonts (21.4 is very old), but your server doesn't understand how to render them.  So it substitutes boxes.

The current series of Emacs is 24.x, and older Emacs versions are officially unsupported.  That doesn't mean you won't get help, but it does mean that there are no problems with Emacs 21 where the default solution is anything but "Upgrade, then come talk to us".

If upgrading is possible, you really should do so (for many reasons, not just to make it easier for us to support you).

(Aside: If Scientific Linux [sic] distributes such an old Emacs, what other problems may be hiding in the distro?  All of the main distros keep up with Emacs releases with a lag of only a couple weeks.
Many provide a "bleeding edge" beta package as well.  The evidence is strong that Emacs is both a valuable package and one that is easy to keep up to date.  If Scientific Linux doesn't do so ....)

 > $ fc-list | grep -i "courier"
 > Courier:style=Regular
 > $ fc-list | grep -i helvetica
 > Helvetica:style=Regular

These are again fontconfig specs; since fontconfig finds these fonts, that's strong evidence that your Emacs is too old to render them.


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

* Re: Emacs Display Recangular blocks instead of fonts
  2013-05-27  2:43 ` Stephen J. Turnbull
  2013-05-27  7:07   ` Kumar, Amit
@ 2013-05-27 11:12   ` Per Starbäck
  2013-05-27 13:24   ` James Cloos
  2 siblings, 0 replies; 10+ messages in thread
From: Per Starbäck @ 2013-05-27 11:12 UTC (permalink / raw
  To: emacs-devel@gnu.org

[-- Attachment #1: Type: text/plain, Size: 743 bytes --]

2013/5/27 Stephen J. Turnbull <stephen@xemacs.org>

>
>
> (Aside: If Scientific Linux [sic] distributes such an old Emacs,
> what other problems may be hiding in the distro?  All of the main
> distros keep up with Emacs releases with a lag of only a couple weeks.
> Many provide a "bleeding edge" beta package as well.  The evidence is
> strong that Emacs is both a valuable package and one that is easy to
> keep up to date.  If Scientific Linux doesn't do so ....)
>
>
SL is more or less a copy of Red Hat where the latest release (6.4)
includes Emacs 23.1, so that's one major distro that doesn't keep up with
Emacs releases like that. But it also shows that the original poster has an
old version of the distro, so nothing to worry about.

[-- Attachment #2: Type: text/html, Size: 1145 bytes --]

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

* Re: Emacs Display Recangular blocks instead of fonts
  2013-05-27  2:43 ` Stephen J. Turnbull
  2013-05-27  7:07   ` Kumar, Amit
  2013-05-27 11:12   ` Per Starbäck
@ 2013-05-27 13:24   ` James Cloos
  2013-05-27 13:42     ` Stephen J. Turnbull
  2 siblings, 1 reply; 10+ messages in thread
From: James Cloos @ 2013-05-27 13:24 UTC (permalink / raw
  To: emacs-devel; +Cc: Stephen J. Turnbull, Kumar, Amit

>>>>> "SJT" == Stephen J Turnbull <stephen@xemacs.org> writes:

SJT> I don't recall exactly how modern X servers handle server-side fonts.

The majority of the current distributions default to installing the X
server with built-in support for the misc-fixed and cursor fonts and
with the font-path set to "built-ins" (to find those two).

They expect everything to use client-side fonts.

But I believe they still have the font loader for bdf and pcf files,
so it should be possible to install the bitmap font packages and add
the necessary directories to the font-path.

As one example, on debian sid, 

    :; apt-cache search xfonts|grep ^xfonts

lists 77 packages, (75 font packages, plus encodings and utils).

-JimC
-- 
James Cloos <cloos@jhcloos.com>         OpenPGP: 1024D/ED7DAEA6



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

* Re: Emacs Display Recangular blocks instead of fonts
  2013-05-27 13:24   ` James Cloos
@ 2013-05-27 13:42     ` Stephen J. Turnbull
  2013-05-27 13:50       ` James Cloos
  0 siblings, 1 reply; 10+ messages in thread
From: Stephen J. Turnbull @ 2013-05-27 13:42 UTC (permalink / raw
  To: James Cloos; +Cc: Kumar, Amit, emacs-devel

James Cloos writes:
 > >>>>> "SJT" == Stephen J Turnbull <stephen@xemacs.org> writes:
 > 
 > SJT> I don't recall exactly how modern X servers handle server-side fonts.
 > 
 > The majority of the current distributions default to installing the X
 > server with built-in support for the misc-fixed and cursor fonts and
 > with the font-path set to "built-ins" (to find those two).

But I would think misc-fixed is somewhere in the list that the OP
posted, and it should be able to handle the Emacs splash screen and
most code (including the tags in SGML and TeX macros, as well as
keywords in all common languages).  So I'm still surprised at his
results.

 > They expect everything to use client-side fonts.

Indeed, upgrading to a fontconfig/Xrender-capable Emacs solved his
problem.




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

* Re: Emacs Display Recangular blocks instead of fonts
  2013-05-27 13:42     ` Stephen J. Turnbull
@ 2013-05-27 13:50       ` James Cloos
  2013-05-27 14:10         ` Andreas Schwab
  0 siblings, 1 reply; 10+ messages in thread
From: James Cloos @ 2013-05-27 13:50 UTC (permalink / raw
  To: Stephen J. Turnbull; +Cc: Kumar, Amit, emacs-devel

>>>>> "SJT" == Stephen J Turnbull <stephen@xemacs.org> writes:

SJT> But I would think misc-fixed is somewhere in the list that the OP
SJT> posted, and it should be able to handle the Emacs splash screen and
SJT> most code (including the tags in SGML and TeX macros, as well as
SJT> keywords in all common languages).  So I'm still surprised at his
SJT> results.

I mis-wrote.  Instead of misc-fixed I should have written fixed.

Ie, the single xlfd 'fixed', not the family '-misc-fixed-***'.

-JimC
-- 
James Cloos <cloos@jhcloos.com>         OpenPGP: 1024D/ED7DAEA6



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

* Re: Emacs Display Recangular blocks instead of fonts
  2013-05-27 13:50       ` James Cloos
@ 2013-05-27 14:10         ` Andreas Schwab
  2013-05-27 14:32           ` James Cloos
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas Schwab @ 2013-05-27 14:10 UTC (permalink / raw
  To: James Cloos; +Cc: Stephen J. Turnbull, emacs-devel, Kumar, Amit

James Cloos <cloos@jhcloos.com> writes:

> Ie, the single xlfd 'fixed', not the family '-misc-fixed-***'.

fixed is just an alias for
-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."



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

* Re: Emacs Display Recangular blocks instead of fonts
  2013-05-27 14:10         ` Andreas Schwab
@ 2013-05-27 14:32           ` James Cloos
  0 siblings, 0 replies; 10+ messages in thread
From: James Cloos @ 2013-05-27 14:32 UTC (permalink / raw
  To: Andreas Schwab; +Cc: Stephen J. Turnbull, emacs-devel, Kumar, Amit

>>>>> "AS" == Andreas Schwab <schwab@suse.de> writes:

JC>> Ie, the single xlfd 'fixed', not the family '-misc-fixed-***'.

AS> fixed is just an alias for
AS> -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1.

AKA -misc-fixed-medium-r-semicondensed--13-100-100-100-c-60-iso8859-1.

But even if the OP had some -misc-fixed-** xlfd configured, doesn't mean
it was the 13 px face.  My intiial reply could have been interpreted to
imply that all of the -misc-fixed- family were included.

It seemed reasonable to be more precise.

As it turns out, at least with the current version of libXfont,

   :; xset fp= built-ins ; xlsfonts

returns:

   -misc-fixed-medium-r-semicondensed--0-0-75-75-c-0-iso8859-1
   -misc-fixed-medium-r-semicondensed--13-100-100-100-c-60-iso8859-1
   -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1
   6x13
   cursor
   fixed

-JimC
-- 
James Cloos <cloos@jhcloos.com>         OpenPGP: 1024D/ED7DAEA6



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

end of thread, other threads:[~2013-05-27 14:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-26 23:32 Emacs Display Recangular blocks instead of fonts Kumar, Amit
2013-05-27  2:03 ` Stefan Monnier
2013-05-27  2:43 ` Stephen J. Turnbull
2013-05-27  7:07   ` Kumar, Amit
2013-05-27 11:12   ` Per Starbäck
2013-05-27 13:24   ` James Cloos
2013-05-27 13:42     ` Stephen J. Turnbull
2013-05-27 13:50       ` James Cloos
2013-05-27 14:10         ` Andreas Schwab
2013-05-27 14:32           ` James Cloos

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.