LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-28-2015, 03:11 PM   #1
cgorac
Member
 
Registered: Oct 2009
Posts: 146

Rep: Reputation: 87
font selection for xterm/emacs


Am using $HOME/.Xdefaults to select fonts for xterm and emacs (X11 version). Was using Google Droid TTF fonts, from corresponding SBo package, and my previous settings in the above file were:

XTerm*faceName: Droid Sans Mono
XTerm*faceSize: 8
Emacs.font: Droid Sans Mono 8

With these settings, characters were of the same size in both xterm and emacs. Now, I've decided to try Adobe Source Code Pro TTF font, again from corresponding SBo package. So I've replaced above settings with:

XTerm*faceName: Source Code Pro
XTerm*faceSize: 8
Emacs.font: Source Code Pro 8

The new font is properly activated in both xterm and emacs, however font size in the xterm is now visibly larger than one in emacs. Thus - any hint on how to debug what's going on here?

Thanks.
 
Old 08-28-2015, 04:07 PM   #2
mzsade
Member
 
Registered: Sep 2009
Distribution: Linux Mint 9, Linux Mint 17.2(xfce), LMDE2(Mate), Debian Jessie minimal (with standalone OBox)
Posts: 299

Rep: Reputation: 34
http://askubuntu.com/questions/16165...-size-of-xterm

Quote:
...look through /etc/X11/app-defaults/XTerm, find
what sizes lines such as *VT100.font1: ,
choose one, and write somewhere xterm*font: 10x20
I have used the above to increase by xterm font size, you could try the reverse. Sorry if the same file path is not applicable to your distribution, it worked for me on my Debian Jessie install.
 
Old 08-29-2015, 01:08 AM   #3
cgorac
Member
 
Registered: Oct 2009
Posts: 146

Original Poster
Rep: Reputation: 87
Thanks for your reply. I'm aware of these options, however my questions was more about how to find why it happens that font sizes are same in xterm and emacs when one TrueType font used by both, and different when other font used.
 
Old 08-29-2015, 05:28 AM   #4
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Check that there are no (custom-set-faces ... ) blocks in ~/.emacs as those will override the X resources.

Also, separate the size from the font pattern with a hyphen not a space as that might also be causing you
matching problems in fontconfig, e.g.

Code:
test:~$ fc-pattern "Deja Vu Sans Mono 12"
Pattern has 1 elts (size 16)
        family: "Deja Vu Sans Mono 12"(s)

test:~$ fc-pattern "Deja Vu Sans Mono-12"
Pattern has 2 elts (size 16)
        family: "Deja Vu Sans Mono"(s)
        size: 12(f)(s)
 
Old 08-29-2015, 09:44 AM   #5
cgorac
Member
 
Registered: Oct 2009
Posts: 146

Original Poster
Rep: Reputation: 87
Thanks for the reply. Using hyphen instead of blank before font size doesn't make any difference in this particular case. Also, I don't have any settings in my $HOME/.emacs that are fonts related. Furthermore, when Source Code Pro used in emacs, it seems OK, in the sense that size of characters is the same as when Droid Sans Mono font used. However, when Source Code Pro used in xterm, then for some reason characters are larger than in emacs. And when Droid Sans Mono used in xterm, characters are of same size as in emacs (either with Droid Sans Mono or Source Code Pro used in emacs).
 
Old 08-29-2015, 11:09 AM   #6
cgorac
Member
 
Registered: Oct 2009
Posts: 146

Original Poster
Rep: Reputation: 87
After some further experimenting, I found that the cause of the difference was that I had "Xft.dpi" set in my $HOME/.Xdefaults - obviously, xterm and emacs may be using this value differently. After commenting out corresponding line in .Xdefaults file, characters are of the same size in xterm and emacs when Source Code Pro font used, albeit it seems that xterm is putting some more spacing between lines. This is probably because of some font property set in corresponding TTF file, that xterm is obeying, and emacs is not. But I think I can live with that, it's not that distracting.

Thanks for all answers.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Emacs - changing default font size and font type? neilcpp Linux - Software 16 05-20-2013 11:29 AM
xterm: cannot match normal font "Monospace" on xterm 282, X11R7.7 ebol4 Linux - Software 2 10-07-2012 08:59 PM
XTerm(241) support for truetype fonts and method of changing XTerm font. ajassat Linux - Software 2 08-19-2009 12:01 PM
XTerm url selection SUSE behavior in Debian subspawn Linux - Software 0 12-20-2005 05:38 AM
how do I copy a selection from xterm to clipboard? hollywoodb Linux - Newbie 1 10-06-2003 12:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration