-
Notifications
You must be signed in to change notification settings - Fork 1
Configuration
MDVIEW MTX does not have a configuration file per se; all features can be
set using command-line options. If you frequently use the same options
and wish for a configuration file, consider using the MDVIEW_OPTIONS
environment variable instead. You can set and export MDVIEW_OPTIONS in
your shell configuration file (e.g., .bashrc, .zshrc) or in your shell
profile (e.g., .profile), adding commonly used options to the variable
as you would write them on the command line.
Mdview loads its user-interface fonts using the fontconfig font engine, which can be configured precisely according to the information in the fontconfig manual. Below, I have compiled a sample fontconfig configuration to change the font name and size displayed by mdview.
-
Save the sample configuration to file
~/.config/fontconfig/conf.d/90-mdview.conf. -
Modify the font family names to reflect you favorite fonts, which must be already installed in your system.
-
Settings take effect when you restart mdview.
-
To debug your settings you can use the FC_DEBUG environment variable:
FC_DEBUG=1024 mdview /path/to/my-file.md
Please note that fontconfig cannot change font colors.
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<description>My mdview fontconfig</description>
<match> <!-- Sans font -->
<test name='prgname'><string>mdview</string></test>
<test name='family' compare='contains'><string>sans</string></test>
<test name='family' compare='not_contains'><string>mono</string></test>
<!-- my fallback font -->
<edit name='family' mode='prepend' binding='strong'><string>DejaVu Sans</string></edit>
<!-- my font -->
<edit name='family' mode='prepend_first' binding='strong'><string>Symbola</string></edit>
</match>
<match> <!-- Monospace font -->
<test name='prgname'><string>mdview</string></test>
<test name='family' compare='contains'><string>mono</string></test>
<edit name='family' mode='prepend' binding='strong'><string>DejaVu Sans</string></edit>
<edit name='family' mode='prepend_first' binding='strong'><string>Liberation Mono</string></edit>
</match>
<!-- Font size: 115% -->
<match target='font'>
<test name='prgname'><string>mdview</string></test>
<edit mode='assign' name='matrix'>
<times>
<name>matrix</name>
<matrix>
<double>1.15</double><double>0</double>
<double>0</double><double>1.15</double>
</matrix>
</times>
</edit>
</match>
</fontconfig>See XML metadata.