\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english,ngerman]{babel}
\usepackage{url}
\usepackage{listings}
\usepackage{array}
\usepackage{booktabs}
\usepackage{capt-of}
\usepackage[svgnames]{xcolor}
\usepackage{cmbright}
\usepackage{pstricks}
\usepackage{pst-plot}


\newcommand{\file}[1]{\bgroup\slshape\textsf{#1}\egroup}
\newcommand{\fx}{\fontencoding{T1}\fontfamily{casiofx}\selectfont}
\newcommand{\tabHead}[1]{\textsf{\textbf{#1}}}


\definecolor{Brown}{cmyk}{0,0.81,1,0.60}
\definecolor{OliveGreen}{cmyk}{0.64,0,0.95,0.40}
\definecolor{CadetBlue}{cmyk}{0.62,0.57,0.23,0}
\definecolor{ZurichBlue}{rgb}{.255,.41,.884} % RoyalBlue of svgnames
\definecolor{ZurichRed}{rgb}{1, 0, 0} % Red of svgnames
\definecolor{ZurichGreen}{rgb}{.196,.804,.196} % LimeGreen of svgnames
\definecolor{ZurichYellow}{rgb}{1,.648,0} % Orange of svgnames

\lstset{%
  language=TeX,
  morekeywords={ProvidesFile, DeclareFontFamily, DeclareFontShape},
  sensitive=true,
  backgroundcolor=\color{Moccasin},
  numbers=none,
  numbersep=5pt,
  breaklines=true,
  linewidth=\textwidth, 
  showstringspaces=false,
  frame=tb,
  % basicstyle=,
  keywordstyle=\bfseries\color{Black},
  commentstyle=\color{DarkSlateGray},
%  identifierstyle=\color{CadetBlue}\bfseries, 
%  stringstyle=\color{blue}
}

\title{\LaTeX ian notes on:\\Casio fx-991ES}
\author{C.~Vogel, T\,U\,G\,D\,D\footnote{http://www.tn-home.de/TUGDD/index.html}, Germany}
\date{October 2008}

\begin{document}
\maketitle
\begin{abstract}
 This document introduces some usage of the Casion fx-991ES' "natural display calculator"{} and explaines how that supported Casio-font can be used in \LaTeX. \bigskip\bigskip


 Thanks to Gerrit Kirpal introducing me to the \LaTeX-fontstructure and fontforge. Thanks to Tobias N\"ahring for successing me in the organisation and moderation of our meetings.

\end{abstract}
\tableofcontents
\lstlistoflistings\newpage

\section{Obtaining the files}
\begin{tabular}{ll}

\textsf{\textbf{fonts:}} & \url{http://www.casio-schulrechner.de/de/files/downloads/ES_Fonts.zip}\\
\textsf{\textbf{manual:}} & \dots\url{/de/files/manuals/sgr/fx-991ES_G.pdf}\\
\textsf{\textbf{appendix:}} & \dots\url{/de/files/manuals/sgr/fx-115ES_fx-570ES_fx-991ES_Appendix.pdf}
\end{tabular}




\section{Reencoding with fontforge}

I simply opened that file in fontforge and did following things:
\begin{itemize}
\item Encoding$\longrightarrow$Reencode$\longrightarrow$Adobe Standard
\item Encoding$\longrightarrow$Force Encoding$\longrightarrow$Adobe Standard
\item Element$\longrightarrow$Font Properties$\longrightarrow$
  \begin{itemize}
  \item uncheck: use quadratic splines
  \item select in Name List: \TeX\ Names
  \end{itemize}
\item File$\longrightarrow$Create Fonts$\longrightarrow$
  \begin{itemize}
  \item PS Type 1
  \item Options$\longrightarrow$Create: TFM and ENC
  \end{itemize}

\end{itemize}


\section{Creating .fd and .map}

A common mistake is to forget about the t1-prefix of that \file{.fd}-file. So you need to create a \file{t1<myfont>.fd} whereas the following example may be a hint:
\lstinputlisting[captionpos=t,caption=t1casiofx.fd]{t1casiofx.fd}

and you'll also need to create a \file{<myfont>.map} file like:
\lstinputlisting[caption=casiofx.map]{casiofx.map}

\section{Updating the \TeX-System}

Copy that \file{.map}-file into \file{/usr/share/texmf-texlive/fonts/map/dvips/}

Use: \verb+updmap-sys --enable Map=casiofx.map+

\section{Using the font}

Assume you want to approximate $\pi$ by the numerical integration of an semi-circle with radius of $\sqrt{2}$. 

\[\int\limits_{-\sqrt{2}}^{\sqrt{2}}\sqrt{2-x^2}\,\partial x\]

\noindent Type in your Casio fx-991ES:\medskip

\bgroup\fontencoding{T1}\fontfamily{casiofx}\selectfont
\qquad Wys2-Q)d\$\$-s2\$\$s2p\normalfont.
\egroup\bigskip

\noindent\emph{Note: This operation might take a while, even by exposing the solar cell to intense light.\footnote{This calculation took 75\,secs on mine.}}\bigskip

\noindent Funny enough subtracting $\pi$ from this result leads to an error of: $4.41\times10^{-12}$ and can be obtained by pressing subsequently:\medskip

\bgroup\fontencoding{T1}\fontfamily{casiofx}\selectfont
\qquad M-qKp\normalfont.
\egroup\bigskip

%\begin{pspicture}(-5,-2)(5,6)
%\psarc[fillstyle=solid,fillcolor=pink](0,0){4}{0}{180}
%\rput*[l](.3,1.5){$\int\limits_{-\sqrt{2}}^{\sqrt{2}}\sqrt{2-x^2}\,\partial x$}
%\psaxes{->}(0,0)(-5,-.9)(5,5)
%\end{pspicture}




\bgroup\centering
\begin{tabular}{l>{\fx}c!{\qquad}l>{\rule{0pt}{1em}\fx}c}
\toprule%
\multicolumn{1}{c}{\tabHead{Key}} & \multicolumn{1}{c}{\tabHead{Symbol}} & \multicolumn{1}{c}{\tabHead{Key}} & \multicolumn{1}{c}{\tabHead{Symbol}}\\
\midrule
a & a & A & A\\
b & b & B & B\\
c & c & C & C\\
d & d & D & D\\
e & e & E & E\\
f & f & F & F\\
g & g & G & G\\
h & h & H & H\\
i & i & I & I\\
j & j & J & J\\
k & k & K & K\\
l & l & L & L\\
m & m & M & M\\
n & n & N & N\\
o & o & O & O\\
p & p & P & P\\
q & q & Q & Q\\
r & r & R & R\\
s & s & S & S\\
u & u & U & U\\
w & w & W & W\\
x & x & X & X\\
y & y & Y & Y\\
z & z & Z & Z\\
1 & 1 & 6 & 6\\
2 & 2 & 7 & 7\\
3 & 3 & 8 & 8\\
4 & 4 & 9 & 9\\
5 & 5 & 0 & 0\\
+ & + & - & -\\
. & . & , & ,\\
( & ( & ) & ) \\
\$ &\$ & & \\\bottomrule
\end{tabular}\\
\captionof{table}{Charset for ES01.TTF font}\nopagebreak
\egroup
\end{document}
