SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
...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.
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.
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)
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).
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.