How to increase the default font size?

user6020

New Member

Reaction score: 1
Messages: 12

The font size in a few places is too small:
- The terminal. This doesn't happen with OpenBSD or with Linux, the default font size there is useful from the start.
- Some websites that do not set font size and use the default (eg duckduckgo) display smaller text, using a browser that also doesn't change default font size.
- The text during boot and in the system console is smaller than in other OSes. (Is Xorg getting the default font size from the system?)

I do not wish to change the resolution (1920x1080), since everything else is of proper size, it only affects some text that uses the default font size, I assume. How can I change the font size in xorg so that the apps show readable text?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 10,590
Messages: 36,209

There isn't really a 'default' font. Depending on which terminal application you refer to it's going to depend on how to set its font. For the traditional xterm you can set a font (and its size) using X resources. Gnome Terminal has its own settings in preferences, same for KDE terminal.

For terminal applications I prefer to set it to x11-fonts/terminus-font as it's a nice clean fixed-width font.
 

ILUXA

Aspiring Daemon

Reaction score: 566
Messages: 743

If you're using simple window manager and want all font sizes to look nice in all applications, while using X,
add " Xft.dpi: 96" to your ~/.Xresources file, also add xrdb -merge ~/.Xresources to WM autostart.
Some additional default xft settings may be also configured via ~/.Xresources file:
Code:
! Xft --------------------------------------------------
Xft.dpi:					96
Xft.autohint:				0
Xft.antialias:				1
Xft.hinting:				1
Xft.rgba:					rgb
Xft.hintstyle:				hintslight
Xft.lcdfilter:				lcddefault
 
OP
U

user6020

New Member

Reaction score: 1
Messages: 12

If you're using simple window manager and want all font sizes to look nice in all applications, while using X,
add " Xft.dpi: 96" to your ~/.Xresources file, also add xrdb -merge ~/.Xresources to WM autostart.
Some additional default xft settings may be also configured via ~/.Xresources file:
Code:
! Xft --------------------------------------------------
Xft.dpi:                    96
Xft.autohint:                0
Xft.antialias:                1
Xft.hinting:                1
Xft.rgba:                    rgb
Xft.hintstyle:                hintslight
Xft.lcdfilter:                lcddefault

Thanks for answering. I've tried what you suggested, but the font size of both the terminal and duckduckgo didn't change, they are still small. What did increase is the height and text size of the WM panel/taskbar.

There isn't really a 'default' font. Depending on which terminal application you refer to it's going to depend on how to set its font. For the traditional xterm you can set a font (and its size) using X resources. Gnome Terminal has its own settings in preferences, same for KDE terminal.

For terminal applications I prefer to set it to x11-fonts/terminus-font as it's a nice clean fixed-width font.

The thing is I've used the exact same setup in OpenBSD and Linux and never had to deal with any font size issues. I don't see how that's an app's problem.
 

ILUXA

Aspiring Daemon

Reaction score: 566
Messages: 743

You should relogin after adding xrdb -merge ~/.Xresources to your WM startup script, or to ~/.xinitrc, if you're using startx to start X server. This will fix font size in GUI applications, to change font size in terminal emulators or panels, see its manual pages for the "how to".
 

Sevendogsbsd

Daemon

Reaction score: 603
Messages: 1,054

You can't say "default" with respect to fonts in FreeBSD because there is no visual environment installed by default in FreeBSD. You have to do all of the installation and configuration yourself. None of the packages for xorg are part of the base OS. You cannot compare OpenBSD and Linux because they are apples and oranges. Linux especially so.
 

scottro

Daemon

Reaction score: 726
Messages: 1,819

Are you using a hires display? I have a hires yoga2 laptop, and I give a few tips on dealing with the hires on my page http://srobb.net/yoga2.html

In a nutshell, you can try increasing that dpi to 192 and giving a font size in .Xdefaults, like (if you have the terminus font)
Code:
URxvt*font:xft:Terminus:size=24
The ArchLinux wiki has an article as well. https://wiki.archlinux.org/index.php/HiDPI

You can also use xrandr. I tend to use, on my yoga2
Code:
xrandr --output eDP1 --scale .7x.7
(The lower the number, the bigger the font). As for console, https://lme.postach.io/post/changing-console-resolution-in-freebsd-10-with-vt-4 gives some tips that worked for me.
 
OP
U

user6020

New Member

Reaction score: 1
Messages: 12

You should relogin after adding xrdb -merge ~/.Xresources to your WM startup script, or to ~/.xinitrc, if you're using startx to start X server. This will fix font size in GUI applications, to change font size in terminal emulators or panels, see its manual pages for the "how to".

That's what I did, and the panel of the WM increased in height, which this means that the configuration was recognized. However, the font size in the terminal and in duckduckgo didn't change.
You can't say "default" with respect to fonts in FreeBSD because there is no visual environment installed by default in FreeBSD. You have to do all of the installation and configuration yourself. None of the packages for xorg are part of the base OS. You cannot compare OpenBSD and Linux because they are apples and oranges. Linux especially so.

Xorg isn't installed by default on OpenBSD nor Void Linux (the one I used), you just install the package the same as with FreeBSD. The difference is I haven't experienced these font size issues with OpenBSD or Void. Maybe when Xorg is installed there is some background configuration that FreeBSD doesn't do, but that's strange, since OpenBSD and Void try to do the minimum configuration.
 

Sevendogsbsd

Daemon

Reaction score: 603
Messages: 1,054

FreeBSD doesn't configure any software outside of base, that's up to the user. OpenBSD offers to install xorg at install time and void does install xorg because I just installed void a week ago using a default live instance - perhaps one of the other install media does not but the live ones with desktops do install xorg.

