You are not logged in.

#1 2020-09-02 01:16:23

regularuser123
Member
Registered: 2020-06-18
Posts: 6

Setting an specific PCF font as the default font in "st"

The context

Lately, I've been using the fonts from the "extra/xorg-fonts-misc" package.

I'm trying to set "5x7.pcf.gz" (a font from that package) as the default font in "st".

The problem

In order to make "5x7.pcf.gz" the default font in "st", I've tried specifying its corresponding X logical font desription (see below)

$ cat /usr/share/fonts/misc/fonts.dir | grep '^5x7.pcf.gz'
5x7.pcf.gz -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso10646-1

in the "config.h" file (i.e. the file configuration for "st") and compiling it again

$ cd ~/repos/suckless/st
$ grep -R '\-misc-fixed-medium-r-normal--7-70-75-75-c-50-iso10646-1' .
config.h:static char *font = "-misc-fixed-medium-r-normal--7-70-75-75-c-50-iso10646-1";

But this is not making "st" specifically use "5x7.pcf.gz". I can confirm "st" doesn't use "5x7.pcf.gz" but instead use "5x7-ISO8859-1.pcf.gz" (another font present in "extra/xorg-fonts-misc") with the following command

$ make >/dev/null 2>&1 && seq 1 10 | strace ./st exit 2>&1 | grep -P '(\.pcf(\.gz)?|(t|o)tf)'
openat(AT_FDCWD, "/usr/share/fonts/misc/5x7-ISO8859-1.pcf.gz", O_RDONLY) = 4

I've also tried setting

static char *font = "Misc Fixed:pixelsize=7:size=70";

However, this still makes "st" use "5x7-ISO8859.pcf.gz" instead of "5x7.pcf.gz" as can be seen below

$ grep -RI 'Misc Fixed' .
./config.h:static char *font = "Misc Fixed:pixelsize=7:size=70";
$ make >/dev/null 2>&1 && seq 1 10 | strace ./st exit 2>&1 | grep -P '(\.pcf(\.gz)?|(t|o)tf)'
openat(AT_FDCWD, "/usr/share/fonts/misc/5x7-ISO8859-1.pcf.gz", O_RDONLY) = 4
Additional context

When executing "st", I get the following messages

$ ./st
font weight does not match
font weight does not match
The question

Why is "st" loading "5x7-ISO8859-1.pcf.gz" instead of "5x7.pcf.gz"?

How can I make "st" use "5x7.pcf.gz"?

While I'm comfortable with using "5x7-ISO8859-1.pcf.gz", I really want to understand why this is happening.

Last edited by regularuser123 (2020-09-02 01:31:09)

Offline

Board footer

Powered by FluxBB