LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 02-12-2020, 05:08 AM   #1
joenew
Member
 
Registered: Mar 2010
Distribution: slackware 14.2 64bit
Posts: 149

Rep: Reputation: 21
xterm and -fa


Hi all, I noticed I can't change xterm font to any TTF font, like "Dejavu Sans Mono" or "Hack".
Those fonts are installed and fc-list report them:
Code:
fc-list|grep TTF|grep -i "Hack\|DejaVuSansMono"|sort
/usr/share/fonts/TTF/DejaVuSansMono-Bold.ttf: DejaVu Sans Mono:style=Bold
/usr/share/fonts/TTF/DejaVuSansMono-BoldOblique.ttf: DejaVu Sans Mono:style=Bold Oblique
/usr/share/fonts/TTF/DejaVuSansMono-Oblique.ttf: DejaVu Sans Mono:style=Oblique
/usr/share/fonts/TTF/DejaVuSansMono.ttf: DejaVu Sans Mono:style=Book
/usr/share/fonts/TTF/Hack-Bold.ttf: Hack:style=Bold
/usr/share/fonts/TTF/Hack-BoldItalic.ttf: Hack:style=Bold Italic
/usr/share/fonts/TTF/Hack-Italic.ttf: Hack:style=Italic
/usr/share/fonts/TTF/Hack-Regular.ttf: Hack:style=Regular
xterm version is the one shipped with slackware-current, and should be compiled with truetype fonts support:
Code:
$ xterm -v
X.Org 7.7.0(353)

$ ldd /usr/bin/xterm |grep "freetype\|fontconfig"
        libfontconfig.so.1 => /usr/lib64/libfontconfig.so.1 (0x00007f085a28a000)
        libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x00007f085a1ce000)
I can also use "Hack" font in "suckless st" terminal both via .Xresources, but also by command line:

Code:
st -f  Hack:pixelsize=20:antialias=true:autohint=true
Code:
~/.Xresources

st.font:        Hack:pixelsize=20:antialias=true:autohint=true
Any idea why launching xterm with font Hack or DejaVu Sans Mono doesn't work?
Thanks in advance!
 
Old 02-12-2020, 05:59 AM   #2
GazL
LQ Guru
 
Registered: May 2008
Posts: 5,393
Blog Entries: 18

Rep: Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202
slackware-current's xterm uses bitmapped fonts by default╣.
Try setting XTerm.vt100.renderFont: true in your user's Xresources, or edit /etc/X11/app-defaults/XTerm

You can also override it with the -xrm option on the command-line, e.g.:
Code:
xterm -xrm 'XTerm.vt100.renderFont: true' -fa monospace-16

╣ Using bitmapped fonts allows xterm to support Double Height Characters, which is why I like it configured this way, but each to their own.
 
1 members found this post helpful.
Old 02-12-2020, 06:13 AM   #3
Petri Kaukasoina
Member
 
Registered: Mar 2007
Posts: 438

Rep: Reputation: 296Reputation: 296Reputation: 296
You could restore the upstream defaults:
Code:
cp /etc/X11/app-defaults/XTerm.upstream.default /etc/X11/app-defaults/XTerm
 
2 members found this post helpful.
Old 02-12-2020, 06:19 AM   #4
GazL
LQ Guru
 
Registered: May 2008
Posts: 5,393
Blog Entries: 18

Rep: Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202
Yes, that works too. I should have mentioned that. Thanks Petri
 
Old 02-12-2020, 09:20 AM   #5
joenew
Member
 
Registered: Mar 2010
Distribution: slackware 14.2 64bit
Posts: 149

Original Poster
Rep: Reputation: 21
Quote:
Originally Posted by GazL View Post
slackware-current's xterm uses bitmapped fonts by default.
Ok, thanks for your answers folks!