All I am saying is that FreeBSD is not like Linux or other BSDs - it is up to the user to do all software configuration after the base install. https://forums.freebsd.org/threads/why-is-freebsd-not-more-like.66591/#post-393755

Perhaps I should clarify something I didn't state: the OS and end user apps are virtually seperated in FreeBSD, with different sets of tools to manage each. I can't speak to how OpenBSD does it because I only installed it once. Linux is all together: there is no differentiation between the OS and end user software. Given that, once FreeBSD is. installed, the end user has to install xorg, a desktop,, etc, depending on intended usage. No configuration is done automatically to any of the user installed applications.

Hope that explains a bit more why FreeBSD is the way it is. I am not trying to be adversarial at all, it's just that folks who have never used FreeBSD sometimes expect it to be like Linux concerning an 'all in one package' and it is not.
 
OP
U

user6020

New Member

Reaction score: 1
Messages: 12

FreeBSD doesn't configure any software outside of base, that's up to the user. OpenBSD offers to install xorg at install time and void does install xorg because I just installed void a week ago using a default live instance - perhaps one of the other install media does not but the live ones with desktops do install xorg.

All I am saying is that FreeBSD is not like Linux or other BSDs - it is up to the user to do all software configuration after the base install. https://forums.freebsd.org/threads/why-is-freebsd-not-more-like.66591/#post-393755

Perhaps I should clarify something I didn't state: the OS and end user apps are virtually seperated in FreeBSD, with different sets of tools to manage each. I can't speak to how OpenBSD does it because I only installed it once. Linux is all together: there is no differentiation between the OS and end user software. Given that, once FreeBSD is. installed, the end user has to install xorg, a desktop,, etc, depending on intended usage. No configuration is done automatically to any of the user installed applications.

Hope that explains a bit more why FreeBSD is the way it is. I am not trying to be adversarial at all, it's just that folks who have never used FreeBSD sometimes expect it to be like Linux concerning an 'all in one package' and it is not.

Thanks, I understand. What do you think is the problem here? Is the font size small because of xorg, or because of the apps? A priori it would seems that it falls on xorg, since the apps are the same and have the same configuration in other OSes, and the only difference would be how xorg is configured. How may xorg be configured to solve this problem? Any tips would be appreciated.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 10,590
Messages: 36,209

A priori it would seems that it falls on xorg
Actually Xorg has very little to do with this. The only thing you do with Xorg is configure the various font directories. You can't configure much else regarding the usage of fonts. What you do need to check in /var/log/Xorg.0.log are the font directories:
Code:
[    34.994] (**) FontPath set to:
        /usr/local/share/fonts/terminus-font/,
        /usr/local/share/fonts/dejavu/,
        /usr/local/share/fonts/misc/,
        /usr/local/share/fonts/TTF/,
        /usr/local/share/fonts/OTF/,
        /usr/local/share/fonts/Type1/,
        /usr/local/share/fonts/100dpi/,
        /usr/local/share/fonts/75dpi/
And verify you actually have a bunch of Xorg fonts installed:
Code:
dice@williscorto:~ % pkg version -vx xorg-font
xorg-fonts-7.7_1                   =   up-to-date with remote
xorg-fonts-100dpi-7.7              =   up-to-date with remote
xorg-fonts-75dpi-7.7               =   up-to-date with remote
xorg-fonts-cyrillic-7.7            =   up-to-date with remote
xorg-fonts-miscbitmaps-7.7         =   up-to-date with remote
xorg-fonts-truetype-7.7_1          =   up-to-date with remote
xorg-fonts-type1-7.7               =   up-to-date with remote
For Firefox it often helps to install x11-fonts/webfonts, that font directory will need to be added to the FontPath.
 

Sevendogsbsd

Daemon

Reaction score: 603
Messages: 1,054

Thanks, I understand. What do you think is the problem here? Is the font size small because of xorg, or because of the apps? A priori it would seems that it falls on xorg, since the apps are the same and have the same configuration in other OSes, and the only difference would be how xorg is configured. How may xorg be configured to solve this problem? Any tips would be appreciated.

This made me think: what is your monitor resolution? Are you using a 4k monitor and on a laptop maybe?
 

ILUXA

Aspiring Daemon

Reaction score: 566
Messages: 743

I change everything except Firefox to Courier and adjust size accordingly for symmetry.
It's better to use " Xft.dpi: 96" in ~/.Xresources, because font size from user interface in many applications is in its default size and connot be configured via application settings, while "Xft.dpi" setting will set all xft font size everywhere in your X session. And with all kinds of applications, like Qt, GTK, whatever. In modern desktop environments, "settings-daemon" set this setting, but in custom DE with custom WM this should be done manually.
 

ILUXA

Aspiring Daemon

Reaction score: 566
Messages: 743

No matter what file name to use, just add xrdb -merge /path/to/your_file to your WM autostart.
It may be called even ~/.blablabla and xrdb -merge ~/.blablabla will work fine.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 10,590
Messages: 36,209

I just put this in my ~/.xinitrc:
Code:
[ -f "${HOME}/.Xresources" ] && xrdb "${HOME}/.Xresources"

If I recall correctly .Xdefaults and .Xresources are automatically loaded but at different stages. I just circumvent the 'automagic' behavior and explicitly load it.
 

debguy

Active Member

Reaction score: 23
Messages: 225

If you have a large screen (say, 43" TV) and installing recent freeBSD, this is nice quick way and it plays as a base for VT font menu also:

xterm -fa 'DejaVu Sans Mono' -fs 40
 
Top