You are not logged in.

#1 2018-12-08 12:26:32

felixdatboi
Member
Registered: 2018-11-01
Posts: 26

Lost regarding fonts and URxvt

I'm lost when it comes to fonts and am not quite sure what to do.

My Urxvt font is kinda of. Atm I'm not loading any fonts from my .Xresources file and is only specifying colors.

! special
URxvt.foreground:   #d9d8d8
URxvt.background:   #231f20
URxvt.cursorColor:  #d9d8d8

! black
URxvt.color0:       #231f20
URxvt.color8:       #737171

! red
URxvt.color1:       #ee2e24
URxvt.color9:       #ee2e24

! green
URxvt.color2:       #00853e
URxvt.color10:      #00853e

! yellow
URxvt.color3:       #ffd204
URxvt.color11:      #ffd204

! blue
URxvt.color4:       #009ddc
URxvt.color12:      #009ddc

! magenta
URxvt.color5:       #98005d
URxvt.color13:      #98005d

! cyan
URxvt.color6:       #85cebc
URxvt.color14:      #85cebc

! white
URxvt.color7:       #d9d8d8
URxvt.color15:      #ffffff

My first problem is letter spacing. I know that I can change this with

URxvt.letterSpace: xxx

. In my case I have to set it to like -4 for the text to somewhat resemble "normal" text. But then some characters still have to much spacing and some are very smooched together.

In my frustration I have resorted to copy pasteing font configs from various places. So my

.config/fontconfig/fonts.conf

looks like this: 

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>

 <alias>
    <family>serif</family>
    <prefer><family>Linux Libertine</family></prefer>
  </alias>
  <alias>
    <family>sans-serif</family>
    <prefer><family>Linux Biolinum</family></prefer>
  </alias>
  <alias>
    <family>sans</family>
    <prefer><family>Linux Biolinum</family></prefer>
  </alias>
  <alias>
    <family>monospace</family>
    <prefer><family>Inconsolata</family></prefer>
  </alias>

</fontconfig>

I also have a folder

$ ls ~.fonts 
FantasqueSansMono-BoldItalic.ttf  FantasqueSansMono-Bold.ttf  FantasqueSansMono-Italic.ttf  FantasqueSansMono-Regular.ttf

as well as:

$ ls /usr/share/fonts/ 
adobe-source-code-pro  cantarell  croscore  encodings  noto  OTF  TTF  util  Webfonts

I know that I should specify a font in my .Xresources as well.

!! Font prefferenes
URxvt.font: xft:Fantasquei Sansi Mono:pixelsize=15
URxvt.boldFont: xft:Fantasquei Sans Mono:pixelsize=13:weight=bold

But when I removed these lines and merged my Xresources file (xrdb -merge .Xresources) nothing really changed. So that just added to my confusion.

Also, I seem to have unicode problems as well. I get a lot of at on websites.

What would be a good first step into solving this?

Thanks!

Edit: url

https://i.imgur.com/UhM5CWD.png

Last edited by felixdatboi (2018-12-08 13:28:09)

Offline

#2 2018-12-08 13:07:25

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: Lost regarding fonts and URxvt

What would be a good first step into solving this?

Screenshot to explain the problem. Please only post a link or thumbnail.

Offline

#3 2018-12-08 13:28:34

felixdatboi
Member
Registered: 2018-11-01
Posts: 26

Re: Lost regarding fonts and URxvt

seth wrote:

What would be a good first step into solving this?

Screenshot to explain the problem. Please only post a link or thumbnail.


I added a link to a screenshot

Offline

#4 2018-12-08 13:50:48

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,447
Website

Re: Lost regarding fonts and URxvt

felixdatboi wrote:

I'm not loading any fonts from my .Xresources file

That's your first problem.  You need to specify a font.

felixdatboi wrote:

But when I removed these lines and merged my Xresources file (xrdb -merge .Xresources) nothing really changed

Did you restart urxvt after that merge?  It will not change 'on the fly'.

Also with those fonts in your home directory, I'd want to confirm that fc-match finds them.  What is the output of the following:

fc-match "Fantasquei Sansi Mono"

"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2018-12-08 13:56:27

felixdatboi
Member
Registered: 2018-11-01
Posts: 26

Re: Lost regarding fonts and URxvt

Trilby wrote:
felixdatboi wrote:

I'm not loading any fonts from my .Xresources file

That's your first problem.  You need to specify a font.

felixdatboi wrote:

