\usetypescript[antykwa-poltawskiego]
\setupbodyfont[antykwa-poltawskiego,10pt]

\setuphead
	[subject]
	[style=\bfc]
\setuphead
	[subsubject]
	[style=\bfb]
\setuppagenumbering
	[location={footer}]
\setuplayout
	[backspace=2cm,width=middle,
	 header=0pt,headerdistance=0pt,height=24.5cm]

\def\eTeX{ε-\TeX}
% TODO
\def\XeLaTeX{Xe\LaTeX}
\def\LuaLaTeX{Lua\LaTeX}

\starttext

\centerline{\tt\bfc hyph-utf8}

\blank[big]

\centerline{Mojca Miklavec (current maintainer)}
\centerline{Arthur Reutenauer (no longer active on hyph-utf8)}

\blank[big]

\centerline{\date}

\blank[3*big]

\startalignment[center]
{\bf Abstract}

The {\tt hyph-utf8} package gathers all the existing hyphenation patterns for
\TEX, converted to UTF-8.  They can be used directly by UTF-8-aware \TEX{}
engines such as \LUATEX{} and \XETEX, and there is a mechanism to convert the
patterns to some 8-bit encoding when used with \PDFTEX{} or Knuth's \TEX.

\stopalignment

\subject{List of supported languages}

\def\lanname#1{\hbox to \textwidth{\bf#1\hss}}
\def\landata#1#2#3{\hbox to \textwidth{\hbox to 3mm{}\hbox to 6.5em{#1\hss}\hbox to 7em{#2}\hbox{#3}\hss} }
% \def\landata#1#2#3{}

\startcolumns[n=2]

\lanname{English}
\landata{-}{\bf english}{usenglish, USenglish, american}
\landata{en-us}{usenglishmax}{}
\landata{en-gb}{ukenglish}{british, UKenglish}
\lanname{Afrikaans}
\landata{af}{afrikaans}{}
\lanname{Ancientgreek}
\landata{grc}{ancientgreek}{}
\landata{grc-x-ibycus}{ibycus}{}
\lanname{Arabic}
\landata{ar}{arabic}{}
\lanname{Armenian}
\landata{hy}{armenian}{}
\lanname{Assamese}
\landata{as}{assamese}{}
\lanname{Basque}
\landata{eu}{basque}{}
\lanname{Bengali}
\landata{bn}{bengali}{}
\lanname{Bulgarian}
\landata{bg}{bulgarian}{}
\lanname{Catalan}
\landata{ca}{catalan}{}
\lanname{Chinese}
\landata{zh-latn-pinyin}{pinyin}{}
\lanname{Coptic}
\landata{cop}{coptic}{}
\lanname{Croatian}
\landata{hr}{croatian}{}
\lanname{Czech}
\landata{cs}{czech}{}
\lanname{Danish}
\landata{da}{danish}{}
\lanname{Dutch}
\landata{nl}{dutch}{}
% \column
\crlf\crlf\crlf\crlf
\lanname{Esperanto}
\landata{eo}{esperanto}{}
\lanname{Estonian}
\landata{et}{estonian}{}
\lanname{Ethiopic}
\landata{mul-ethi}{ethiopic}{amharic, geez}
\lanname{Farsi}
\landata{fa}{farsi}{persian}
\lanname{Finnish}
\landata{fi}{finnish}{}
\lanname{French}
\landata{fr}{french}{patois, francais}
\lanname{Friulan}
\landata{fur}{friulan}{furlan}
\lanname{Galician}
\landata{gl}{galician}{}
\lanname{German}
\landata{de-1901}{german}{}
\landata{de-1996}{ngerman}{}
\landata{de-ch-1901}{swissgerman}{}
\lanname{Greek}
\landata{el-monoton}{monogreek}{}
\landata{el-polyton}{greek}{polygreek}
\lanname{Gujarati}
\landata{gu}{gujarati}{}
\lanname{Hindi}
\landata{hi}{hindi}{}
\lanname{Hungarian}
\landata{hu}{hungarian}{}
\lanname{Icelandic}
\landata{is}{icelandic}{}
\lanname{Indonesian}
\landata{id}{indonesian}{}
\lanname{Interlingua}
\landata{ia}{interlingua}{}
\lanname{Irish}
\landata{ga}{irish}{}
\lanname{Italian}
\landata{it}{italian}{}
\lanname{Kannada}
\landata{kn}{kannada}{}
\lanname{Kurmanji}
\landata{kmr}{kurmanji}{}
\lanname{Lao}
\landata{lo}{lao}{}
\lanname{Latin}
\landata{la}{latin}{}
\lanname{Latvian}
\landata{lv}{latvian}{}
\lanname{Lithuanian}
\landata{lt}{lithuanian}{}
\lanname{Malayalam}
\landata{ml}{malayalam}{}
\lanname{Marathi}
\landata{mr}{marathi}{}
\lanname{Mongolian}
\landata{mn-cyrl}{mongolian}{}
\landata{mn-cyrl-x-lmc}{mongolianlmc}{}
\lanname{Norwegian}
\landata{nb}{bokmal}{norwegian, norsk}
\landata{nn}{nynorsk}{}
\lanname{Oriya}
\landata{or}{oriya}{}
\lanname{Panjabi}
\landata{pa}{panjabi}{}
\lanname{Polish}
\landata{pl}{polish}{}
\lanname{Portuguese}
\landata{pt}{portuguese}{portuges}
\lanname{Romanian}
\landata{ro}{romanian}{}
\lanname{Romansh}
\landata{rm}{romansh}{}
\lanname{Russian}
\landata{ru}{russian}{}
\lanname{Sanskrit}
\landata{sa}{sanskrit}{}
\lanname{Serbian}
\landata{sr-latn}{serbian}{}
\landata{sr-cyrl}{serbianc}{}
\lanname{Slovak}
\landata{sk}{slovak}{}
\lanname{Slovenian}
\landata{sl}{slovenian}{slovene}
\lanname{Spanish}
\landata{es}{spanish}{espanol}
\lanname{Swedish}
\landata{sv}{swedish}{}
\lanname{Tamil}
\landata{ta}{tamil}{}
\lanname{Telugu}
\landata{te}{telugu}{}
\lanname{Turkish}
\landata{tr}{turkish}{}
\lanname{Turkmen}
\landata{tk}{turkmen}{}
% \lanname{Ukenglish}
% \landata{en-gb}{ukenglish}{british, UKenglish}
\lanname{Ukrainian}
\landata{uk}{ukrainian}{}
\lanname{Uppersorbian}
\landata{hsb}{uppersorbian}{}
% \lanname{Usenglishmax}
% \landata{en-us}{usenglishmax}{}
\lanname{Welsh}
\landata{cy}{welsh}{}

