2. Bundling better math fonts

The MathML add-on is bundled with a set of fonts which are not used by default. If you want to force the use of this font set or if you want to specify an alternate font set, you'll have to specify a proper value for the "mathml.fonts" preference key.

The syntax of the value of this preference key is:

key_value --> logical_font_name ';' font_spec
              [ ';' logical_font_name ';' font_spec ]*

logical_font_name --> 'normal'
                  | 'bold'
                  | 'italic'
                  | 'bold-italic'
                  | 'sans-serif'
                  | 'bold-sans-serif'
                  | 'sans-serif-italic'
                  | 'sans-serif-bold-italic'
                  | 'monospace'
                  | 'fraktur'
                  | 'bold-fraktur'
                  | 'script'
                  | 'bold-script'
                  | 'double-struck'

font_spec --> physical_font_name
          | TTF_file_URI

A physical_font_name example is "Century Schoolbook L Roman" and not just "Century Schoolbook L", which is a font family.

Example C.1. Force the use of the bundled font set using the command-line

(Remove the newline character found after each ";".)

xxe -putpref mathml.fonts "monospace;mathml-config:fonts/DejaVuSansMono.ttf;
sans-serif;mathml-config:fonts/DejaVuSans.ttf;
bold-sans-serif;mathml-config:fonts/DejaVuSans-Bold.ttf;
sans-serif-italic;mathml-config:fonts/DejaVuSans-Oblique.ttf;
sans-serif-bold-italic;mathml-config:fonts/DejaVuSans-BoldOblique.ttf;
normal;mathml-config:fonts/DejaVuSerif.ttf;
bold;mathml-config:fonts/DejaVuSerif-Bold.ttf;
italic;mathml-config:fonts/DejaVuSerif-Italic.ttf;
bold-italic;mathml-config:fonts/DejaVuSerif-BoldItalic.ttf;
fraktur;mathml-config:fonts/eufm10.ttf;
bold-fraktur;mathml-config:fonts/eufb10.ttf;
script;mathml-config:fonts/eusm10.ttf;
bold-script;mathml-config:fonts/eusb10.ttf;
double-struck;mathml-config:fonts/msbm10.ttf"

Note how the "mathml-config:" prefix may be used to refer to the directory where the MathML add-on has been installed. This works because the following rule has been added to mathml_addon_install_dir/mathml_catalog.xml:

<rewriteURI uriStartString="mathml-config:" rewritePrefix="." />

Example C.2. Force the use of the bundled font set when XMLmind XML Editor is deployed using Java™ Web Start

(Remove the newline character found after each ";".)

<application-desc main-class="com.xmlmind.xmleditapp.app.WebStart">
  <argument>-putpref</argument>
  <argument>mathml.fonts</argument>
  <argument>monospace;mathml-config:fonts/DejaVuSansMono.ttf;
sans-serif;mathml-config:fonts/DejaVuSans.ttf;
bold-sans-serif;mathml-config:fonts/DejaVuSans-Bold.ttf;
sans-serif-italic;mathml-config:fonts/DejaVuSans-Oblique.ttf;
sans-serif-bold-italic;mathml-config:fonts/DejaVuSans-BoldOblique.ttf;
normal;mathml-config:fonts/DejaVuSerif.ttf;
bold;mathml-config:fonts/DejaVuSerif-Bold.ttf;
italic;mathml-config:fonts/DejaVuSerif-Italic.ttf;
bold-italic;mathml-config:fonts/DejaVuSerif-BoldItalic.ttf;
fraktur;mathml-config:fonts/eufm10.ttf;
bold-fraktur;mathml-config:fonts/eufb10.ttf;
script;mathml-config:fonts/eusm10.ttf;
bold-script;mathml-config:fonts/eusb10.ttf;
double-struck;mathml-config:fonts/msbm10.ttf</argument>
</application-desc>

The "mathml-config:" prefix works fine even when XMLmind XML Editor is deployed using Java™ Web Start.