But when I removed these lines and merged my Xresources file (xrdb -merge .Xresources) nothing really changed

Did you restart urxvt after that merge?  It will not change 'on the fly'.

Also with those fonts in your home directory, I'd want to confirm that fc-match finds them.  What is the output of the following:

fc-match "Fantasquei Sansi Mono"

Yea, I do know that I "have to". But how come that it works when I dont, is there somekind of cache? I do restart urxvt after each merge.

I get:

$ fc-match "Fantasquei Sansi Mono"
NotoSans-Regular.ttf: "Noto Sans" "Regular"

Last edited by felixdatboi (2018-12-08 13:56:47)

Offline

#6 2018-12-08 14:04:01

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: Lost regarding fonts and URxvt

The screenshot seems to be just a thumbnail itself?

fc-match Inconsolata

Offline

#7 2018-12-08 14:20:49

felixdatboi
Member
Registered: 2018-11-01
Posts: 26

Re: Lost regarding fonts and URxvt

seth wrote:

The screenshot seems to be just a thumbnail itself?

fc-match Inconsolata
$ fc-match Inconsolata
Inconsolata-Regular.ttf: "Inconsolata" "Regular"

Offline

#8 2018-12-08 14:46:49

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: Lost regarding fonts and URxvt

So you do have the Inconsolata font and it's most likely to be used as font in urxvt (being the default monospace) - sth. we cannot say because you just uploaded a thumbnail.
For clarification: you can only post 200x200 images here, but you should provide full screenshots, preferably png (to avoid jpg artifacts)