I just copied my Xresources from slackware stable 14.2, where it seems to work fine, I doesn't usually use xterm, so maybe I don't well remember.
Anyway, I've copied a Xresource that apply the "Solarized" color scheme.
It was generic not specific for for xterm:
Code:
*background:              S_base03
*foreground:              S_base0
*fading:                  40
I attached it after latest touches, it seems working now: solarized theme, and faceName regularly defined to Hack font.
It works only if ".vt100." "class" is specified:
The following aren't working
Code:
XTerm*renderFont: true
XTerm*faceName: xft:DejaVu Sans Mono:style=Book
XTerm*faceSize: 16
Instead here below a config that works fine
Code:
XTerm.vt100.renderFont: true
XTerm.vt100.faceName: Hack:style=Regular
XTerm.vt100.faceSize: 18
Why "vt100" specification does the trick?



Are the Xresources "generic" (XTerm*fooBar: value) settings are overwritten by the vt100 specific of global XTerm default in /etc/X11 ?
Code:
$ sed -n '/^XTerm.vt100/p' /etc/X11/app-defaults/XTerm
XTerm.vt100.metaSendsEscape: true
XTerm.vt100.bellIsUrgent: true
XTerm.vt100.renderFont: false
XTerm.vt100.font: -*-terminus-medium-r-normal-*-20-*-*-*-*-*-iso10646-1
XTerm.vt100.font1: -*-terminus-medium-r-normal-*-12-*-*-*-*-*-iso10646-1
XTerm.vt100.font2: -*-terminus-medium-r-normal-*-14-*-*-*-*-*-iso10646-1
XTerm.vt100.font3: -*-terminus-medium-r-normal-*-16-*-*-*-*-*-iso10646-1
XTerm.vt100.font4: -*-terminus-medium-r-normal-*-20-*-*-*-*-*-iso10646-1
XTerm.vt100.font5: -*-terminus-medium-r-normal-*-24-*-*-*-*-*-iso10646-1
XTerm.vt100.font6: -*-terminus-medium-r-normal-*-32-*-*-*-*-*-iso10646-1
XTerm.vt100.faceName: monospace
XTerm.vt100.faceSize: 14.0
Shouldn't be the opposite?
Attached Files
File Type: txt Xresources.TXT (2.3 KB, 1 views)

Last edited by joenew; 02-12-2020 at 09:22 AM.
 
Old 02-12-2020, 09:31 AM   #6
GazL
LQ Guru
 
Registered: May 2008
Posts: 5,393
Blog Entries: 18

Rep: Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202
More specific resource specifications take precedence over those specified using wildcards. So the fully qualified ones in the app-defaults will always take precedence over wildcarded ones supplied by the user.

One might argue that it's a good idea to always use wildcards in the app-defaults file to allow for then to be overwritten by wildcarded resources.

Last edited by GazL; 02-12-2020 at 09:39 AM.
 
Old 02-12-2020, 12:08 PM   #7
joenew
Member
 
Registered: Mar 2010
Distribution: slackware 14.2 64bit
Posts: 149

Original Poster
Rep: Reputation: 21
Ok, thanks again for reply.
I have some other questions about terminals, xterm, st and also GNU screen.. But I'll open a topic for that.
Here I'd just conclude reporting this instruction I added to .Xresources:

Code:
XTerm.termName: xterm-256color
Could that be a good idea for enabling 256 colors support?
 
Old 02-12-2020, 12:11 PM   #8
GazL
LQ Guru
 
Registered: May 2008
Posts: 5,393
Blog Entries: 18

Rep: Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202
Yes, that's a good choice of $TERM when using xterm.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
"xterm -e ls" and then I want that the xterm window wait cstrieder Linux - General 4 01-22-2010 03:39 PM
XTerm(241) support for truetype fonts and method of changing XTerm font. ajassat Linux - Software 2 08-19-2009 01:01 PM
xterm - howto lauch an xterm into a specific directory jobano Linux - Software 8 02-26-2008 04:18 PM
xterm alt becomes compose? Only xterm affected. -0- Linux - Software 0 09-13-2006 12:59 AM
how is black xterm background in IceWM when issue a xterm command? BRAHmS Linux - Software 1 02-14-2005 04:51 AM

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

All times are GMT -5. The time now is 01:03 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration