\newif\ifpaper
\newif\ifslide
\documentclass[landscape]{slides}
\textheight=1.2\textheight
\oddsidemargin=1.5cm
\topmargin=-2.0cm
\usepackage{color}
% -- Background color blue?
\definecolor{backgroundcolor}{rgb}{0,0,.113}
% -- Or background color red?
%\definecolor{backgroundcolor}{rgb}{.5,0,0}
% -- Text color
\definecolor{textcolor}{rgb}{1,1,1}
\definecolor{headcolor}{rgb}{1,1,0}

\usepackage{url}
\usepackage{graphicx}
\usepackage[kasre=off,yeh=small,tashdid=off,farsi456=on]{faanoos}
\usepackage{array}


\newcommand{\slt}[1]{\centering\textcolor{headcolor}{\Large\textbf{#1}}\hbox{}\vfill\raggedright\par}
\newcommand{\prog}[1]{\texttt{#1}}
\newlength\contboxwidth
\newcommand{\cont}{\setbox0=\hbox{\small\space(continued)}%
	\contboxwidth=\wd0\box0\hspace{-\contboxwidth}}
\newcommand{\visa}{\setbox0=\hbox{\small\space no visa}%
	\contboxwidth=\wd0\box0\hspace{-\contboxwidth}}
\def\abovecaptionskip{5ex}
\newcommand{\fa}[1]{\mbox{\Large\textfarsi{#1}}}

\newcommand{\unicode}[1]{{U+#1}}
\newcommand{\uniname}[1]{\emph{#1}}
\newcommand{\uni}[2]{\unicode{#1} \uniname{#2}}
\newcommand{\uniseq}[1]{$\langle$#1$\rangle$}
\newcommand{\unirange}[2]{\uniseq{\unicode{#1}..\unicode{#2}}}

\let\saveendslide=\endslide
\let\saveendoverlay=\endoverlay
\renewcommand{\endslide}{\vfill\saveendslide}
\renewcommand{\endoverlay}{\vfill\saveendoverlay}
\let\saveslide=\slide
\renewcommand{\slide}{\saveslide\flushright}
\let\saveoverlay=\overlay
\renewcommand{\overlay}{\saveoverlay\flushright}

\color{textcolor}
\begin{document}
\color{textcolor}
\pagecolor{backgroundcolor}

\slide
\ifpaper\else\thispagestyle{empty}\fi
\centering
\textcolor{headcolor}{\Huge\bfseries
\begin{tabular}{c}
	Persian Computing\\ {\Large with}\\ Unicode
\end{tabular}}\par
{\vspace{1em}\vfill\textcolor{textcolor}{\Large
$\stackrel%
{\mbox{\underline{\smash{\raisebox{-.7ex}{ Behdad Esfahbod }}}}
  \raisebox{-.6ex}{\visa}
}%
{\mbox{\raisebox{-.1ex}{\large\texttt{unicode@behdad.org}}}}
$
\\[.5em]
$\stackrel%
{\mbox{Amir Youssef{}i}}%
{\mbox{\large\texttt{youssefi@cs.rpi.edu}}}
$
\\[1.5em]
$\stackrel%
{\mbox{The FarsiWeb Project}}%
{\mbox{\large\texttt{http://www.farsiweb.info/}}}$
}}\par
% -- No date?
% -- Or presenation date?
{\large March 31, 2004}
% --
\endslide


\slide
\slt{What is Persian?}
\begin{center}
\color{white}
\ifpaper
\includegraphics[width=.9\textwidth]{black.mps}
\else
\includegraphics[width=.9\textwidth]{white.mps}
\fi
\end{center}
\endslide


\slide
\slt{Persian in Computers}
There are three relevant national standards:
\begin{itemize}
\item ISIRI 3342:1992  Farsi 8-bit Coded Character Set for
Information Interchange (deprecated)
\item ISIRI 2901:1994  Keyboard Layout for Farsi: Characters in
Computer
\item ISIRI 6219:2002  Information Technology -{}-
Persian Information Interchange and Display Mechanism, using Unicode
\end{itemize}
\endslide


\slide
\slt{Modern Persian Script}
\begin{itemize}
\item Based on Arabic Script (\unirange{0600}{06FF} block): With some extra letters, some
modif{}ied letters
\item But with completely dif{}ferent semantics and typographical
habits
\item Is a bidirectional script: Is written from right to left,
    except for numbers
\item Needs cursive joining: Two adjacent letters may be {\em joined},
    forming 1, 2, or 4 glyphs for each character: (for example
\fa{s}, \fa{"=s}, \fa{"=s"=}, \fa{s"=})
\end{itemize}
\endslide

\slide
\slt{Arabic Script Rendering}
\begin{center}
\setlength{\extrarowheight}{1ex}
\begin{tabular}{|l|l|l|}
\hline
Input text & Logical order & \fa{s} \fa{l} \fa{=aa} \fa{m} \\
\hline
After Bidirectional Algorithm & Visual order & \hfill\fa{m} \fa{=aa} \fa{l} \fa{s} \\
\hline
After Arabic Joining Algorithm & Glyph list & \hfill\fa{m} \fa{"=aa} \fa{"=l"=} \fa{s"=} \\
\hline
After Ligation & Glyph list & \hfill\fa{m} \fa{"=laa} \fa{s"=} \\
\hline
When Rendered & Output & \hfill\fa{salaam} \\
\hline
\end{tabular}
\end{center}

With enough care, it is possible, to apply the above algorithms in a
dif{}ferent order, and get the same result.

\endslide


\overlay
\slt{A Bidirectional Document \small (gedit/Pango)}
\begin{center}
\includegraphics[height=.8\textheight]{pango-rocks.eps}
\end{center}
\endoverlay


\slide
\slt{Alphabet}
\vspace{-1ex}
\begin{itemize}
\item Extra letters:\\
\quad \uni{067E}{Peh} (\fa{p}),
      \uni{0686}{Tcheh} (\fa{ch}),\\
\quad \uni{0698}{Jeh} (\fa{zh}),
      \uni{06AF}{Gaf} (\fa{g})
\item Modif{}ied letters:\\
%\quad \uni{0643}{Kaf} (\fa{ك}) $\rightarrow$ \uni{06A9}{Keheh} (\fa{k}),\\
%\quad \uni{064A}{Yeh} (\fa{ي}) $\rightarrow$ \uni{06CC}{Farsi Yeh}
\begin{center}
\begin{tabular}{|l|c|c|c|c|}
\hline
\small Character & \small Isol & \small Fina & \small Medi &
\small Init \\
\hline
\uni{0643}{Arabic Letter Kaf} & \fa{ك} & \fa{"=ك} & \fa{"=ك"=} & \fa{ك"=} \\\small (Arabic Kaf)&&&&\\
\hline
\uni{06A9}{Arabic Letter Keheh} & \fa{k} & \fa{"=k} & \fa{"=k"=} & \fa{k"=} \\\small (Persian Kaf)&&&&\\
%\hline
%\uni{0649}{Alef Maksura} & \fa{ى} & \fa{"=ى} & \fa{"=ى"=} & \fa{ى"=} \\
\hline
\uni{064A}{Arabic Letter Yeh} & \fa{ي} & \fa{"=ي} & \fa{"=ي"=} & \fa{ي"=} \\
\small (Arabic Yeh)&&&&\\
\hline
\uni{06CC}{Arabic Letter Farsi Yeh} & \fa{y} & \fa{"=y} & \fa{"=y"=} & \fa{y"=} \\
\small (Persian Yeh)&&&&\\
\hline
\end{tabular}
\end{center}

\end{itemize}
\endslide

\slide
\slt{Alphabet\cont}
\begin{itemize}
\item Three shapes of composed Hamza Above:\\
\quad \uni{0623}{Alef with Hamza Above} (\fa{=a`}),\\
\quad \uni{0624}{Waw with Hamza Above} (\fa{v`}),\\
\quad \uni{0626}{Yeh with Hamza Above} (\fa{y`})
\item Never used characters:\\
%\quad \uni{0629}{Teh Marbuta} (\fa{ة}),\\
\quad \uni{0649}{Alef Maksura} (\fa{y}): Like Yeh, but no dots at all\\
\quad \uni{06C0}{Heh with Yeh Above} (\fa{ۀ}): Should
\textbf{never} be used
instead of \uniseq{\uniname{Heh, ZWNJ, Farsi Yeh}} or
\uniseq{\uniname{Heh, Hamza Above}}
sequence
\end{itemize}
\endslide

\slide
\slt{Special Characters}
\begin{itemize}
\item \uni{0640}{Arabic Tatweel}, for a longer joining stem\\
\begin{center}
\fa{ketaab} $\rightarrow$ {\fa{ke"|taab}}
\end{center}
\item \uni{200C}{Zero Width Non-Joiner}, to prevent joining\\
\begin{center}
\fa{ketaabhaa} $\rightarrow$ \fa{ketaab-haa}
\end{center}
\item \uni{200D}{Zero Width Joiner}, to choose a joined glyph
when it would not join naturally\\
\begin{center}
\fa{h.\thinspace sh} $\rightarrow$ \fa{h"=.\thinspace sh}
% TBD, faanoos bug: \fa{h"=.sh}
\end{center}
\item \uni{200E}{Left-to-Right Mark}, \uni{200F}{Right-to-Left
    Mark}, and other bidirectional
control chars (\unirange{202A}{202E})
\end{itemize}
\endslide


\slide
\slt{Numbers}
\begin{itemize}
\item
\unirange{06F0}{06F9}
\uniname{Extended Arabic-Indic Digits}:
\begin{center}
\fa{9 8 7 6 5 4 3 2 1 0}
\end{center}
instead of
\unirange{0660}{0669} \uniname{Arabic-Indic Digits}:
\begin{center}
\fa{9 8 7 ٦ ٥ ٤ 3 2 1 0}
\end{center}
\item \uni{066C}{Arabic Thousands Separator} and
\uni{066B}{Arabic Decimal Separator}:
\begin{center}
\fa{9'876'543.210}
\end{center}
\item Western numerals in Latin context.  Persian numerals
everywhere else (page numbers, section numbers, \dots)
\end{itemize}
\endslide


\slide
\slt{Other Characters}
\begin{itemize}
\item Harakat (Vowel) Non-spacing Marks:
\fa{"|A} \fa{"|E} \fa{"|O} \fa{"|AN} \fa{"|EN} \fa{"|ON}
\fa{"|"} \fa{"||} \dots
\item Arabic Punctuation Marks:
\\\quad\uni{060C}{Arabic Comma} (\fa{,}),
\\\quad\uni{061B}{Arabic Semicolon} (\fa{;}),
\\\quad\uni{061F}{Arabic Question Mark} (\fa{?}),
\\\quad\uni{066A}{Arabic Percent Sign} (\fa{\%}),
\item\uniseq{\unicode{00AB}, \unicode{00BB}} \uniname{Double Angle Quotation Marks}
\fa{<< >>}
\item Shared Punctuation Marks:
\\\quad Latin full stop, exclamation mark, parenthesis, square
brackets, \dots
\end{itemize}
\endslide
% TBD, add about RIAL, ALLAH, FARSI SYMBOL, forbidden Pres Forms
% ...
%\slide
%\slt{That's a big lie!}
%\begin{itemize}
%\step\item Glyphs: there are four dif{}ferent presentation forms of ARABIC LETTER BEH
%(\fa{b"=}, \fa{"=b"=}, \fa{"=b}, \fa{b}),
%in addition to one general one, but\dots
%\step\item Ligatures: there \emph{is} an ARABIC LIGATURE LAM ALEF (\fa{laa}), among many others
%\step\item Logos and Emblems: FARSI SYMBOL (U+262B) is there, as well as playing cards suits.
%\end{itemize}
%\endslide


\overlay
\begin{center}
\includegraphics[height=.99\textheight]{arabic-block.eps}
\end{center}
\endoverlay


\slide
\slt{Keyboard Layout}
ISIRI 2901:1994, features:
\begin{itemize}
\item All letters and punctuation marks
\item Reasonable placement
\item Persian digits
\item Regular and shifted keys only
\item Some empty slots
\end{itemize}
\endslide


\overlay
\slt{Iranian Standard Layout}
\begin{center}
\includegraphics[width=.99\textwidth]{keyboard-2901.eps}
\end{center}
\endoverlay


\slide
\slt{Keyboard Layout\cont}
Proposed update, features:
\begin{itemize}
\item Fully backward-compatible with ISIRI 2901:1994
\item Unicode 4.0 repertoire, and complete support for ISIRI 6219:2002
\item Support quoting Arabic text
\item Uses AltGr to add required but rarely used characters
\item Adds all ASCII punctuation marks, useful for editing XML,
    \dots
\item Adds bidirectional control characters
\end{itemize}
\endslide


\overlay
\slt{Proposed Iranian Layout}
\begin{center}
\includegraphics[width=.99\textwidth]{keyboard-new.eps}
\end{center}
\endoverlay


\slide
\slt{Fonts}
\begin{itemize}
\item Microsoft fonts are Arabic
\item Tahoma is the best looking one
\item Persian fonts are not Unicode compatible yet
\item The only ligature: Lam-Alef
\item Nastaliq is desired, but not possible yet
\end{itemize}
\endslide


\overlay
\slt{The Nastaliq Style}
\begin{center}
\includegraphics[height=.8\textheight]{eyd.eps}
\end{center}
\endoverlay


\slide
\slt{Date and Time}
\begin{itemize}
\item Three calendars in use!\\
\quad \textbf{Gregorian}, to synchronize with the rest of the world\\
\quad \textbf{Jalali}, the of{}f{}icial calendar\\
\quad \textbf{Islamic}, for some holidays and ceremonies
\item Islamic calendar depends on moon-sighting once a year
\item Week starts Saturday
\item Business weekdays from Saturday to Thursday
\item 24-hour preferred in media
\item No AM/PM equivalent
\end{itemize}
\endslide


\slide
\slt{Collation}
\begin{itemize}
\item Like Arabic basically
\item \hfill\fa{Y > v > h"=- > n}\quad$\rightarrow$\quad\fa{y >
h"=- > v > n}\hfill\hbox{}

\item Some L2 equal pairs:\\
\hfill
\quad\fa{k} $<_3$ \fa{K}
\quad\fa{y} $<_3$ \fa{Y}
\quad\fa{ة} $<_3$ \fa{t}
\hfill\hbox{}\\[1ex]\hfill
\quad\fa{4} $<_3$ \fa{٤}
\quad\fa{5} $<_3$ \fa{٥}
\quad\fa{6} $<_3$ \fa{٦}
\hfill\hbox{}
\item Traditional rules:  Hamza variants are L2 equal:
\\\hfill
\quad\fa{=a`}\ \ $<_3$\ \ \fa{w`}\ \ $<_3$\ \ \fa{y`}
\hfill\hbox{}
\item Modern rules:  L2 equal with their base letter:
\\\hfill
\quad\fa{a} $<_3$ \fa{=a`}
\quad\fa{w} $<_3$ \fa{w`}
\quad\fa{y} $<_3$ \fa{y`}
\hfill\hbox{}
\end{itemize}
\endslide


\slide
\slt{Loose Searching}
\begin{center}
\renewcommand{\extrarowheight}{1.5ex}
\begin{tabular}{ccc}
\uniname{ZWNJ} $\simeq$ \uniname{Space} & &
\uniname{ZWNJ} $\simeq$ \emph{empty string}
\\
\fa{حج"=\textcolor{red}{"=ت}\thinspace‌الاسلام} $\simeq$
\fa{حج"=\textcolor{red}{"=ة}\thinspace‌الاسلام} &
\quad &
\fa{دایر\textcolor{red}{ة}\thinspace‌المعارف} $\simeq$
\fa{دایر\textcolor{red}{ه}\thinspace‌المعارف}
\\
\fa{ketaab} $\simeq$ \fa{ke"=\textcolor{red}{"|}"=taab} & &
\fa{khaane"=\textcolor{red}{"=h\thinspace=y}} $\simeq$
\fa{khaane"=\textcolor{red}{"=h-ye}}
\\
{\fa{y}} $\simeq$ {\fa{Y}}\quad & &
{\fa{k}} $\simeq$ {\fa{K}}\quad
\\
\end{tabular}
\begin{tabular}{ccc}
\fa{t"=\textcolor{red}{"=ا}خیر} $\simeq$
\fa{t"=\textcolor{red}{"=أ}خیر} &
\fa{paa"=\textcolor{red}{y"=}="=iz} $\simeq$
\fa{paa"=\textcolor{red}{y`"=}="=iz} &
\fa{s"=\textcolor{red}{"=و}ال} $\simeq$
\fa{s"=\textcolor{red}{"=v`}ال}
\\
\fa{mas"=\textcolor{red}{"=y`"=}"=له} $\simeq$
\fa{mas"=\textcolor{red}{"=a`}له} &
\fa{m"=\textcolor{red}{"=a`}mn} $\not\simeq$
\fa{m"=\textcolor{red}{"=v`}mn} &
\fa{mas"=\textcolor{red}{"=v`}vl} $\simeq$
\fa{mas"=\textcolor{red}{"=y`"=}"=vl}
\\
\fa{\textcolor{red}{m"=}"=lk} $\simeq$
\fa{\textcolor{red}{mO"=}"=lk} &
\fa{\textcolor{red}{mO"=}"=lk} $\not\simeq$
\fa{\textcolor{red}{mE"=}"=lk} &
\fa{\textcolor{red}{mE"=}"=lk} $\simeq$
\fa{\textcolor{red}{m"=}"=lk}
\\
\fa{0} $\simeq$ \fa{0}
\dots\hspace{-1em}
&
\fa{4} $\simeq$ \fa{٤}
\quad\fa{5} $\simeq$ \fa{٥}
\quad\fa{6} $\simeq$ \fa{٦}
&
\hspace{-1em}\dots
\fa{9} $\simeq$ \fa{9}
\end{tabular}
\end{center}
\fa{}
\endslide


\slide
\slt{Last Notes to Application Developers}
\begin{itemize}
\item Typesetting Persian paragraphs:
\\\quad Justif{}ied lines
\\\quad No inter-letter spacing
\\\quad No word hyphenation
\\\quad Almost no inter-word spacing
\\\quad Use Tatweel instead: \fa{ketaab-e man} $\rightarrow$
\fa{ke"|"|"|t"|"|aab-e m"|"|"|n}
\item All text f{}ields Right-to-Left
\item Persian numbers
\item Right-to-Left layout
\item Beware: Right and Left are swapped!
\end{itemize}
\endslide


\overlay
\slt{An Old-style Persian Poem \small (MS Word)}
\begin{center}
\includegraphics[height=.8\textheight]{classic-poem.eps}
\end{center}
\endoverlay


\overlay
\slt{A Right-to-Left Dialog \small (Gtk+/Pango)}
\begin{center}
\includegraphics[height=.8\textheight]{color-dialog.eps}
\end{center}
\endoverlay


\overlay
\slt{A Persian Paragraph \small (Mozilla)}
\begin{center}
\includegraphics[height=.8\textheight]{asb.eps}
\end{center}
\endoverlay


\overlay
\slt{A Persian Table \small (Mozilla)}
\begin{center}
\includegraphics[height=.8\textheight]{fipa.eps}
\end{center}
\endoverlay


\overlay
\slt{A Bidirectional HTML Dialog \small (Mozilla)}
The HTML/CSS markup generating the two forms below is exactly the
  same, except for:
  \begin{itemize}
\item
  The Persian form has \prog{lang=fa}
once for the \prog{body} tag.
\item
  The Persian form has \prog{direction: rtl}
once for the \prog{body} tag.
\item
In the English form, the labels all have \prog{align: right}, in
the Persian one they have \prog{align: left}.
\end{itemize}
Unfortunately there is no way in CSS to drop the annoying
  \prog{align} dif{}ference.
\begin{center}
\includegraphics[width=.8\textwidth]{html-form.eps}
\end{center}
\endoverlay


\overlay
\slt{A Persian Web Page with Two Nice Persian Fonts \small (Mozilla)}
\begin{center}
\includegraphics[height=.8\textheight]{mozilla-persian.eps}
\end{center}
\endoverlay


\slide
\slt{Current Status -{}- Microsoft Windows}
\begin{itemize}
\item Render correctly
\vspace{-.5ex}
\item Shipped fonts work
\vspace{-.5ex}
\item Keyboard layout is terrible
\vspace{-.5ex}
\item No Persian digits support
\vspace{-.5ex}
\item No Iranian calendar
\vspace{-.5ex}
\item Locale data is wrong in places
\vspace{-.5ex}
\item No interface translation
\vspace{-.5ex}
\item Not trivial to enable Persian support
\end{itemize}
\endslide


\slide
\slt{Current Status -{}- Linux}
\begin{itemize}
\item Important systems support rendering
\item No good fonts yet
\item Standard keyboard layout
\item No Persian digits support yet
\item KDE claims Iranian calendar support
\item Some interface translation done
\item Not trivial to enable Persian support
\end{itemize}
\endslide


\slide
\slt{Current Status -{}- MacOS}
\begin{itemize}
\item Supports rendering
\item No good fonts
\item Legacy and standard keyboard layouts
\end{itemize}
\endslide


\slide
\slt{References and Resources}
\begin{itemize}
\item The Unicode Standard at \url{http://www.unicode.org/}
\item Institute of Standards and Industrial Research of Iran at
\url{http://www.isiri.com} (documents in Persian)
\item The FarsiWeb Project at \url{http://www.farsiweb.info/}
\item PersianComputing list at
    \url{http://lists.sharif.edu/mailman/listinfo/persiancomputing}
\item Typing Persian Word Documents with Windows Tutorial at \\
    \url{http://students.washington.edu/irina/persianword/persianwp.htm}
\end{itemize}
\endslide


\end{document}

\slide
\slt{}
\begin{itemize}
\item
\item
\item
\end{itemize}
\endslide

