PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > linux.debian.user > truetype fonts in x11, wrong metrics?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
linux.debian.user debian-user@lists.debian.org.

truetype fonts in x11, wrong metrics?

Réponse
 
LinkBack Outils de la discussion
Vieux 30/04/2007, 09h00   #1
BALLABIO GERARDO
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut truetype fonts in x11, wrong metrics?

Hi all,

I've recently switched from Sarge to Etch (I've decided to do a
reinstall, not an upgrade, because I also wanted to repartition the hard
disk) and in the last few days I've been restoring my customizations.

I've run into a problem with fonts. In Sarge I had configured Emacs to
use the same font as the Gnome Terminal, and I want to do the same thing
in Etch. The font family Gnome is using is "DejaVu" (package
ttf-dejavu). As this is a TrueType font, it isn't immediately available
from Emacs: it has to be registered first as an X11 font. I had been
able to do that in Sarge by following directions from this page:
http://www.paulandlesley.org/linux/xfree4_tt.html (specifically, section
4.2) and tried to do the same in Etch. Basically the procedure is:
1. go to the directory where the TrueType fonts are stored (that is
/usr/share/fonts/truetype/ttf-dejavu)
2. run ttmkfdir (creates fonts.scale)
3. run mkfontdir (creates fonts.dir)
4. in /etc/X11/xorg.conf add the following line to Section "Files":
FontPath /usr/share/fonts/truetype/ttf-dejavu
5. restart the X server
(of course must be done as root)

So this worked in Etch too: after the procedure, "xlsfonts | grep
dejavu" shows quite a lot of fonts. The one I want seems to be
"-misc-dejavu sans mono-medium-r-normal--15-150-75-75-m-0-iso10646-1"
(in the Gnome font panel it's listed as "Monospace, 12 pt"). But
strangely, when I run Emacs with this font, the text window isn't
dimensioned correctly: it should be 80 characters wide, but only 72 fit
within. There's also some extra spacing between lines. See attached
screenshot: the Gnome Terminal window shows what it should look like.

I guess that Emacs doesn't get the font metrics correctly. I don't know
which I should blame -- the font files, Emacs or X-Windows. Anyway, does
anyone know what I could do to fix this?

Please Cc: me, I'm not subscribed.

Thanks everybody
Gerardo

  Réponse avec citation
Vieux 30/04/2007, 10h20   #2
Liam O'Toole
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: truetype fonts in x11, wrong metrics?

On Mon, 30 Apr 2007 09:38:22 +0200
"BALLABIO GERARDO" <GERARDO.BALLABIO@mpsgr.it> wrote:

> Hi all,
>
> I've recently switched from Sarge to Etch (I've decided to do a
> reinstall, not an upgrade, because I also wanted to repartition the
> hard disk) and in the last few days I've been restoring my
> customizations.
>
> I've run into a problem with fonts. In Sarge I had configured Emacs to
> use the same font as the Gnome Terminal, and I want to do the same
> thing in Etch. The font family Gnome is using is "DejaVu" (package
> ttf-dejavu). As this is a TrueType font, it isn't immediately
> available from Emacs: it has to be registered first as an X11 font. I
> had been able to do that in Sarge by following directions from this
> page: http://www.paulandlesley.org/linux/xfree4_tt.html
> (specifically, section 4.2) and tried to do the same in Etch.
> Basically the procedure is: 1. go to the directory where the TrueType
> fonts are stored (that is /usr/share/fonts/truetype/ttf-dejavu)
> 2. run ttmkfdir (creates fonts.scale)
> 3. run mkfontdir (creates fonts.dir)
> 4. in /etc/X11/xorg.conf add the following line to Section "Files":
> FontPath /usr/share/fonts/truetype/ttf-dejavu
> 5. restart the X server
> (of course must be done as root)


The x-ttcidfont-conf package takes care of the registration of truetype
fonts for you.

> So this worked in Etch too: after the procedure, "xlsfonts | grep
> dejavu" shows quite a lot of fonts. The one I want seems to be
> "-misc-dejavu sans mono-medium-r-normal--15-150-75-75-m-0-iso10646-1"
> (in the Gnome font panel it's listed as "Monospace, 12 pt"). But
> strangely, when I run Emacs with this font, the text window isn't
> dimensioned correctly: it should be 80 characters wide, but only 72
> fit within. There's also some extra spacing between lines. See
> attached screenshot: the Gnome Terminal window shows what it should
> look like.


Are you sure that the screen width is not an Emacs setting, rather than
a font issue? What width do you get if you switch to a non-truetype
font?

>
> I guess that Emacs doesn't get the font metrics correctly. I don't
> know which I should blame -- the font files, Emacs or X-Windows.
> Anyway, does anyone know what I could do to fix this?


From your screenshot, I see that Emacs (or is it xemacs?) is a GTK1
application. gnome-terminal is a GTK2 application. The former gets its
idea of screen resolution directly from the X server, whereas the
latter uses the X resource database. Compare the output of the
following two commands:

xdpyinfo | grep resol
xrdb -q | grep dpi

Are the DPI values different?

>
> Please Cc: me, I'm not subscribed.
>
> Thanks everybody
> Gerardo



--

Liam
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 11h59.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,12344 seconds with 10 queries