However, from what one can guess from the thumbnail, inconsolata is in use and looks pretty "normal" - you're aware of the monospace font concept? All glyhps will cover the same width. The font has to fill the space as elegant as possible.
I btw. doubt that you're merging your xresources, because I tried "-4" and that's ridiculously squeezed (ie. I can't read anything)

Offline

#9 2018-12-09 14:19:47

felixdatboi
Member
Registered: 2018-11-01
Posts: 26

Re: Lost regarding fonts and URxvt

seth wrote:

So you do have the Inconsolata font and it's most likely to be used as font in urxvt (being the default monospace) - sth. we cannot say because you just uploaded a thumbnail.
For clarification: you can only post 200x200 images here, but you should provide full screenshots, preferably png (to avoid jpg artifacts)

However, from what one can guess from the thumbnail, inconsolata is in use and looks pretty "normal" - you're aware of the monospace font concept? All glyhps will cover the same width. The font has to fill the space as elegant as possible.
I btw. doubt that you're merging your xresources, because I tried "-4" and that's ridiculously squeezed (ie. I can't read anything)

Ok, sorry for that.

I have not heard of the monospace concept. Have read up on it now. So yeah, then It seems that it looks "normal". From this I can conclude that I do not want a monospaced font in my terminal. Yea I think I had it to -2, I exaggerated a little due to frustration, sorry.

I have been trying to configuring this some more but still not found any solutions.

Say that I have a font in my /usr/share/fonts folder that I want to try out( i.e set in my Xresources). How do i find the correct name to use in the URxvt.font field?

Another unrelated question. Right now I'm using https://github.com/daedreth/URXVTConfig to generate colors. The colors are being set as

*.color: <hex-color>

But this syntax does not seem to work. If I switch the * sign to URxvt instead. It does work.

Do I have to add anything to reference the * to URxvt?

Thanks for the help.

Offline

#10 2018-12-09 14:31:07

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,447
Website

Re: Lost regarding fonts and URxvt

felixdatboi wrote:

I do not want a monospaced font in my terminal.

You will.  Some terminals will not even allow a non-monospaced font - they may use the glyphs from a proportional font but force them in to a monospace grid.  There is a reason for this.  There are many reasons for this.

felixdatboi wrote:

Another unrelated question.

Don't do that


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#11 2018-12-09 14:35:55

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Lost regarding fonts and URxvt

felixdatboi wrote:

From this I can conclude that I do not want a monospaced font in my terminal.

You really do want a monospace font for your terminal. Without it any program that outputs any sort of formatted text will look terrible.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#12 2018-12-09 15:01:20

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: Lost regarding fonts and URxvt

fc-list :mono

will print a list of available monospace fonts along the filenames (you could grep for a specific one)
As has been pointed out to you, but to stress that: using proportional fonts in a terminal is a terrible idea. Look for a monospace font that you like and ideally try them w/ unaltered letterspace. Then try to "fix" the letterspace for your pick if required.

Offline

#13 2018-12-09 15:04:28

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,447
Website

Re: Lost regarding fonts and URxvt

seth that command will not list any bitmap fonts (perhaps only ttf fonts).  Many very good monospace fonts will be just bitmap.  E.g.,

$ fc-list :mono
/usr/share/fonts/TTF/PTM75F.ttf: PT Mono:style=Bold
/usr/share/fonts/TTF/DejaVuSansMono.ttf: DejaVu Sans Mono:style=Book
/usr/share/fonts/TTF/cour.ttf: Courier New:style=Regular,Normal,obyčejné,Standard,Κανονικά,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Normálne,Navadno,thường,Arrunta
/usr/share/fonts/TTF/courbi.ttf: Courier New:style=Bold Italic,Negreta cursiva,tučné kurzíva,fed kursiv,Fett Kursiv,Έντονα Πλάγια,Negrita Cursiva,Lihavoitu Kursivoi,Gras Italique,Félkövér dőlt,Grassetto Corsivo,Vet Cursief,Halvfet Kursiv,Pogrubiona kursywa,Negrito Itálico,Полужирный Курсив,Tučná kurzíva,Fet Kursiv,Kalın İtalik,Krepko poševno,Lodi etzana
/usr/share/fonts/TTF/andalemo.ttf: Andale Mono:style=Regular,Normal,obyčejné,Standard,Κανονικά,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Normálne,Navadno,Arrunta
/usr/share/fonts/TTF/DejaVuSansMono-Oblique.ttf: DejaVu Sans Mono:style=Oblique
/usr/share/fonts/TTF/PTM55F.ttf: PT Mono:style=Regular
/usr/share/fonts/TTF/couri.ttf: Courier New:style=Italic,Cursiva,kurzíva,kursiv,Πλάγια,Kursivoitu,Italique,Dőlt,Corsivo,Cursief,Kursywa,Itálico,Курсив,İtalik,Poševno,nghiêng,Etzana
/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/courbd.ttf: Courier New:style=Bold,Negreta,tučné,fed,Fett,Έντονα,Negrita,Lihavoitu,Gras,Félkövér,Grassetto,Vet,Halvfet,Pogrubiony,Negrito,Полужирный,Fet,Kalın,Krepko,đậm,Lodia

$ fc-list :mono | grep -i term

$ fc-match "xos4 Terminus"
ter-x12n.pcf.gz: "xos4 Terminus" "Regular"

"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#14 2018-12-09 15:04:31

felixdatboi
Member
Registered: 2018-11-01
Posts: 26

Re: Lost regarding fonts and URxvt

Slithery wrote:
felixdatboi wrote:

From this I can conclude that I do not want a monospaced font in my terminal.

You really do want a monospace font for your terminal. Without it any program that outputs any sort of formatted text will look terrible.

Alright. I try to fix that then. However, I dont want gaps between my "l" and "i" characters. I want text that is easy to read.

As far as i understood monospaced is that the space a char takes up is the same, no matter what char. So an i will take up equally amount of space as an M. So there will always be hughe gaps between slim chars?

Offline

#15 2018-12-09 15:07:06

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,447
Website

Re: Lost regarding fonts and URxvt

felixdatboi wrote:

As far as i understood monospaced is that the space a char takes up is the same, no matter what char. So an i will take up equally amount of space as an M. So there will always be hughe gaps between slim chars?

This is true of monospace layout regardless of the font.  Monospace fonts are specifically designed to look good with monospace layout.  If you force a proportional (non-monospace) font into a monospace layout grid, it will look truly horrible.  But there are many well designed monospace fonts that look wonderful.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#16 2018-12-09 16:20:31

felixdatboi
Member
Registered: 2018-11-01
Posts: 26

Re: Lost regarding fonts and URxvt

This is true of monospace layout regardless of the font.  Monospace fonts are specifically designed to look good with monospace layout.  If you force a proportional (non-monospace) font into a monospace layout grid, it will look truly horrible.  But there are many well designed monospace fonts that look wonderful.

Yeah, that far I have understood. If i run

$ fc-match monospace
NotoSans-Regular.ttf: "Noto Sans" "Regular"

How can I change this to a monospaced font?

Offline

#17 2018-12-09 16:23:30

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: Lost regarding fonts and URxvt

Installing one should already suffice, otherwise https://wiki.archlinux.org/index.php/Fo … ault_fonts
~/.config/fontconfig/conf.d/99-monospace.conf

<?xml version="1.0"?><!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
    <alias>
        <family>monospace</family>
        <prefer><family>Source Code Pro</family></prefer>
    </alias>
</fontconfig>

assuming you wanted source code pro to be your default monospace font

Offline

#18 2018-12-09 16:48:51

felixdatboi
Member
Registered: 2018-11-01
Posts: 26

Re: Lost regarding fonts and URxvt

seth wrote:

Installing one should already suffice, otherwise https://wiki.archlinux.org/index.php/Fo … ault_fonts
~/.config/fontconfig/conf.d/99-monospace.conf

<?xml version="1.0"?><!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
    <alias>
        <family>monospace</family>
        <prefer><family>Source Code Pro</family></prefer>
    </alias>
</fontconfig>

assuming you wanted source code pro to be your default monospace font

I downloaded Source Code Pro and set it in my .Xresources so now my terminal looks nice. Thanks.

I added the file u posted and restarted my x-server (mod+shift+r) but i still get:

$ fc-match monospace
NotoSans-Regular.ttf: "Noto Sans" "Regular"

Offline

#19 2018-12-09 16:50:17

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,447
Website

Re: Lost regarding fonts and URxvt

felixdatboi wrote:

I downloaded Source Code Pro

Downloaded?  By this do you mean you installed the package from the repos with pacman?  If not, you did it wrong.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#20 2018-12-09 16:51:49

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: Lost regarding fonts and URxvt

That aside:

fc-match "Source Code Pro"
fc-conflist

Offline

#21 2018-12-09 17:03:19

felixdatboi
Member
Registered: 2018-11-01
Posts: 26

Re: Lost regarding fonts and URxvt

Trilby wrote:
felixdatboi wrote:

I downloaded Source Code Pro

Downloaded?  By this do you mean you installed the package from the repos with pacman?  If not, you did it wrong.

Yes, sry for the confusion.

$ fc-match "Source Code Pro"
SourceCodePro-Regular.ttf: "Source Code Pro" "Regular"
$ fc-conflist
+ /etc/fonts/conf.d/10-hinting-slight.conf: Set hintslight to hintstyle
+ /etc/fonts/conf.d/10-scale-bitmap-fonts.conf: Bitmap scaling
+ /etc/fonts/conf.d/10-sub-pixel-rgb.conf: Enable sub-pixel rendering with the RGB stripes layout
+ /etc/fonts/conf.d/11-lcdfilter-default.conf: Use lcddefault as default for LCD filter
+ /etc/fonts/conf.d/20-unhint-small-dejavu-sans-mono.conf: No description
+ /etc/fonts/conf.d/20-unhint-small-dejavu-sans.conf: No description
+ /etc/fonts/conf.d/20-unhint-small-dejavu-serif.conf: No description
+ /etc/fonts/conf.d/20-unhint-small-vera.conf: Disable hinting for Bitstream Vera fonts when the size is less than 8ppem
+ /etc/fonts/conf.d/30-metric-aliases.conf: Set substitutions for similar/metric-compatible families
+ /etc/fonts/conf.d/40-nonlatin.conf: Set substitutions for non-Latin fonts
+ /etc/fonts/conf.d/45-generic.conf: Set substitutions for emoji/math fonts
+ /etc/fonts/conf.d/45-latin.conf: Set substitutions for Latin fonts
+ /etc/fonts/conf.d/49-sansserif.conf: Add sans-serif to the family when no generic name
+ /home/felix/.config/fontconfig/conf.d/99-monospaced.conf: No description
+ /home/felix/.config/fontconfig/fonts.conf: No description
+ /etc/fonts/conf.d/50-user.conf: Load per-user customization files
+ /etc/fonts/local.conf: No description
+ /etc/fonts/conf.d/51-local.conf: Load local customization file
+ /etc/fonts/conf.d/57-dejavu-sans-mono.conf: No description
+ /etc/fonts/conf.d/57-dejavu-sans.conf: No description
+ /etc/fonts/conf.d/57-dejavu-serif.conf: No description
+ /etc/fonts/conf.d/60-generic.conf: Set preferable fonts for emoji/math fonts
+ /etc/fonts/conf.d/60-latin.conf: Set preferable fonts for Latin
+ /etc/fonts/conf.d/65-fonts-persian.conf: No description
+ /etc/fonts/conf.d/65-nonlatin.conf: Set preferable fonts for non-Latin
+ /etc/fonts/conf.d/69-unifont.conf: No description
+ /etc/fonts/conf.d/70-no-bitmaps.conf: Reject bitmap fonts
+ /etc/fonts/conf.d/80-delicious.conf: No description
+ /etc/fonts/conf.d/81-ubuntu.conf: No description
+ /etc/fonts/conf.d/90-synthetic.conf: No description
+ /etc/fonts/fonts.conf: Default configuration file
- /etc/fonts/conf.avail/10-autohint.conf: Enable autohinter
- /etc/fonts/conf.avail/10-hinting-full.conf: Set hintfull to hintstyle
- /etc/fonts/conf.avail/10-hinting-medium.conf: Set hintmedium to hintstyle
- /etc/fonts/conf.avail/10-hinting-none.conf: Set hintnone to hintstyle
- /etc/fonts/conf.avail/10-no-sub-pixel.conf: Disable sub-pixel rendering
- /etc/fonts/conf.avail/10-sub-pixel-bgr.conf: Enable sub-pixel rendering with the BGR stripes layout
- /etc/fonts/conf.avail/10-sub-pixel-vbgr.conf: Enable sub-pixel rendering with the vertical BGR stripes layout
- /etc/fonts/conf.avail/10-sub-pixel-vrgb.conf: Enable sub-pixel rendering with the vertical RGB stripes layout
- /etc/fonts/conf.avail/10-unhinted.conf: Disable hinting
- /etc/fonts/conf.avail/11-lcdfilter-legacy.conf: Use lcdlegacy as default for LCD filter
- /etc/fonts/conf.avail/11-lcdfilter-light.conf: Use lcdlight as default for LCD filter
- /etc/fonts/conf.avail/25-unhint-nonlatin.conf: Disable hinting for CJK fonts
- /etc/fonts/conf.avail/30-ttf-liberation-mono.conf: No description
- /etc/fonts/conf.avail/30-ttf-liberation-sans.conf: No description
- /etc/fonts/conf.avail/30-ttf-liberation-serif.conf: No description
- /etc/fonts/conf.avail/65-khmer.conf: No description
- /etc/fonts/conf.avail/66-noto-mono.conf: No description
- /etc/fonts/conf.avail/66-noto-sans.conf: No description
- /etc/fonts/conf.avail/66-noto-serif.conf: No description
- /etc/fonts/conf.avail/70-yes-bitmaps.conf: Accept bitmap fonts
- /etc/fonts/conf.avail/75-ttf-inconsolata.conf: No description

Offline

#22 2018-12-09 17:07:39

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: Lost regarding fonts and URxvt

Contents of /home/felix/.config/fontconfig/fonts.conf ?
Also to be sure: you didn't misspell "monospace"?

Offline

#23 2018-12-09 17:11:29

felixdatboi
Member
Registered: 2018-11-01
Posts: 26

Re: Lost regarding fonts and URxvt

seth wrote:

Contents of /home/felix/.config/fontconfig/fonts.conf ?
Also to be sure: you didn't misspell "monospace"?

font.conf

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <match target="font">
    <edit name="antialias" mode="assign">
      <bool>true</bool>
    </edit>
  </match>
  <match target="font">
    <edit name="rgba" mode="assign">
      <const>rgb</const>
    </edit>
  </match>
  <match target="font">
    <edit name="lcdfilter" mode="assign">
      <const>lcddefault</const>
    </edit>
  </match>
  <match target="font">
    <edit name="hinting" mode="assign">
      <bool>true</bool>
    </edit>
  </match>
  <match target="font">
    <edit name="hintstyle" mode="assign">
      <const>hintfull</const>
    </edit>
  </match>
  <match target="font">
    <edit name="autohint" mode="assign">
      <bool>false</bool>
    </edit>
  </match>
  <match target="pattern">
    <edit name="dpi" mode="assign">
      <double>108</double>
    </edit>
  </match>
</fontconfig>

Could I move my newly created
/home/felix/.config/fontconfig/conf.d/99-monospaced.conf

to all the others in
/etc/fonts/conf.d

Offline

#24 2018-12-09 22:53:14

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: Lost regarding fonts and URxvt

You could, but it doesn't really belong there. Also the file is read, why noto is resolved is beyond me (unless there's some typo somewhere).

fc-match -s monospace

Offline

Board footer

Powered by FluxBB