# How to increase the default font size?



## user6020 (Dec 5, 2019)

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 (Dec 5, 2019)

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.


----------



## Deleted member 48958 (Dec 5, 2019)

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:

```
! Xft --------------------------------------------------
Xft.dpi:					96
Xft.autohint:				0
Xft.antialias:				1
Xft.hinting:				1
Xft.rgba:					rgb
Xft.hintstyle:				hintslight
Xft.lcdfilter:				lcddefault
```


----------



## user6020 (Dec 5, 2019)

ILUXA said:


> 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:
> 
> ...



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.



SirDice said:


> 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.


----------



## Deleted member 48958 (Dec 5, 2019)

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 (Dec 5, 2019)

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 (Dec 5, 2019)

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) 

```
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 
	
	



```
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.


----------



## user6020 (Dec 5, 2019)

ILUXA said:


> 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.


Sevendogsbsd said:


> 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 (Dec 5, 2019)

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.


----------



## user6020 (Dec 6, 2019)

Sevendogsbsd said:


> 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
> 
> ...



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 (Dec 6, 2019)

user6020 said:


> 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:

```
[    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:

```
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 (Dec 6, 2019)

user6020 said:


> 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?


----------



## Deleted member 30996 (Dec 6, 2019)

The desktop apps I use, www/firefox-esr, x11/rxvt-unicode, x11-fm/xfe, sysutils/gkrellm2, etc. all use their own font scheme. 

I change everything except Firefox to Courier and adjust size accordingly for symmetry.


----------



## Deleted member 48958 (Dec 6, 2019)

Trihexagonal said:


> 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.


----------



## Deleted member 30996 (Dec 6, 2019)

I don't have a ~/.Xresources. I use a ~/.Xdefaults to change fonts in urxvt.


----------



## Deleted member 48958 (Dec 6, 2019)

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 (Dec 6, 2019)

I just put this in my ~/.xinitrc:

```
[ -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 (Feb 8, 2021)

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


----------

