Making symbol fonts available to Mozilla builds using
fontconfig
Ian Hutchinson
12 Jan 2005
1 Quick Fix Summary1
Download the file symfontconfig.tar.gz to somewhere convenient.
Unpack it by tar xzf symfontconfig.tar.gz
Install it by cd symfontconfig; ./install.sh
Restart Mozilla. It's done.
2 What it is
The package contains a Type 1 symbol font which is deliberately
encoded in such a way that the symbol fonts will render in an
iso-8859-1 encoded HTML file. The glyphs of the font are refered to
via 8-bit codes overlapping the Latin-1 codes that are the default
encoding of most HTML files. This makes it possible to render such
constructs as <font face="symbol">a</font> and obtain the greek
letter alpha. Constructs of this type have been widely used in HTML
files for almost ten years.
It can be argued (and undoubtedly will be by those who think they know
what is best for us) that this usage contravenes proper font schemes as
expressed for example in the HTML standard. However, no automatic
validator should care or even detect the "violation". Documents
appear as perfectly legal HTML.
3 Why it is necessary
An elaborate standard called Unicode or iso-10646 has been invented to
encode all the characters on the planet (and possibly beyond!) It is
the official character repertoire of HTML but it is unfortunately not
complete; nor, because of its size, is it fully implemented in any
browser. The font police have decreed that if you want a character
other than the ones that correspond to those present in the document
encoding being used (which is typically iso-8859-1 also called Latin-1
for western languages), you are supposed to use iso-10646
codes. Because iso-10646 is incomplete, for example lacking the parts
of delimiters that can be used to build up stretched parentheses in
equations, etc., it is impossible to embed mathematics in HTML
following the formal standard. Therefore the approach of using an
iso-8859 encoded font has long been used.
In prior versions of browsers on linux, symbol fonts could be enabled
by just creating an alias from a symbol font present on the system.
The X display system, used on linux and unix, has recently started to
use a new font renderer called fontconfig. Because it only uses
scalable outline fonts, it does not access the symbol font via the
alias. Therefore it is necessary to provide this font that is
explicitly encoded via 8859-1 for versions of browsers that use the
fontconfig renderer.
4 Avoiding side-effects in MathML
Unfortunately, despite recommendations to the contrary, the Mozilla
MathML style sheet unnecessarily lists Symbol ahead of
Times and serif in the mathematics fonts section. When
the above steps enable the use of the symbol font for standard
encoding documents, it may also cause MathML to use it in preference
to Times or serif. The symptom of this problem is that all the latin
characters are turned into greek. Therefore if you want to view
MathML documents as well as HTML with symbols, you need to edit the
file mathml.css normally found at somewhere like
.../mozilla/res/mathml.css.
The install.sh script will do this for you automatically if it can
find the file. If the install.sh script succeeds. Then its effects can
be reversed by running it again. In other words, a second run
uninstalls everything.
If install.sh does not work, you may have to locate the relevant file
youself and edit it by hand.
Find the line that starts
font-family: CMSY10, Symbol, Times ..., serif
Bring the Times and serif fonts ahead of Symbol, and ahead of them
both add Standard Symbol L (which is the name of the fontconfig Symbol
font with standard encoding) thus:
font-family: CMSY10, Standard Symbol L, Times, serif, Symbol ...
Footnotes:
1For builds that use the older
standard X pixel generated fonts, see
http://hutchinson.belmont.ma.us/tth/Xfonts.html . The
symfontconfig distribution also contains the Xfonts.fix script to fix those
fonts.
File translated from
TEX
by
TTHgold,
version 3.70.
On 28 Aug 2005, 18:01.