3188
|
1 |
|
|
2 |
\chapter{Fonts and character encodings}
|
|
3 |
|
3217
|
4 |
With the advent of print modes in Isabelle (see also The
|
|
5 |
\emph{Isabelle Reference Manual}, variant forms of output have become
|
|
6 |
very easy. As the canonical application of this feature, {\Pure} and
|
|
7 |
major object-logics (\FOL, \ZF, \HOL, \HOLCF) support optional output
|
|
8 |
(and input) of nice mathematical symbols out of the box.
|
|
9 |
|
|
10 |
Symbolic output is enabled by activating the \ttindex{symbols} print
|
|
11 |
mode. User interfaces (e.g.\ \texttt{isa-xterm}, see
|
|
12 |
\S\ref{sec:isa-xterm}) usually do this by default.
|
3188
|
13 |
|
3217
|
14 |
\medskip Of course, this requires special screen fonts (see
|
|
15 |
\S\ref{sec:tool-installfonts}). Furthermore, various {\ML} systems
|
|
16 |
cause some problems with non-\textsc{ascii} characters in literal
|
|
17 |
strings. These are avoided by the \texttt{symbolinput} filter (see
|
|
18 |
\S\ref{sec:tool-symbolinput}).
|
|
19 |
|
|
20 |
Both of these are invoked transparently in normal operation. So one
|
|
21 |
does not actually have to read the explanations below, unless
|
|
22 |
something fails to work.
|
|
23 |
|
|
24 |
|
|
25 |
\section{Telling X11 about Isabelle fonts --- \texttt{isatool installfonts}}
|
|
26 |
\label{sec:tool-installfonts}
|
|
27 |
|
|
28 |
The \tooldx{installfonts} utility ensures that your currently running
|
|
29 |
X11 display server (as determined by the \texttt{DISPLAY} environment
|
|
30 |
variable) knows about the Isabelle fonts. Its usage is:
|
3188
|
31 |
\begin{ttbox}
|
|
32 |
Usage: isatool installfonts
|
|
33 |
|
|
34 |
Install the isabelle fonts into your X11 server.
|
3217
|
35 |
(May be safely called repeatedly.)
|
|
36 |
\end{ttbox}
|
|
37 |
Note that this need not be called manually under normal circumstances
|
|
38 |
--- user interfaces depending on the Isabelle fonts will invoke
|
|
39 |
\texttt{installfonts} transparently.
|
|
40 |
|
|
41 |
\medskip As simple as this might appear to be, it is not! X11 fonts
|
|
42 |
are a surprisingly complicated matter. Depending on your network
|
|
43 |
structure, fonts might have to be installed differently. This has to
|
|
44 |
be specified via the \settdx{ISABELLE_INSTALLFONTS}.
|
|
45 |
|
|
46 |
\medskip In the simplest situation, X11 is used only locally, i.e.\
|
|
47 |
the client program (Isabelle) and the display server are run on the
|
|
48 |
same machine. Then most X11 display servers should be happy to being
|
|
49 |
just told about the directory where the fonts reside within the
|
|
50 |
Isabelle distribution:
|
|
51 |
\begin{ttbox}
|
|
52 |
ISABELLE_INSTALLFONTS="xset fp+ $ISABELLE_HOME/lib/fonts; xset fp rehash"
|
|
53 |
\end{ttbox}
|
|
54 |
The same also works for remote X11 sessions in a somewhat homogeneous
|
|
55 |
network, where the X11 display machine mounts the Isabelle
|
|
56 |
distribution under the same name as the client side.
|
|
57 |
|
|
58 |
\medskip Above method fails, if the display machine does have the font
|
|
59 |
files at the same location as the client. In case your server is a
|
|
60 |
full workstation with its own file system, you could in principle just
|
|
61 |
copy the fonts there and do an appropriate \texttt{xset~fp+} manually
|
|
62 |
before running the Isabelle interface. This is awkward, of course, but
|
|
63 |
is even \emph{impossible} for proper X terminals that do not have
|
|
64 |
their own file system.
|
|
65 |
|
|
66 |
A much better solution to this problem is to use an \emph{X11 font
|
|
67 |
server}, offering the Isabelle font to the Net. In principle it is
|
|
68 |
relatively easy to setup one your own --- the program is called
|
|
69 |
\texttt{xfs} (or just \texttt{fs)}, see the \texttt{man} pages of your
|
|
70 |
system.
|
|
71 |
|
|
72 |
Your are very lucky, though, if you have a sensible connection to the
|
|
73 |
Internet. We already offer a world-wide X11 font service for the
|
|
74 |
Isabelle fonts. To have \texttt{installfonts} make use of this, just
|
|
75 |
set \texttt{ISABELLE_INSTALLFONTS} is follows:
|
|
76 |
\begin{ttbox}
|
|
77 |
ISABELLE_INSTALLFONTS="xset fp+ tcp/isafonts.informatik.tu-muenchen.de:7200"
|
3188
|
78 |
\end{ttbox}
|
|
79 |
|
|
80 |
|
3217
|
81 |
|
|
82 |
\section{Filtering non-ASCII characters --- \texttt{isatool symbolinput}}
|
|
83 |
\label{sec:tool-symbolinput}
|
3188
|
84 |
|
|
85 |
|
|
86 |
%FIXME not yet
|
|
87 |
%\section{ --- \texttt{isatool showsymbols}}
|
|
88 |
%
|
|
89 |
%\begin{ttbox}
|
|
90 |
%\end{ttbox}
|