< < <

Configurable system fonts for Mono

The font family and font size of Monos system fonts are hard-wired into the SystemFonts.cs class. So if you don't like these defaults, there is no simple way to change them. Not really helpful. To make things a bit easier, the patch below allows you to change these font settings with a couple of environment variables.

Example

Unpatched Mono:
$ which mono
/opt/mono-2.11/bin/mono
$ mono /opt/keepass/KeePass.exe
Patched Mono:
$ export MONO_DEFAULTFONT="Bitstream Vera Sans"
$ export MONO_DEFAULTFONT_SIZE=12
$ which mono
/opt/mono-2.11/bin/mono
$ mono /opt/keepass/KeePass.exe

Patching Mono

Mono 2.10:
$ umask 0022
$ cd /usr/src
$ wget http://download.mono-project.com/sources/mono/mono-2.10.9.tar.bz2
$ tar -jxvf mono-2.10.9.tar.bz2
$ wget http://www.vakuumverpackt.de/configurablesystemfontsformono/mono-2.10-configurable-system-fonts.patch
$ cd mono-2.10.9
$ patch -p1 < ../mono-2.10-configurable-system-fonts.patch
$ ./configure --prefix=/opt/mono-2.10.9
$ make
$ make install
$ ln -sf /opt/mono-2.10.9 /opt/mono-2.10
$ /opt/mono-2.10/bin/mono --version
Mono 2.11:
$ umask 0022
$ cd /usr/src
$ wget http://download.mono-project.com/sources/mono/mono-2.11.4.tar.bz2
$ tar -jxvf mono-2.11.4.tar.bz2
$ wget http://www.vakuumverpackt.de/configurablesystemfontsformono/mono-2.11-configurable-system-fonts.patch
$ cd mono-2.11.4
$ patch -p1 < ../mono-2.11-configurable-system-fonts.patch
$ ./configure --prefix=/opt/mono-2.11.4
$ make
$ make install
$ ln -sf /opt/mono-2.11.4 /opt/mono-2.11
$ /opt/mono-2.11/bin/mono --version
Mono 3.0:
$ umask 0022
$ cd /usr/src
$ wget http://download.mono-project.com/sources/mono/mono-3.0.1.tar.bz2
$ tar -jxvf mono-3.0.1.tar.bz2
$ wget http://www.vakuumverpackt.de/configurablesystemfontsformono/mono-3.0-configurable-system-fonts.patch
$ cd mono-3.0.1
$ patch -p1 < ../mono-3.0-configurable-system-fonts.patch
$ ./configure --prefix=/opt/mono-3.0.1
$ make
$ make install
$ ln -sf /opt/mono-3.0.1 /opt/mono-3.0
$ /opt/mono-3.0/bin/mono --version

Environment variables

Font Variable
CaptionFont MONO_CAPTIONFONT
MONO_CAPTIONFONT_SIZE
DefaultFont MONO_DEFAULTFONT
MONO_DEFAULTFONT_SIZE
DialogFont MONO_DIALOGFONT
MONO_DIALOGFONT_SIZE
IconTitleFont MONO_ICONTITLEFONT
MONO_ICONTITLEFONT_SIZE
MenuFont MONO_MENUFONT
MONO_MENUFONT_SIZE
MessageBoxFont MONO_MESSAGEBOXFONT
MONO_MESSAGEBOXFONT_SIZE
SmallCaptionFont MONO_SMALLCAPTIONFONT
MONO_SMALLCAPTIONFONT_SIZE
StatusFont MONO_STATUSFONT
MONO_STATUSFONT_SIZE

Download

» mono-2.10-configurable-system-fonts.patch

» mono-2.11-configurable-system-fonts.patch

» mono-3.0-configurable-system-fonts.patch