1

I've tried customizing zsh's prompt with change the font but during it, xterm become not to reflect the XTerm*faceName in~/.Xresources.

Here is my dot files:

~/.xinitrc

#!/bin/sh

# /etc/X11/xinit/xinitrc
#
# global xinitrc file, used by all X sessions started by xinit(startx)

# invoke global X session script
. /etc/X11/Xsession

xrdb -merge $HOME/.Xresources
exec awesome 

~/.Xresources

XTerm*termName: xterm-256color
XTerm*locale:   true
XTerm*selectToClipboard:    true
XTerm*faceName: Shure Tech Mono Nerd Font Complete
XTerm*faceSize: 12

!TomorrowNightEighties
#define t_background        #2d2d2d
#define t_current_line      #393939
#define t_selection         #515151
#define t_foreground        #cccccc
#define t_comment           #999999
#define t_red               #f2777a
#define t_orange            #f99157
#define t_yellow            #ffcc66
#define t_green             #99cc99
#define t_aqua              #66cccc
#define t_blue              #6699cc
#define t_purple            #cc99cc


*.foreground:   t_foreground
*.background:   t_background
*.cursorColor:  #aeafad

! Black / Grey
*.color0:       #000000
*.color8:       #666666

! Red / Bright Red
*.color1:       t_red
*.color9:       #FF3334

! Green + Bright Green
*.color2:       t_green
*.color10:      #9ec400

! Yellow (Orange) + Bright Yellow (Yellow)
*.color3:       t_orange
*.color11:      t_yellow

! Blue + Bright Blue
*.color4:       t_blue
*.color12:      t_blue

! Magenta (Purple) + Bright Magenta
*.color5:       t_purple
*.color13:      #b777e0

! Cyan (Aqua) + Bright Cyan
*.color6:       t_aqua
*.color14:      #54ced6

! Light Grey (Selection) + White (Current Line)
*.color7:       t_selection
*.color15:      t_current_line

Here is the screenshot:

The screenshot: left is the true font I want but actually show as right

Although I'd already restart vm (= restart X), the font was still old one although other elements like theme were reflected properly.

Other information:

Ubuntu 18.04 on vmware

awesomewm as a window manager

zsh as shell

  • Looking at the manpage, faceName requires FreeType support compiled into xterm. No idea if your version of xterm has that. Does font etc. work (with the usual bitmap fonts)? – dirkt Dec 7 '18 at 11:44
  • I tried writing "XTerm.font = Shure Tech.." and restarting, but the result is the same. Also, I tried xterm -fa "Shure Tech..." and xterm -fn "Shure Tech..." and both are same, old font was shown. – Szkieletor Dec 7 '18 at 13:02
  • If "Shure Tech ..." isn't a bitmap font, this won't work. Run xfontsel or xlsfonts, pick a standard font that's installed, e.g. -misc-fixed-medium-*, try *.font: misc-fixed-medium-* or xterm -fn 'misc-fixed-medium-*' (but use a proper size). This won't tell you if faceName works, if will tell you only whether you can set fonts in principle. Next step is to use FreeType tools to list your installed fonts, and try one of those with faceName. – dirkt Dec 7 '18 at 13:28
1

The relevant font family name is ShureTechMono NF, which you can find using fc-list. Here is a screenshot. xterm using ShureTechMono NF

The fc-list manual page suggests this command (: matches everything, the family parameter shows the face-family used by xterm):

fc-list : family

The xterm manual page entry for faceName also gives an example using fc-list:

fc-list :scalable=true:spacing=mono: family
  • This, fc-list : family works for me. The problem occured by using fc-list : file | grep "Shure" = Shure Tech Mono... but fc-list : family | grep "Shure" suggests ShureTechMono... (=no space between these three). After I follow it, the font get changed (I need Nerd Font in order to use plugin). – Szkieletor Dec 8 '18 at 4:18
0

Have you tried using the -fn parameter, and entering the font name using Pango notation e.g. ShureTechMono\ Nerd\ Font\ Regular:px=11

I've done it this way, with a different font, trial-and-error style, before I made the final entry in .Xresources. In this example, I would not use "Complete" but "Regular" as shown explicitly in the pic.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.