\documentclass[16pt,hyperref={pdfnewwindow=true}]{beamer}
%\documentclass[16pt,hyperref={pdfwindowui=true,pdfnewwindow=true}]{beamer}
%\documentclass[16pt]{beamer}
%\setbeamercovered{transparent}

%\usetheme{Berkeley}
%\usetheme{Berlin}
%\usetheme{Warsaw}
\usetheme{default}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{mflogo}
%\hypersetup{pdfnewwindow=true}
%%\usepackage[pdftitle={Comments and suggestions about LM},%
%%pdftoolbar=true,pdfmenubar=false,pdffitwindow=true,%
%%pdfwindowui=true]{hyperref}
%\usepackage[pdftoolbar=false,pdfmenubar=false,pdfwindowui=true]{hyperref}
%\usepackage[pdfnewwindow]{hyperref}
%\usepackage{hyperref}
\usepackage{url}
\usepackage{graphicx}
\usepackage{color}
\usepackage{alltt}
%\def\pp{\textit}
%\def\MTI{\acro{\textsf{METATYPE1}}}
%\def\fontforge{\acro{\textsf{FontForge}}}
%\def\MTI{{\textsf{MetaType1}}}
%\def\fontforge{{\textsf{FontForge}}}
\def\MTI{MetaType1}
\def\fontforge{FontForge}
\DeclareRobustCommand\ConTeXt{\textsc{Con\kern-.15em\TeX t}}
\DeclareRobustCommand\XeTeX{X\kern-.125em\lower.5ex\hbox{\csname
              reflectbox\endcsname{E}}\kern-.1667em\TeX}
\DeclareRobustCommand\XeLaTeX{X\kern-.125em\lower.5ex\hbox{\csname
              reflectbox\endcsname{E}}\LaTeX}
\def\PICT{pictures}

\title{Fonts with complex OpenType tables}
\author{Karel~P\'{\i}\v{s}ka}
\institute{
  Institute of Physics, Academy of Sciences\\
  Prague, Czech Republic}
\date{17 September 2010}

\begin{document}

\begin{frame}
 \titlepage
\vfil{\small
\ConTeXt\ meeting\ \&\ \TeX perience\hfil Brejlov, 13--19 September 2010}
%4th \ConTeXt\ and 3rd \TeX perince \hfil Brejlov, 13 -- 19 Sep. 2010}
%Euro\TeX\ 2009 \hfil NDC/IDL, Den Haag, 31 August -- 4 September 2009}
\end{frame}

\section{Introduction}
\begin{frame}
\frametitle{Introduction}
Probably not many people are designing OpenType fonts
with such technical work as creating OpenType tables is.

Is somebody going to produce OT fonts and OT tables?

I think if someone will be interested in the matter
(s)he can read my proceeding article and discuss after the presentation.
Anyway, please report about my mistakes.

In my presentation I want to describe 
principles of OT tables and
overview development of the fonts with its problems more shortly 
and then demonstrate ``How OT works'' on several examples.
\end{frame}

