You are not logged in.

#1 2019-01-09 23:55:50

doubleslash
Member
Registered: 2011-08-16
Posts: 65

[SOLVED]HDPI makes my fonts too small

I'm using i3wm and start it with startx through .xinitrc and .Xresources. I followed this guide, but the fonts on my xterm are still unreadable. My .Xresources is

Xft.dpi: 220
Xft.autohint: 0
Xft.lcdfilter:  lcddefault
Xft.hintstyle:  hintfull
Xft.hinting: 1
Xft.antialias: 1
Xft.rgba: rgb

and a snippet of my .xinitrc sources is as follows

userresources=$HOME/.Xresources
if [-f "$userresources"]; then
   xrdb -merge "$userresources"
fi
xrandr --dpi 220
exec i3

Please advise

Last edited by doubleslash (2019-01-10 23:08:06)

Offline

#2 2019-01-10 00:00:05

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 26,865
Website

Re: [SOLVED]HDPI makes my fonts too small

You aren't setting a font size in your XResources...


Moving to NC.


Arch + dwm   •   Mercurial repos  •   Github

Registered Linux User #482438

Offline

#3 2019-01-10 08:14:49

seth
Member
Registered: 2012-09-03
Posts: 10,360

Re: [SOLVED]HDPI makes my fonts too small

Or a font - ensure it's not a bitmap, but a vector one. A 14px bitmap font will always have 14px, no matter your DPI settings.

Offline

#4 2019-01-10 23:07:03

doubleslash
Member
Registered: 2011-08-16
Posts: 65

Re: [SOLVED]HDPI makes my fonts too small

I went on a whirlwind of documents to learn how to set the font size on my terminal emulator. I'm going to summarize what I learned from 3-4 wiki pages here to save someone else from having to go through the same trouble.
First,

seth wrote:

a font - ensure it's not a bitmap, but a vector one.

, you want to install a ttf or otf font. Follow this guide to query for one. For example,

 pacman -Ss ttf

In my case I used adobe-source-code-pro-fonts
The installation will put the font files in a directory like /usr/share/fonts/adobe (the exact name is longer but simplified here)/ Then, let X know the path by creating a .conf under /etc/X11/xorg.conf.d/50-fontpaths.conf ( See here ) Make sure X can see the path by verifying the output of

xset q

. Once that's done, you can configure the font size of urxv (the terminal emulator I happen to use) by putting this line in ~/.Xresources

URxvt.font: xft:SourceCodePro-MediumIt:size=25

The valid names are found in your font directory in the file fonts.dir, which is a text file of two columns

FontNameToBeUsedInXresources  SomeOtherReallyLongname

Now startx and open urxv and you'll see your font. Notice you won't have to learn the long coded name of the bitmap fonts.

Offline

Board footer

Powered by FluxBB