You are not logged in.

#1 2013-11-15 04:21:46

seb0w
Member
Registered: 2013-03-18
Posts: 4

[SOLVED]font issue in terminal emulator

I have font problems with my terminal emulator. I use URxvt and my shell is zsh. Tmux is automaticaly started with every terminal window.
I changed the .Xresources and added

[[ -f ~/.Xresources ]] && xrdb -merge ~/.Xresources

in my .zprofile that the font fits my needs.
But when I first start URxvt the fonts are much thinner than after the second start. It is really annoying because I have to start URxvt twice at every reboot. The same is true for xTerm.
The settings wich I queried with

xrdb -query -all

are the same for both cases. I think it could be the Xft settings but I could find a solution. Any suggestions what could be the problem?

Here my .Xresources:

! set TERM variable for other programs
*xterm*termName:  xterm-256color

! disable boarder
*xterm*borderWidth: 0

!-- Xft settings -- !
Xft.dpi:        95
Xft.antialias: true
Xft.rgba:       rgb
Xft.hinting:  true
Xft.autohint:  true
Xft.hintstyle: hintfull 

! enable UTF-8
*xterm*locale: true
! more lines to scroll back
*xterm*salveLines: 4096

! customize font
*xterm*faceName: DejaVu Sans Mono for Powerline
*xterm*faceSize: 11

! custom settings
URxvt*loginShell:true
URxvt*transparent:true
URxvt*shading:20

! Molokai theme
URxvt*background: #101010
URxvt*foreground: #d0d0d0
URxvt*color0: #101010
URxvt*color1: #960050
URxvt*color2: #66aa11
URxvt*color3: #c47f2c
URxvt*color4: #30309b
URxvt*color5: #7e40a5
URxvt*color6: #3579a8
URxvt*color7: #9999aa
URxvt*color8: #303030
URxvt*color9: #ff0090
URxvt*color10: #80ff00
URxvt*color11: #ffba68
URxvt*color12: #5f5fee
URxvt*color13: #bb88dd
URxvt*color14: #4eb4fa
URxvt*color15: #d0d0d0

URxvt*cursorColor: #d0d0d0

URxvt*font: xft:DejaVu Sans Mono for Powerline:size=11
URxvt*letterSpace: -2

URxvt*scrollBar: False
URxvt*saveLines: 4069
URxvt*internalBorder: 0

Last edited by seb0w (2013-11-17 23:54:22)

Offline

#2 2013-11-15 12:13:10

Théophane Hufschmitt
Member
Registered: 2013-11-15
Posts: 1

Re: [SOLVED]font issue in terminal emulator

I think the .zprofile isn't sourced when X starts, but only when zsh starts, which means that the .Xresources file is not readen until you start URxvt (or xTerm) for the first time (and is readen after the window is opened, so that the settings are not taken into account).

Depending on which login manager you use, you should consider adding the "[[ -f ~/.Xresources ]] && xrdb -merge ~/.Xresources" into your .xinitrc or any other place that is readen when X start.


(Sorry for my english, it's not my mother tongue)

Offline

#3 2013-11-15 13:13:07

mixer
Member
Registered: 2013-08-16
Posts: 47

Re: [SOLVED]font issue in terminal emulator

Should "Xft.dpi:95" be set to 96?

Offline

#4 2013-11-17 22:21:40

seb0w
Member
Registered: 2013-03-18
Posts: 4

Re: [SOLVED]font issue in terminal emulator

I use zsh as my login shell and start the X11 from my .zprofile. That is why I thought the xrdb command should be executed before I start a terminal emulator. When I put the xrdb command in my .xinitrc nothing happens. I put it on every location in the file. It doesn't make a difference. I changed the dpi to 95 on purpose.

here my .zprofile:

[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startxfce4
[[ -f ~/.Xresources ]] && xrdb -merge ~/.Xresources
setxkbmap -option ctrl:nocaps

and my .xinitrc:

#!/bin/sh
#
# ~/.xinitrc
#

# TMUX
if which tmux 2>&1 >/dev/null; then
    # if no session is started, start a new session
    test -z ${TMUX} && tmux

    # when quitting tmux, try to attach
    while test -z ${TMUX}; do
        tmux attach || break
    done
fi

if [ -f ~/.Xmodmap ]; then
   xmodmap ~/.Xmodmap
fi

if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
  done
  unset f
fi
if [ -f ~/.Xresources]; then
   xrdb -merge ~/.Xresources
fi

and pictures that you can see what's the effect:
http://i.imgur.com/FppAERy.png
http://i.imgur.com/eJWwLWG.png


-- mod edit: read the Forum Etiquette and only post thumbnails http://wiki.archlinux.org/index.php/For … s_and_Code [jwr] --

Offline

#5 2013-11-17 22:31:09

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED]font issue in terminal emulator

Why are you starting tmux in your .xinitrc?  That doesn't make very much sense to me.  Also, you are calling 'exec startxfce4' from your zprofile, which also doesn't make very much sense either.

I think you should go over the wiki and see how things are supposed to be set up. Also the man pages for these files can give you an indication of what goes where and why.

Offline

#6 2013-11-17 23:10:51

bohoomil
Banned
Registered: 2010-09-04
Posts: 2,377
Website

Re: [SOLVED]font issue in terminal emulator

Try turning off autohinting and add

Xft.lcdfilter:  lcddefault

just in case.

Last edited by bohoomil (2013-11-17 23:16:18)


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#7 2013-11-17 23:54:00

seb0w
Member
Registered: 2013-03-18
Posts: 4

Re: [SOLVED]font issue in terminal emulator

removing

Xft.rgba:       rgb

solved the issue

thank you all for you help

Offline

Board footer

Powered by FluxBB