Previous Topic

Next Topic

Book Contents

Book Index

Font Style Language

The font style definition file has an XML syntax with seven elements:

<styles>

The root element that can contain any number of <style> elements.

<style>

Each <style> element must contain one <label> element and one <fontspec> element. It is an error if either of these is missing or appears more than once.

<label>

The name of the style.

If the inner text of this element matches the value of the class attribute in a MathML element, then that MathML element will be stylized according to the <fontspec> element that is a sibling of this <label>.

<fontspec>

This can contain 0-3 of the following three elements which describe the font characteristics of the style. If any of these elements are omitted, the corresponding font characteristic adopts a default value listed below.

  • <fontfamily> - Accepted values are any legal font family name, or "inherited". Default is "inherited".
  • <fontweight> - Accepted values are "normal", "bold" or "automatic". Default is "automatic".
  • <fontslant> - Accepted values are normal, italic or automatic. Default is "automatic".

For example, the following code defines two font styles named my Arial, my Arial2, and myEmphasis:

<styles>
 <style>
  <label>myArial</label>
  <fontspec>
   <fontfamily>Arial</fontfamily>
    <fontweight>normal</fontweight>
    <fontslant>automatic</fontslant>
  </fontspec>
 </style>

 <style>
  <label>myArial2</label>
  <fontspec>
   <fontfamily>Arial</fontfamily>
    <fontweight>bold</fontweight>
   <fontslant>normal</fontslant>
  </fontspec>
 </style>

 <style>
  <label>myEmphasis</label>
  <fontspec>
   <fontfamily>inherited</fontfamily>
    <fontweight>bold</fontweight>
   <fontslant>italic</fontslant>
  </fontspec>
 </style>
</styles>

Previous Topic

Next Topic

Book Contents

Book Index


[Design Science Home]
Copyright © 1996-2016 Design Science, Inc. All rights reserved.