\begin{frame}
My starting point were two \MF\ fonts
covering Czech and Georgian handwriting:\\
the font \href{\PICT/czelex.pdf}{[slabikar]}
designed and created
in \MF\ by \large{Petr Ol\v{s}\'ak} (1997)\\
and my \href{\PICT/geolex.pdf}{[Georgian]} fonts from 1998.

And may aim was to create the OT versions of that fonts.


Now only one common comment: I have not solved the problems with linespacing
and unification: Czech and Armenian handwriting are oblique
and Georgian is upright
\end{frame}

\section{OpenType tables principles}
\begin{frame}
\frametitle{OpenType tables principles}
Tables (names) in OTF (PS/Type1 flavoured OT)\\
and in TTF* (TrueType  flavoured OT)\\
\begin{tabular}{ll}
head\\
hhea\\
maxp\\
OS/2\\
hmtx\\
cmap\\
loca\\
CFF &  glyf*\\
name\\
post\\
gasp\\
FFTM\\
GDEF\\
GPOS& are\\
GSUB& important\\
\end{tabular}
\end{frame}

\frametitle{How are defined OpenType tables?}
\begin{frame}
The tables in OTF/TTF are binary.
Human readable form is provided by TTX [Just van Rossum]
converting OT into XML and back:
\href{hwufo-ttx.pdf}{[ttx]},
\href{hwufo-ttx-GSUB.pdf}{[ttx-GSUB]},
\href{hwufo-ttx-GPOS.pdf}{[ttx-GPOS]}
is difficult for writing and editing.

Therefore there are tools to define the tables
in a source textual form and then compile them into binaries.

VTP -- VOLT project format:
\href{hwuv-vtp.pdf}{[hwu-vtp]}\\
FEA -- Feature file specification:
\href{hwufo-otf.pdf}{[hwu-fea]}

VOLT (Microsoft) can import VTP files\\
makeotf (Adobe AFDKO), FontForge and commercial FontStudio (FontLab)
can import FEA files and generate OT binaries.
These programs allow also enter and edit OT data
in interactive way. But I did not use that facilities
because filling the form for hundreds rules is inefficient. 

I will show some of the examples I prepared
in my \href{piska-ot.pdf}{[proceedings article]}.

\end{frame}

\section{Overview of development}
\begin{frame}
\frametitle{Overview of development}
Creating (semi-manual editing) of source files (VTP and FEA)
defining OT tables (glyph lists, features, lookups:
substitution and positional rules, \dots)

Generating binaries (final OTF/TTF) with\\
VOLT (from VTP), FontForge and AFDKO (from FEA)

Proofing with VOLT, FontForge

Testing with \XeTeX, \ConTeXt

Another attempts, e.g. conversions
\end{frame}

\section{Problems during development}
\begin{frame}
\frametitle{Problems during development}
Creating and editing of source files has be done
in a semi-manual way.

Interactive tools (in VOLT, FontForge) to entry hundreds rules
is not efficient.

FontForge generated wrong GSUB according \ConTeXt

AFDKO (Adobe) generated wrong GPOS according \XeTeX

I has not been successful with any conversions
(\MF, VOLT based TTF, FEA based OTF)
\end{frame}

\section{Demonstrations}
\begin{frame}
\frametitle{Demonstrations}
OT tables are instructions \dots\\
and their interpretation and rendering is solved by
text layout engines connect with operating systems or
application programs

VOLT and FontForge proofing tools have their own internal engines

\XeTeX\ delegates font handling to libraries
(ICU, ATSUI, Graphite, \dots) for rendering and positioning

\end{frame}

\subsection{Proofing with VOLT}
\begin{frame}
\frametitle{Proofing with VOLT and FontLab}
I use free software and do not have the commercial FontLab Studio.

VOLT is available only for MS Windows and, unfortunately,
proofing Georgian
is impossible in FontForge under Windows; I use FontForge on Linux.
\end{frame}

\subsection{Proofing with FontForge}
\begin{frame}
\frametitle{Proofing with FontForge}
I have prepared several \href{frazes.pdf}{[words]} for proofing
and demonstration ``How OT (features and lookup rules) works.''
\vfill
(switching keyboard layout/mapping:\\
setxkbmap us ; setxkbmap cz ; setxkbmap ge ; )
\end{frame}

\subsection{\XeTeX}
\begin{frame}
\frametitle{\XeTeX}
\XeTeX\ can read Unicode input stream, use OT fonts directly
and produce PDF with the OT fonts inside:
\href{xetexts-tex.pdf}{[\XeLaTeX\ source]}\href{xetexts.pdf}{[\XeLaTeX\ samples]}
\end{frame}

\subsection{\ConTeXt}
\begin{frame}
\frametitle{\ConTeXt}
Also \ConTeXt\ (Mark IV) offers the usage of OT fonts:\\
\href{luhwudef-tex.pdf}{[Font definitions]}
\href{lusuall-tex.pdf}{[\ConTeXt\ source]}
\href{lusulall.pdf}{[pdf]}
%\href{lutexts-tex.pdf}{[\ConTeXt\ source]}\href{lutexts.pdf}{[\ConTeXt\ samples]}
\end{frame}

\subsection{\ConTeXt\ testing: showotfcomposition}
\begin{frame}
\frametitle{\ConTeXt\ testing: showotfcomposition}
\ConTeXt\ allows to trace processing of OTF features and lookups
step by step:
\href{lucompos-tex.pdf}{[source]}\href{lucompos.pdf}{[pdf]}
%Testing of break:
%\href{lubare-tex.pdf}{[source]}\href{lubare.pdf}{[pdf]}
\end{frame}

\section{Conclusion}
\begin{frame}
\frametitle{Conclusion}
I am able to produce OT fonts
working properly (i.e. according my expectations)
with \XeTeX\ (\texttt{xelatex}) and \ConTeXt\ Mark IV (\texttt{context})

We have two different versions of OT fonts producing the same results:\\
VOLT based TTF\\
FEA based OTF

The fonts generated from the same FEA sources
by \textit{makeotf} (AFDKO) and by FontForge are different,
they may contain (different!) errors or are not compatible
with \XeTeX\ and \ConTeXt.

Automatic conversion of substition and positioning tables
between \MF/TFM, VOLT based TTF, FEA based OTF
is impossible or does not work properly with tools available (to me).


\end{frame}

\end{document}

