X11 how to set font size

zctee

New Member
Joined
Jan 14, 2021
Messages
4
Reaction score
2
Credits
47
Dear all,
I am currently working on a new Debian10 X11 environment in arm64, and facing difficulty changing the font size for the setup.
I have an old Debian10 X11 environment in armel which has significantly smaller font.

I tried to run xfd -fa "dejavu", and i get below:
1648775392291.png


In the new Debian10, running xfd -fa "dejavu" and i get below:
1648775412511.png


The width, ascent, and the font size is bigger in the new Debian10.

May i know how can i make the font smaller in X11? I tried to copy over the /etc/fonts folder and /usr/share/fontconfig folder over from old environment to new environment but the font is still the bigger size.

Please help. Thank you.

Regards,
Tee
 


N

NorthWest

Guest
Maybe copy the actual .ttf file that you want into /usr/share/fonts/truetype/dejavu/ <file>.ttf to replace the one you don't want, but leave the rest of the config as original ... that's if I'm understanding the issue :)
 
OP
Z

zctee

New Member
Joined
Jan 14, 2021
Messages
4
Reaction score
2
Credits
47
Maybe copy the actual .ttf file that you want into /usr/share/fonts/truetype/dejavu/ <file>.ttf to replace the one you don't want, but leave the rest of the config as original ... that's if I'm understanding the issue :)
Hi NorthWest,
Thank you for replying. I repaced the whole /usr/share/fonts/truetype/dejavu/ folder, but result still is the same. The font is still big like before.
 
N

NorthWest

Guest
The only other suggestion that comes to mind is to use your home directory for the fonts you prefer. They should take precedence over the fonts installed in the system files. The fonts are usually installed in /home/<username>/.fonts. It might be an idea to reboot when you make changes to fonts so that you know for certain the machine is not using old configs when you make a change. That may not be necessary, but I just mention it as something that I've had to do in the olden days. You may need to attend to the names of fonts so that they don't clash.
 
Last edited by a moderator:
OP
Z

zctee

New Member
Joined
Jan 14, 2021
Messages
4
Reaction score
2
Credits
47
Hi NorthWest,
I found out it is due to the screen resolution. The old system is 72x72 DPI, and new system is 96x96 DPI. Once i do xrandr --dpi 72, the font is the same.
But i not sure how to default the screen to 72x72 DPI from boot up.
One thing to note is my new system do not have /etc/X11/xorg.conf. It does has a /etc/X11/xorg.conf.d/ folder, and in the folder there is a file named 20-modesetting.conf. I tried to change the file to add Option "72 x 72", but nothing is changed.
Do you have any suggestion for me?
 
N

NorthWest

Guest
Okay, good that you got that sorted. Since the xrandr command works to get what you want, there are a number of ways you could have it run at boot time. You could write a systemd script, or use the /etc/rc.local file which systemd will run for you if you create it. You just need to create /etc/rc.local, as root, give it execute permissions like: chmod 775 /etc/rc.local, and just place your xrandr command in that file with nothing else. Systemd will run that executable at the end of the booting process, and it should have its effect. You could alternatively create a config in the xorg,conf.d directory, or write a systemd script, but they are a bit more complicated for what you want to do, though they are more in line with modern system functioning if you want to go that way.

Once you've written the /etc/rc.local file, you don't need to reboot to test it, rather you can just run it like any executable, as root:
./etc/rc.local, to check it. Next boot up should get the same result.
 
Last edited by a moderator:

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
4,782
Reaction score
3,436
Credits
34,814
If you had a font to one of the font directories you need to update the cache by running the following.
Code:
fc-cache
 
N

NorthWest

Guest
If you had a font to one of the font directories you need to update the cache by running the following.
Code:
fc-cache
Recently I added a few free .ttf fonts to the /home/<username>/.fonts/ directory, and without doing anything more than that, they became accessible to the libreoffice GUI. I was surprised at the ease of using the home directory for new fonts. So I tried the same process, simply adding a .ttf font to /usr/share/fonts/truetype/freefont/, and it became accessible system-wide without any more ado.
 
Last edited by a moderator:

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
4,782
Reaction score
3,436
Credits
34,814
Recently I added a few free .ttf fonts to the /home/<username>/.fonts/ directory, and without doing anything more than that, they became accessible to the libreoffice GUI. I was surprised at the ease of using the home directory for new fonts. So I tried the same process, simply adding a .ttf font to /usr/share/fonts/truetype/freefont/, and it became accessible system-wide without any more ado.
Yeah I was wrong it seems it's only to help increase application startup. I actually just always used d it but never looked it up until now.
 
N

NorthWest

Guest
These changes of process are such a luxury these days when configurations are made so much easier to do. Font management used to be very busy with fc-cache, fc-cat, fc-list, fc-match, fc-pattern, fc-query, fc-scan ... but much less so today I've found.
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation

Members online


Top