\stopcolumns

\blank[3*big]

Babel defines a few more synonyms (which consequently only work in \LaTeX):

\def\lansyn#1#2{\hbox to \textwidth{\hbox to 3mm{}\hbox to 6.5em{\bf#1\hss}\hbox{#2}\hss}}
\lansyn{english}{canadian}
\lansyn{british}{australian, newzealand}
\lansyn{german}{austrian}
\lansyn{ngerman}{naustrian}
\lansyn{portuguese}{brazilian, brazil}

\page

\subject{Using hyphenation patterns}

\subsubject{Plain \TeX}

In engines that support \eTeX\ you can select the desired hyphenation patterns with:
\startTEX
\uselanguage{langname}
\stopTEX
where \type{langname} is the string identifying a particular hyphenation file in \type{language.dat} and can be taken from table on the first two pages.
% TODO: create a proper table and reference it

\subsubject{\LaTeX}

Since Babel's \type{hyphen.cfg} is built in the \XeLaTeX format, hyphenation patterns can be used without even loading Babel or Polyglossia. At the low-level this simply corresponds to defining
\startTEX
   \language=\l@<langname>
\stopTEX
The user command is supposed to be
\startTEX
    \hyphenrules{langname}
\stopTEX
or
\startTEX
   \begin{hyphenrules}{langname} ... \end{hyphenrules}.
\stopTEX
and should work with any flavour of \LaTeX, however we couldn't make it work.

\subsubsubject{\LaTeX\ with Babel}

You can use Babel with any \TeX\ engine, however it is currently unmaintained and has never been adapted to work well with Unicode engines. If you are using \XeTeX\ please use Polyglossia instead.

\startTEX
\usepackage[languagename]{babel}
\stopTEX

\subsubsubject{\LaTeX\ with Polyglossia}

Polyglossia should be the preferred choice when using \XeLaTeX. It doesn't support \LuaLaTeX\ yet, but it is planned to extend it in future.

\startTEX
\usepackage{polyglossia}
\setmainlanguage[optional settings]{langname}
\setotherlanguages{otherlangname}

\begin[optional settings]{otherlangname} ... \end{otherlangname}
\stopTEX

See Polyglossia manual for extensive list of options.

\subsubject{\ConTeXt}

ConTeXt doesn't load patterns for all the language that hyph-utf8 provides. If you miss any language, please contact the mailing list. The general syntax for supported languages is the following:

\startTEX
% language of the main document
\mainlanguage[language]

{\language[otherlanguage] language of some short fragment}
\stopTEX

You can use full language name or language code. When using \ConTeXt\ MKII you might need to select the appropriate font encoding for Cyrillic scripts, Polish and some other languages:

\startTEX
\usetypescript[iwona][qx]
\setupbodyfont[iwona]
\mainlanguage[polish]
\stopTEX

\ConTeXt\ loads hyphenation patterns in several encodings, so that you can for example use Czech patterns with either \type{ec} or \type{il2} font encodings. The right hyphenation patterns will be chosen based on current font encoding.

\subsubject{More examples}

\subsubsubject{Example for Polyglossia}

\startTEX
\usepackage{polyglossia}
% the language used for main document
\setmainlanguage{asturian}
% American English with extended hyphenation patterns
\setotherlanguage[variant=usmax]{english}
% German with experimental patterns "ngerman-x-latest"
\setotherlanguage[spelling=new,latesthyphen=true]{german}
\setotherlanguages{spanish,catalan,french}

\begin{document}

Long Asturian text ... (Hyphenation for Asturian is not available, but polyglossia automatically falls back on Catalan for now, which seems to be a reasonable choice.)

\begin{german}
Deutscher Text ... (with the hyphenation patterns selected above: "ngerman-x-latest")
\end{german}

\begin[script=fraktur,spelling=old]{german}
Deutſcher Text ... (set in Fraktur, with traditional hyphenation).
\end{german}

\end{document}
\stopTEX

\stoptext
