< < <

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:
$ mono /opt/keepass/KeePass.exe
Patched Mono:
$ export MONO_DEFAULTFONT="Bitstream Vera Sans"
$ export MONO_DEFAULTFONT_SIZE=12
$ mono /opt/keepass/KeePass.exe

Patching Mono

$ cd /usr/src
$ wget http://download.mono-project.com/sources/mono/mono-2.10.6.tar.bz2
$ tar -jxvf mono-2.10.6.tar.bz2
$ wget http://www.vakuumverpackt.de/configurablesystemfontsformono/mono-2.10.6-configurable-system-fonts.patch
$ patch -p0 < mono-2.10.6-configurable-system-fonts.patch
$ cd mono-2.10.6
$ ./configure --prefix=/opt/mono-2.10.6
$ make
$ make install
$ /opt/mono-2.10.6/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.6-configurable-system-fonts.patch