summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/fontspec/fontspec.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/fontspec/fontspec.dtx')
-rw-r--r--Master/texmf-dist/source/latex/fontspec/fontspec.dtx557
1 files changed, 288 insertions, 269 deletions
diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec.dtx
index d0c26505930..bbe70b83cce 100644
--- a/Master/texmf-dist/source/latex/fontspec/fontspec.dtx
+++ b/Master/texmf-dist/source/latex/fontspec/fontspec.dtx
@@ -63,7 +63,7 @@ This work consists of this file fontspec.dtx
%<fontspec>\ProvidesPackage{fontspec}
%<patches>\ProvidesPackage{fontspec-patches}
%<*fontspec|patches>
- [2010/06/08 v2.0 Advanced font selection for XeLaTeX/LuaLaTeX]
+ [2010/07/11 v2.0a Advanced font selection for XeLaTeX/LuaLaTeX]
%</fontspec|patches>
%
%<*driver>
@@ -238,6 +238,7 @@ This work consists of this file fontspec.dtx
% \item For general font features, see \vref{sec:font-ind-features}
% \item For OpenType fonts, see Part~\vref{sec:opentype-features}
% \item For \XeTeX-only general font features, see Part~\vref{sec:xetex-features}
+% \item For \LuaTeX-only general font features, see Part~\vref{sec:luatex-features}
% \item For features for \AAT\ fonts in \XeTeX, see Part~\vref{sec:aat-features}
% \end{itemize}
%
@@ -484,7 +485,7 @@ This work consists of this file fontspec.dtx
% \end{Verbatim}
%
% All of the bold, italic, and small caps fonts can be loaded with different
-% font features from the main font. See \ref{bfit-feat} for details.
+% font features from the main font. See \ref{sec:bfit-feat} for details.
%
% \subsection{Math(s) fonts}
%
@@ -579,7 +580,7 @@ This work consists of this file fontspec.dtx
%
% \begin{Xexample}{dff}{A demonstration of the \cs{defaultfontfeatures} command.}
% \fontspec{TeX Gyre Adventor}
-% Some `default' Didot 0123456789 \\
+% Some default text 0123456789 \\
% \defaultfontfeatures{
% Numbers=OldStyle, Color=888888
% }
@@ -750,6 +751,7 @@ This work consists of this file fontspec.dtx
% Otherwise, the font sizes greater than 10 won't be defined!
%
% \begin{table}
+% \caption{Syntax for specifying the size to apply custom font features.}\label{tab:sizing}
% \centering
% \begin{tabular}{@{}ll@{}}
% \toprule
@@ -761,7 +763,6 @@ This work consists of this file fontspec.dtx
% |Size = X| & $s = \texttt{X}$ \\
% \bottomrule
% \end{tabular}
-% \caption{Syntax for specifying the size to apply custom font features.}\label{tab:sizing}
% \end{table}
%
%
@@ -908,16 +909,10 @@ This work consists of this file fontspec.dtx
% feature. It takes three types of input, which are chosen according to some
% simple rules. If the input is the string \opt{None}, then hyphenation is
% suppressed for this font.
-% \note{Known bug: this doesn't work yet in Lua\LaTeX.}
% If the input is a single character, then this
% character is used. Finally, if the input is longer than a single character
% it must be the UTF-8 slot number of the hyphen character you desire.
%
-% Adobe Garamond Pro's uppercase hyphenation character
-% is used to demonstrate a possible use for this feature in \exref{hyphchar}.
-% Note that in an actual situation, the \opt{Uppercase} option of the \feat{Letters} feature
-% would probably supply this for you (see \vref{sec:letters}).
-%
% This package
% redefines \LaTeX's \cmd\-\ macro
% such that it adjusts along with the above changes.
@@ -927,13 +922,11 @@ This work consists of this file fontspec.dtx
% EXAMPLE HYPHENATION%
% }}\qquad\qquad\null\par\bigskip}
%
-% \fontspec{Adobe Garamond Pro}
+% \fontspec{Linux Libertine}
% \addfontfeature{HyphenChar=None}
% \text
% \addfontfeature{HyphenChar={+}}
% \text
-% \addfontfeature{HyphenChar={"F6BA}}
-% \text
% \end{Xexample}
%
% \subsection{Optical font sizes} \label{sec:opticalsize}
@@ -1022,6 +1015,7 @@ This work consists of this file fontspec.dtx
% with a specially drawn glyph for functional or \ae sthetic reasons.
% The list of options, of which multiple may be selected at one time,
% is shown in \ref{feat:Ligatures}.
+% A demonstration with the Linux Libertine fonts\footnote{\url{http://www.linuxlibertine.org/}} is shown in \exref{lig}.
%
% \begin{features}{Ligatures}
% \otf*{Required}{rlig}
@@ -1032,12 +1026,14 @@ This work consists of this file fontspec.dtx
% \otf{TeX}{tlig/trep}
% \end{features}
%
-% \begin{Lexample}{lig}{An example of the \feat{Ligatures} feature.}
-% \Huge
-% \fontspec[Ligatures=Rare]{Adobe Garamond Pro}
-% \textit{strict firefly} \\
-% \fontspec[Ligatures=NoCommon]{Adobe Garamond Pro}
-% \textit{strict firefly}
+% \begin{Lexample}[firstline=2]{lig}{An example of the \feat{Ligatures} feature.}
+% \Huge\centering
+% \def\test#1#2{%
+% #2 $\to$ {\addfontfeature{#1} #2}\\}
+% \fontspec{Linux Libertine}
+% \test{Ligatures=Historical}{strict}
+% \test{Ligatures=Rare}{wurtzite}
+% \test{Ligatures=NoCommon}{firefly}
% \end{Lexample}
%
% \subsection{Letters} \label{sec:letters}
@@ -1082,7 +1078,7 @@ This work consists of this file fontspec.dtx
% in \exref{letters-uppercase}.
%
% \begin{Lexample}{letters-uppercase}{An example of the \opt{Uppercase} option of the \feat{Letters} feature.}
-% \fontspec{Adobe Garamond Pro}
+% \fontspec{Linux Libertine}
% UPPER-CASE example \\
% \addfontfeature{Letters=Uppercase}
% UPPER-CASE example
@@ -1102,7 +1098,7 @@ This work consists of this file fontspec.dtx
% \otf{Proportional}{pnum}
% \otf{Monospaced}{tnum}
% \otf{SlashedZero}{zero}
-% \otf{Remap}{anum}
+% \otf{Arabic}{anum}
% \end{features}
%
% The synonyms
@@ -1115,12 +1111,7 @@ This work consists of this file fontspec.dtx
%
% The \opt{SlashedZero} option
% replaces the default zero with a slashed version to prevent
-% confusion with an uppercase `O'.
-%
-% The \opt{Remap} option maps numerals to their Arabic or Farsi equivalents
-% based on the current \opt{Language} setting (see \vref{sec:ot}). This
-% is based on a \LuaTeX\ feature of the \pkg{luaotfload} package,
-% not an OpenType feature.
+% confusion with an uppercase `O', shown in \exref{slashzero}.
%
% \begin{Lexample}{slashzero}{The effect of the \opt{SlashedZero} option.}
% \fontspec[Numbers=Lining]{TeX Gyre Bonum}
@@ -1129,6 +1120,20 @@ This work consists of this file fontspec.dtx
% 0123456789
% \end{Lexample}
%
+% The \opt{Arabic} option maps numerals to their Arabic or Persian equivalents
+% based on the current \opt{Language} setting (see \vref{sec:ot}), shown in
+% \exref{num-arab} using the Zar fonts\footnote{\url{http://wiki.irmug.org/index.php/X_Series_2}}.
+% This option is based on a \LuaTeX\ feature of the \pkg{luaotfload} package,
+% not an OpenType feature. (Thus, this feature is unavailable in \XeTeX.)
+%
+% \begin{Lexample}[firstline=2]{num-arab}{An example of number remapping to Arabic or Persian. (\LuaTeX\ only.)}
+% \huge
+% \fontspec[Script=Arabic,Numbers=Arabic]{XB Zar}
+% {\addfontfeature{Language=Arabic}
+% 0123456789} \\
+% {\addfontfeature{Language=Parsi}
+% 0123456789}
+% \end{Lexample}
%
% \subsection{Contextuals}
% This feature refers to glyph substitution that vary by their position;
@@ -1221,7 +1226,9 @@ This work consists of this file fontspec.dtx
% \subsection{StylisticSet}
%
% This feature selects a `Stylistic Set' variation,
-% specified numerically. These correspond to OpenType
+% which usually corresponds to an alternate glyph style for a range of
+% characters (usually an alphabet or subset thereof).
+% This feature is specified numerically. These correspond to OpenType
% features |ss01|, |ss02|, etc.
%
% Two demonstrations from the Junicode
@@ -1248,23 +1255,25 @@ This work consists of this file fontspec.dtx
% which should be done on a per-font basis.
%
% \subsection{Alternates}
-% Selection of the \feat{Alternate} feature again
-% must be done numerically.
%
-% For OpenType fonts, this option is used to access numerical
-% variations of the raw |salt| feature. I can't show an example,
-% but here's how it would be used:
-% \begin{verbatim}
-% \fontspec[Alternate=1]{Garamond Premier Pro}
-% \end{verbatim}
-% Numbering starts from |0| for the first stylistic alternate.
+% The \feat{Alternate} feature (for the raw OpenType feature |salt|) is used to access alternate font glyphs when variations exist in the font, such as in \exref{salt}.
+% It uses a numerical selection, starting from zero, that will be different for each font.
% Note that the \texttt{Style=Alternate} option is equivalent
% to \texttt{Alternate=0} to access the default case.
%
+% \begin{Xexample}[firstline=2]{salt}{The \feat{Alternate} feature.}
+% \huge
+% \fontspec{Linux Libertine}
+% \textsc{a} \& h \\
+% \addfontfeature{Alternate=0}
+% \textsc{a} \& h
+% \end{Xexample}
+%
% See \vref{sec:newfeatures} for a way to assign names to alternates,
-% which should be done on a per-font basis.
+% which must be done on a per-font basis.
%
% \subsection{Style}
+% \label{sec:ot-feat-style}
%
% \begin{features}{Style}
% \otf{Alternate}{salt}
@@ -1282,9 +1291,57 @@ This work consists of this file fontspec.dtx
% For fonts with multiple |salt| OpenType features,
% use the fontspec \feat{Alternate} feature instead.
%
-% Typical examples for these features are shown in \ref{sec:ot-feat-style}.
+% \Exref{style-alt} and \exref{style-hist} both contain glyph
+% subtitutions with similar characteristics.
+% Note the occasional inconsistency with which font features are labelled; a long-tailed `Q' could turn up anywhere!
+%
+% \begin{Lexample}[firstline=2]{style-alt}{Example of the \opt{Alternate} option of the \feat{Style} feature.}
+% \Large
+% \fontspec{Warnock Pro}
+% K Q R k v w y \\
+% \addfontfeature{Style=Alternate}
+% K Q R k v w y
+% \end{Lexample}
+%
+% \begin{Lexample}[firstline=2]{style-hist}{Example of the \opt{Historic} option of the \feat{Style} feature.}
+% \Large
+% \fontspec{Adobe Jenson Pro}
+% M Q Z \\
+% \addfontfeature{Style=Historic}
+% M Q Z
+% \end{Lexample}
+%
+% In other features, larger breadths of changes can be seen, covering
+% the style of an entire alphabet. See \exref{style-titl} and \exref{style-itrub}; in the latter, the \opt{Italic} option affects the Latin text and the \opt{Ruby} option the Japanese.
+%
+% \begin{Lexample}[firstline=2]{style-titl}{Example of the \opt{TitlingCaps} option of the \feat{Style} feature.}
+% \Large
+% \fontspec{Adobe Garamond Pro}
+% TITLING CAPS \\
+% \addfontfeature{Style=TitlingCaps}
+% TITLING CAPS
+% \end{Lexample}
%
+% \begin{Xexample}[firstline=2]{style-itrub}{Example of the \opt{Italic} and \opt{Ruby} options of the \feat{Style} feature.}
+% \Large \def\kana{ようこそ ワカヨタレソ}
+% \fontspec{Hiragino Mincho Pro}
+% Latin \kana \\
+% \addfontfeature{Style={Italic, Ruby}}
+% Latin \kana
+% \end{Xexample}
%
+% Note the difference here between the default and the horizontal style kana
+% in \exref{style-hvkana}.
+%
+% \begin{Xexample}[firstline=2]{style-hvkana}{Example of the \opt{HorizontalKana} and \opt{VerticalKana} options of the \feat{Style} feature.}
+% \Large \def\kana{ようこそ ワカヨタレソ}
+% \fontspec{Hiragino Mincho Pro}
+% \kana \\
+% {\addfontfeature{Style=HorizontalKana}
+% \kana } \\
+% {\addfontfeature{Style=VerticalKana}
+% \kana }
+% \end{Xexample}
%
% \subsection{Diacritics}
% Specifies how diacritics should be placed.
@@ -1317,6 +1374,52 @@ This work consists of this file fontspec.dtx
% \end{Lexample}
%
%
+% \subsection{Font transformations}
+%
+% In rare situations users may want to mechanically distort the shapes of the glyphs in the current font such as shown in \exref{fake}. Please don't overuse these features; they are \emph{not} a good alternative to having the real shapes.
+%
+% \begin{Xexample}{fake}{Articifial font transformations.}
+% \fontspec{Charis SIL} \emph{ABCxyz} \quad
+% \fontspec[FakeSlant=0.2]{Charis SIL} ABCxyz
+%
+% \fontspec{Charis SIL} ABCxyz \quad
+% \fontspec[FakeStretch=1.2]{Charis SIL} ABCxyz
+%
+% \fontspec{Charis SIL} \textbf{ABCxyz} \quad
+% \fontspec[FakeBold=1.5]{Charis SIL} ABCxyz
+% \end{Xexample}
+%
+% If values are omitted, their defaults are as shown above.
+%
+% If you want the bold shape to be faked automatically, or the italic shape
+% to be slanted automatically, use the \feat{AutoFakeBold} and
+% \feat{AutoFakeSlant} features. For example, the following two invocations
+% are equivalent:
+% \begin{verbatim}
+% \fontspec[AutoFakeBold=1.5]{Charis SIL}
+% \fontspec[BoldFeatures={FakeBold=1.5}]{Charis SIL}
+% \end{verbatim}
+%
+% If both of the \feat{AutoFake...} features are used, then the bold italic
+% font will also be faked.
+%
+% Currently, \feat{FakeStretch} doesn't work in \LuaTeX\ and will be ignored
+% silently.
+%
+% \subsection{Annotation}
+% Some fonts are equipped with an extensive range of
+% numbers and numerals in different forms. These are accessed with the
+% \feat{Annotation} feature (OpenType feature |nalt|), selected numerically as shown in
+% \exref{ot-annot}.
+%
+% \begin{Xexample}{ot-annot}{Annotation forms for OpenType fonts.}
+% \fontspec{Hiragino Maru Gothic Pro}
+% 1 2 3 4 5 6 7 8 9
+% \def\x#1{\\{\addfontfeature{Annotation=#1}
+% 1 2 3 4 5 6 7 8 9 }}
+% \x0\x1\x2\x3\x4\x5\x6\x7\x7\x8\x9
+% \end{Xexample}
+%
% \subsection{CJK shape}
%
% \begin{features}{CJKShape}
@@ -1510,42 +1613,92 @@ This work consists of this file fontspec.dtx
% the script or language is requested.
%
% \begin{table}[!hbp]
-% \def\dup{\makebox[0pt][r]{\textcolor{red}{\P}}}% % \setlength\columnseprule{0pt}
+% \caption{Defined \opt{Script}s for OpenType fonts. Aliased names are shown in adjacent positions marked with red pilcrows ({\sffamily\textcolor{red}{\P}}).}
+% \label{tab:ot-scpt}
+% \def\dup{\makebox[0pt][r]{\textcolor{red}{\P}}}
+% \setlength\columnseprule{0pt}
% \hrule
% \begin{multicols}{4}\setlength\parindent{0pt}
% \sffamily\scriptsize
% Arabic \par Armenian \par Balinese \par Bengali \par Bopomofo \par Braille \par Buginese \par Buhid \par Byzantine Music \par Canadian Syllabics \par Cherokee \par \dup CJK \par \dup CJK Ideographic \par Coptic \par Cypriot Syllabary \par Cyrillic \par Default \par Deseret \par Devanagari \par Ethiopic \par Georgian \par Glagolitic \par Gothic \par Greek \par Gujarati \par Gurmukhi \par Hangul Jamo \par Hangul \par Hanunoo \par Hebrew \par \dup Hiragana and Katakana \par \dup Kana \par Javanese \par Kannada \par Kharosthi \par Khmer \par Lao \par Latin \par Limbu \par Linear B \par Malayalam \par \dup Math \par \dup Maths \par Mongolian \par Musical Symbols \par Myanmar \par N'ko \par Ogham \par Old Italic \par Old Persian Cuneiform \par Oriya \par Osmanya \par Phags-pa \par Phoenician \par Runic \par Shavian \par Sinhala \par Sumero-Akkadian Cuneiform \par Syloti Nagri \par Syriac \par Tagalog \par Tagbanwa \par Tai Le \par Tai Lu \par Tamil \par Telugu \par Thaana \par Thai \par Tibetan \par Tifinagh \par Ugaritic Cuneiform \par Yi
% \end{multicols}
% \hrule
-% \caption{Defined \opt{Script}s for OpenType fonts. Aliased names are shown in adjacent positions marked with red pilcrows ({\sffamily\textcolor{red}{\P}}), defined in \texttt{fontspec.cfg}.}
-% \label{tab:ot-scpt}
% \end{table}
%
% \begin{table}[p]
% \vspace*{-3cm}
% \hspace{-3cm}
+% \def\dup{\makebox[0pt][r]{\textcolor{red}{\P}}}
% \begin{minipage}{\linewidth+4cm}
+% \caption{Defined \opt{Language}s for OpenType fonts. Aliased names are shown in adjacent positions marked with red pilcrows ({\sffamily\textcolor{red}{\P}}).}
+% \label{tab:ot-lang}
% \setlength\columnseprule{0pt}
% \hrule
% \begin{multicols}{6}
% \everypar{\setlength\parindent{0pt}\setlength\hangindent{2em}}
% \sffamily\footnotesize\raggedright
-% Abaza \par Abkhazian \par Adyghe \par Afrikaans \par Afar \par Agaw \par Altai \par Amharic \par Arabic \par Aari \par Arakanese \par Assamese \par Athapaskan \par Avar \par Awadhi \par Aymara \par Azeri \par Badaga \par Baghelkhandi \par Balkar \par Baule \par Berber \par Bench \par Bible Cree \par Belarussian \par Bemba \par Bengali \par Bulgarian \par Bhili \par Bhojpuri \par Bikol \par Bilen \par Blackfoot \par Balochi \par Balante \par Balti \par Bambara \par Bamileke \par Breton \par Brahui \par Braj Bhasha \par Burmese \par Bashkir \par Beti \par Catalan \par Cebuano \par Chechen \par Chaha Gurage \par Chattisgarhi \par Chichewa \par Chukchi \par Chipewyan \par Cherokee \par Chuvash \par Comorian \par Coptic \par Cree \par Carrier \par Crimean Tatar \par Church Slavonic \par Czech \par Danish \par Dargwa \par Woods Cree \par German \par Default \par Dogri \par Divehi \par Djerma \par Dangme \par Dinka \par Dungan \par Dzongkha \par Ebira \par Eastern Cree \par Edo \par Efik \par Greek \par English \par Erzya \par Spanish \par Estonian \par Basque \par Evenki \par Even \par Ewe \par French Antillean \par Farsi \par Finnish \par Fijian \par Flemish \par Forest Nenets \par Fon \par Faroese \par French \par Frisian \par Friulian \par Futa \par Fulani \par Ga \par Gaelic \par Gagauz \par Galician \par Garshuni \par Garhwali \par Ge'ez \par Gilyak \par Gumuz \par Gondi \par Greenlandic \par Garo \par Guarani \par Gujarati \par Haitian \par Halam \par Harauti \par Hausa \par Hawaiin \par Hammer-Banna \par Hiligaynon \par Hindi \par High Mari \par Hindko \par Ho \par Harari \par Croatian \par Hungarian \par Armenian \par Igbo \par Ijo \par Ilokano \par Indonesian \par Ingush \par Inuktitut \par Irish \par Irish Traditional \par Icelandic \par Inari Sami \par Italian \par Hebrew \par Javanese \par Yiddish \par Japanese \par Judezmo \par Jula \par Kabardian \par Kachchi \par Kalenjin \par Kannada \par Karachay \par Georgian \par Kazakh \par Kebena \par Khutsuri Georgian \par Khakass \par Khanty-Kazim \par Khmer \par Khanty-Shurishkar \par Khanty-Vakhi \par Khowar \par Kikuyu \par Kirghiz \par Kisii \par Kokni \par Kalmyk \par Kamba \par Kumaoni \par Komo \par Komso \par Kanuri \par Kodagu \par Korean Old Hangul \par Konkani \par Kikongo \par Komi-Permyak \par Korean \par Komi-Zyrian \par Kpelle \par Krio \par Karakalpak \par Karelian \par Karaim \par Karen \par Koorete \par Kashmiri \par Khasi \par Kildin Sami \par Kui \par Kulvi \par Kumyk \par Kurdish \par Kurukh \par Kuy \par Koryak \par Ladin \par Lahuli \par Lak \par Lambani \par Lao \par Latin \par Laz \par L-Cree \par Ladakhi \par Lezgi \par Lingala \par Low Mari \par Limbu \par Lomwe \par Lower Sorbian \par Lule Sami \par Lithuanian \par Luba \par Luganda \par Luhya \par Luo \par Latvian \par Majang \par Makua \par Malayalam Traditional \par Mansi \par Marathi \par Marwari \par Mbundu \par Manchu \par Moose Cree \par Mende \par Me'en \par Mizo \par Macedonian \par Male \par Malagasy \par Malinke \par Malayalam Reformed \par Malay \par Mandinka \par Mongolian \par Manipuri \par Maninka \par Manx Gaelic \par Moksha \par Moldavian \par Mon \par Moroccan \par Maori \par Maithili \par Maltese \par Mundari \par Naga-Assamese \par Nanai \par Naskapi \par N-Cree \par Ndebele \par Ndonga \par Nepali \par Newari \par Nagari \par Norway House Cree \par Nisi \par Niuean \par Nkole \par N'ko \par Dutch \par Nogai \par Norwegian \par Northern Sami \par Northern Tai \par Esperanto \par Nynorsk \par Oji-Cree \par Ojibway \par Oriya \par Oromo \par Ossetian \par Palestinian Aramaic \par Pali \par Punjabi \par Palpa \par Pashto \par Polytonic Greek \par Pilipino \par Palaung \par Polish \par Provencal \par Portuguese \par Chin \par Rajasthani \par R-Cree \par Russian Buriat \par Riang \par Rhaeto-Romanic \par Romanian \par Romany \par Rusyn \par Ruanda \par Russian \par Sadri \par Sanskrit \par Santali \par Sayisi \par Sekota \par Selkup \par Sango \par Shan \par Sibe \par Sidamo \par Silte Gurage \par Skolt Sami \par Slovak \par Slavey \par Slovenian \par Somali \par Samoan \par Sena \par Sindhi \par Sinhalese \par Soninke \par Sodo Gurage \par Sotho \par Albanian \par Serbian \par Saraiki \par Serer \par South Slavey \par Southern Sami \par Suri \par Svan \par Swedish \par Swadaya Aramaic \par Swahili \par Swazi \par Sutu \par Syriac \par Tabasaran \par Tajiki \par Tamil \par Tatar \par TH-Cree \par Telugu \par Tongan \par Tigre \par Tigrinya \par Thai \par Tahitian \par Tibetan \par Turkmen \par Temne \par Tswana \par Tundra Nenets \par Tonga \par Todo \par Turkish \par Tsonga \par Turoyo Aramaic \par Tulu \par Tuvin \par Twi \par Udmurt \par Ukrainian \par Urdu \par Upper Sorbian \par Uyghur \par Uzbek \par Venda \par Vietnamese \par Wa \par Wagdi \par West-Cree \par Welsh \par Wolof \par Tai Lue \par Xhosa \par Yakut \par Yoruba \par Y-Cree \par Yi Classic \par Yi Modern \par Chinese Hong Kong \par Chinese Phonetic \par Chinese Simplified \par Chinese Traditional \par Zande \par Zulu
+% Abaza \par Abkhazian \par Adyghe \par Afrikaans \par Afar \par Agaw \par Altai \par Amharic \par Arabic \par Aari \par Arakanese \par Assamese \par Athapaskan \par Avar \par Awadhi \par Aymara \par Azeri \par Badaga \par Baghelkhandi \par Balkar \par Baule \par Berber \par Bench \par Bible Cree \par Belarussian \par Bemba \par Bengali \par Bulgarian \par Bhili \par Bhojpuri \par Bikol \par Bilen \par Blackfoot \par Balochi \par Balante \par Balti \par Bambara \par Bamileke \par Breton \par Brahui \par Braj Bhasha \par Burmese \par Bashkir \par Beti \par Catalan \par Cebuano \par Chechen \par Chaha Gurage \par Chattisgarhi \par Chichewa \par Chukchi \par Chipewyan \par Cherokee \par Chuvash \par Comorian \par Coptic \par Cree \par Carrier \par Crimean Tatar \par Church Slavonic \par Czech \par Danish \par Dargwa \par Woods Cree \par German \par Default \par Dogri \par Divehi \par Djerma \par Dangme \par Dinka \par Dungan \par Dzongkha \par Ebira \par Eastern Cree \par Edo \par Efik \par Greek \par English \par Erzya \par Spanish \par Estonian \par Basque \par Evenki \par Even \par Ewe \par French Antillean \par \dup Farsi \par \dup Parsi \par \dup Persian \par Finnish \par Fijian \par Flemish \par Forest Nenets \par Fon \par Faroese \par French \par Frisian \par Friulian \par Futa \par Fulani \par Ga \par Gaelic \par Gagauz \par Galician \par Garshuni \par Garhwali \par Ge'ez \par Gilyak \par Gumuz \par Gondi \par Greenlandic \par Garo \par Guarani \par Gujarati \par Haitian \par Halam \par Harauti \par Hausa \par Hawaiin \par Hammer-Banna \par Hiligaynon \par Hindi \par High Mari \par Hindko \par Ho \par Harari \par Croatian \par Hungarian \par Armenian \par Igbo \par Ijo \par Ilokano \par Indonesian \par Ingush \par Inuktitut \par Irish \par Irish Traditional \par Icelandic \par Inari Sami \par Italian \par Hebrew \par Javanese \par Yiddish \par Japanese \par Judezmo \par Jula \par Kabardian \par Kachchi \par Kalenjin \par Kannada \par Karachay \par Georgian \par Kazakh \par Kebena \par Khutsuri Georgian \par Khakass \par Khanty-Kazim \par Khmer \par Khanty-Shurishkar \par Khanty-Vakhi \par Khowar \par Kikuyu \par Kirghiz \par Kisii \par Kokni \par Kalmyk \par Kamba \par Kumaoni \par Komo \par Komso \par Kanuri \par Kodagu \par Korean Old Hangul \par Konkani \par Kikongo \par Komi-Permyak \par Korean \par Komi-Zyrian \par Kpelle \par Krio \par Karakalpak \par Karelian \par Karaim \par Karen \par Koorete \par Kashmiri \par Khasi \par Kildin Sami \par Kui \par Kulvi \par Kumyk \par Kurdish \par Kurukh \par Kuy \par Koryak \par Ladin \par Lahuli \par Lak \par Lambani \par Lao \par Latin \par Laz \par L-Cree \par Ladakhi \par Lezgi \par Lingala \par Low Mari \par Limbu \par Lomwe \par Lower Sorbian \par Lule Sami \par Lithuanian \par Luba \par Luganda \par Luhya \par Luo \par Latvian \par Majang \par Makua \par Malayalam Traditional \par Mansi \par Marathi \par Marwari \par Mbundu \par Manchu \par Moose Cree \par Mende \par Me'en \par Mizo \par Macedonian \par Male \par Malagasy \par Malinke \par Malayalam Reformed \par Malay \par Mandinka \par Mongolian \par Manipuri \par Maninka \par Manx Gaelic \par Moksha \par Moldavian \par Mon \par Moroccan \par Maori \par Maithili \par Maltese \par Mundari \par Naga-Assamese \par Nanai \par Naskapi \par N-Cree \par Ndebele \par Ndonga \par Nepali \par Newari \par Nagari \par Norway House Cree \par Nisi \par Niuean \par Nkole \par N'ko \par Dutch \par Nogai \par Norwegian \par Northern Sami \par Northern Tai \par Esperanto \par Nynorsk \par Oji-Cree \par Ojibway \par Oriya \par Oromo \par Ossetian \par Palestinian Aramaic \par Pali \par Punjabi \par Palpa \par Pashto \par Polytonic Greek \par Pilipino \par Palaung \par Polish \par Provencal \par Portuguese \par Chin \par Rajasthani \par R-Cree \par Russian Buriat \par Riang \par Rhaeto-Romanic \par Romanian \par Romany \par Rusyn \par Ruanda \par Russian \par Sadri \par Sanskrit \par Santali \par Sayisi \par Sekota \par Selkup \par Sango \par Shan \par Sibe \par Sidamo \par Silte Gurage \par Skolt Sami \par Slovak \par Slavey \par Slovenian \par Somali \par Samoan \par Sena \par Sindhi \par Sinhalese \par Soninke \par Sodo Gurage \par Sotho \par Albanian \par Serbian \par Saraiki \par Serer \par South Slavey \par Southern Sami \par Suri \par Svan \par Swedish \par Swadaya Aramaic \par Swahili \par Swazi \par Sutu \par Syriac \par Tabasaran \par Tajiki \par Tamil \par Tatar \par TH-Cree \par Telugu \par Tongan \par Tigre \par Tigrinya \par Thai \par Tahitian \par Tibetan \par Turkmen \par Temne \par Tswana \par Tundra Nenets \par Tonga \par Todo \par Turkish \par Tsonga \par Turoyo Aramaic \par Tulu \par Tuvin \par Twi \par Udmurt \par Ukrainian \par Urdu \par Upper Sorbian \par Uyghur \par Uzbek \par Venda \par Vietnamese \par Wa \par Wagdi \par West-Cree \par Welsh \par Wolof \par Tai Lue \par Xhosa \par Yakut \par Yoruba \par Y-Cree \par Yi Classic \par Yi Modern \par Chinese Hong Kong \par Chinese Phonetic \par Chinese Simplified \par Chinese Traditional \par Zande \par Zulu
% \end{multicols}
% \hspace{4pt}
% \hrule
-% \caption{Defined \opt{Language}s for OpenType fonts.
-% Note that they are sorted alphabetically \emph{not}
-% by name but by OpenType tag, which is a little irritating, really.}
-% \label{tab:ot-lang}
% \end{minipage}
% \end{table}
%
%
%
+% \part{\LuaTeX-only font features}
+% \label{sec:luatex-features}
+%
+% \section{OpenType font feature files}
+%
+% An OpenType font feature file is a plain text file descriping OpenType layout
+% feature of a font in a human-readable format. The syntax of OpenType feature
+% files is define by Adobe\footnote{\url{http://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html}}.
+%
+% Feature files can be used to add or customise OpenType feature of a font on
+% the fly without editing the font file itself.
+%
+% Feature files are loading by passing its name or path to \feat{FeatureFile},
+% then OpenType features defined in the file can be applied as usual.
+%
+% For example, to added OpenType mapping of f-ligatures in Times New Roman
+% font, one can define a \texttt{times-nr.fea} file with content shown in
+% Figure~\ref{fig:featurefile}.
+% Then the font with the new ligatures can be loaded with:
+% \begin{Verbatim}
+% \setmainfont[FeatureFile=times-nr.fea]{Times New Roman}
+% \end{Verbatim}
+%
+% \begin{figure}
+% \caption{Addition of ligatures to a font via the \feat{FeatureFile} font feature.}
+% \label{fig:featurefile}
+% \hrule
+% \begin{Verbatim}
+% lookup fligatures {
+% lookupflag 0;
+% sub \f \i by \fi;
+% sub \f \l by \fl;
+% } fligatures;
+%
+% feature liga {
+% script DFLT;
+% language dflt ;
+% lookup fligatures;
+%
+% script latn;
+% language dflt ;
+% lookup fligatures;
+% } liga;
+% \end{Verbatim}
+% \hrule
+% \end{figure}
+%
% \part{Fonts and features with \XeTeX}
% \label{sec:xetex-features}
%
+%
+%
+%
% \section{\XeTeX-only font features}
%
% The features described here are available for any font
@@ -1583,37 +1736,7 @@ This work consists of this file fontspec.dtx
% Also see the OpenType \opt{Uppercase}
% option of the \feat{Letters} feature (\vref*{sec:letters}).
%
-% \subsection{Font transformations}
-%
-% In rare situations users may want to mechanically distort the shapes of the glyphs in the current font such as shown in \exref{fake}. Please don't overuse these features; they are \emph{not} a good alternative to having the real shapes.
-%
-% \begin{Xexample}{fake}{Articifial font transformations.}
-% \fontspec{Charis SIL} \emph{ABCxyz} \quad
-% \fontspec[FakeSlant=0.2]{Charis SIL} ABCxyz
-%
-% \fontspec{Charis SIL} ABCxyz \quad
-% \fontspec[FakeStretch=1.2]{Charis SIL} ABCxyz
-%
-% \fontspec{Charis SIL} \textbf{ABCxyz} \quad
-% \fontspec[FakeBold=1.5]{Charis SIL} ABCxyz
-% \end{Xexample}
-%
-% If values are omitted, their defaults are as shown above.
-%
-% If you want the bold shape to be faked automatically, or the italic shape
-% to be slanted automatically, use the \feat{AutoFakeBold} and
-% \feat{AutoFakeSlant} features. For example, the following two invocations
-% are equivalent:
-% \begin{verbatim}
-% \fontspec[AutoFakeBold=1.5]{Charis SIL}
-% \fontspec[BoldFeatures={FakeBold=1.5}]{Charis SIL}
-% \end{verbatim}
-%
-% If both of the \feat{AutoFake...} features are used, then the bold italic
-% font will also be faked.
-%
-%
-% \subsection{Different font technologies: \AAT\ and ICU}\label{sec:renderer}
+% \subsection{Different font technologies: \AAT\ and \ICU}\label{sec:renderer}
%
% \XeTeX\ supports two rendering technologies for typesetting, selected with
% the \feat{Renderer} font feature. The first, \opt{AAT}, is
@@ -1636,7 +1759,7 @@ This work consists of this file fontspec.dtx
% select the \opt{ICU} renderer.}
%
%
-% \subsection{Optical font sizes} \label{sec:opticalsize}
+% \subsection{Optical font sizes} \label{sec:aat-opticalsize}
%
% Multiple Master fonts are parameterised over
% orthogonal font axes, allowing continuous selection along such
@@ -1694,7 +1817,7 @@ This work consists of this file fontspec.dtx
% \XeTeX; you must use a 0\,pt kern or \cs{hbox} (\eg, \cs{null}) to
% split the characters up.
%
-% \subsection{Letters} \label{sec:letters}
+% \subsection{Letters} \label{sec:aat-letters}
% The \opt{Letters} feature specifies how the letters in the current font
% will look. For \AAT\ fonts, you may choose from \opt{Normal},
% \opt{Uppercase}, \opt{Lowercase}, \opt{SmallCaps}, and
@@ -1715,7 +1838,7 @@ This work consists of this file fontspec.dtx
% things like contextual swashes are implemented here
% The options for \AAT\ fonts are
% \opt{WordInitial}, \opt{WordFinal} (\exref{wordcx}), \opt{LineInitial},
-% \opt{LineFinal}, and \opt{Inner} (\exref{lonsaat}, also called `non-final' sometimes). As
+% \opt{LineFinal}, and \opt{Inner} (\exref{longsaat}, also called `non-final' sometimes). As
% non-exclusive selectors, like the ligatures, you can turn them off
% by prefixing their name with \opt{No}.
%
@@ -1831,7 +1954,6 @@ This work consists of this file fontspec.dtx
%
%
% \subsection{Style}
-% \label{sec:ot-feat-style}
%
% The options of the \feat{Style} feature
% are defined in \AAT\ as one of the following: \opt{Display},
@@ -1840,57 +1962,8 @@ This work consists of this file fontspec.dtx
% \footnotetext{`Ruby' refers to a small optical size, used in
% Japanese typography for annotations.}
%
-% \Exref{style-alt} and \exref{style-hist} both contain glyph
-% subtitutions with similar characteristics.
-% Note the occasional inconsistency with which font features are labelled; a long-tailed `Q' could turn up anywhere!
-%
-% \begin{Lexample}[firstline=2]{style-alt}{Example of the \opt{Alternate} option of the \feat{Style} feature.}
-% \Large
-% \fontspec{Warnock Pro}
-% K Q R k v w y \\
-% \addfontfeature{Style=Alternate}
-% K Q R k v w y
-% \end{Lexample}
-%
-% \begin{Lexample}[firstline=2]{style-hist}{Example of the \opt{Historic} option of the \feat{Style} feature.}
-% \Large
-% \fontspec{Adobe Jenson Pro}
-% M Q Z \\
-% \addfontfeature{Style=Historic}
-% M Q Z
-% \end{Lexample}
-%
-% In other features, larger breadths of changes can be seen, covering
-% the style of an entire alphabet. See \exref{style-titl} and \exref{style-itrub}; in the latter, the \opt{Italic} option affects the Latin text and the \opt{Ruby} option the Japanese.
-%
-% \begin{Lexample}[firstline=2]{style-titl}{Example of the \opt{TitlingCaps} option of the \feat{Style} feature.}
-% \Large
-% \fontspec{Adobe Garamond Pro}
-% TITLING CAPS \\
-% \addfontfeature{Style=TitlingCaps}
-% TITLING CAPS
-% \end{Lexample}
-%
-% \begin{Xexample}[firstline=2]{style-itrub}{Example of the \opt{Italic} and \opt{Ruby} options of the \feat{Style} feature.}
-% \Large \def\kana{ようこそ ワカヨタレソ}
-% \fontspec{Hiragino Mincho Pro}
-% Latin \kana \\
-% \addfontfeature{Style={Italic, Ruby}}
-% Latin \kana
-% \end{Xexample}
-%
-% Note the difference here between the default and the horizontal style kana
-% in \exref{style-hvkana}.
+% Typical examples for these features are shown in \ref{sec:ot-feat-style}.
%
-% \begin{Xexample}[firstline=2]{style-hvkana}{Example of the \opt{HorizontalKana} and \opt{VerticalKana} options of the \feat{Style} feature.}
-% \Large \def\kana{ようこそ ワカヨタレソ}
-% \fontspec{Hiragino Mincho Pro}
-% \kana \\
-% {\addfontfeature{Style=HorizontalKana}
-% \kana } \\
-% {\addfontfeature{Style=VerticalKana}
-% \kana }
-% \end{Xexample}
%
%
%
@@ -1912,18 +1985,8 @@ This work consists of this file fontspec.dtx
% the original font settings.
%
%
-% \subsection{Annotation}
-% Various Asian fonts are equipped with a more extensive range of
-% numbers and numerals in different forms.
-% For OpenType fonts, annotations with the \feat{Annotation} feature are selected numerically, as shown in \exref{ot-annot}.
-%
-% \begin{Xexample}{ot-annot}{Annotation forms.}
-% \fontspec{Hiragino Maru Gothic Pro}
-% 1 2 3 4 5 6 7 8 9
-% \def\x#1{\\{\addfontfeature{Annotation=#1}
-% 1 2 3 4 5 6 7 8 9 }}
-% \x0\x1\x2\x3\x4\x5\x6\x7\x7\x8\x9
-% \end{Xexample}
+
+
%
%
%
@@ -1971,11 +2034,11 @@ This work consists of this file fontspec.dtx
% \subsection{Annotation}
% Various Asian fonts are equipped with a more extensive range of
% numbers and numerals in different forms. These are accessed through
-% the \feat{Annotation} feature with the following options: \opt{Off},
+% the \feat{Annotation} feature (see \exref{aat-annot}) with the following
+% options: \opt{Off},
% \opt{Box}, \opt{RoundedBox}, \opt{Circle}, \opt{BlackCircle},
% \opt{Parenthesis}, \opt{Period}, \opt{RomanNumerals}, \opt{Diamond},
% \opt{BlackSquare}, \opt{BlackRoundSquare}, and \opt{DoubleCircle}.
-% See \exref{aat-annot}
%
% \begin{Xexample}{aat-annot}{Various annotation forms.}
% \fontspec{Hei Regular}
@@ -2046,7 +2109,7 @@ This work consists of this file fontspec.dtx
% Here's what it would look like in practise:
% \begin{Verbatim}
% \newopentypefeature{Style}{NoLocalForms}{-locl}
-% \begin{Verbatim}
+% \end{Verbatim}
%
% \DescribeMacro{\newfontfeature}
% In case the above commands do not accommodate the desired font feature
@@ -2115,7 +2178,7 @@ This work consists of this file fontspec.dtx
% \begin{Lexample}{aliasopt}{Renaming font feature options.}
% \aliasfontfeature{VerticalPosition}{Vert Pos}
% \aliasfontfeatureoption{VerticalPosition}{ScientificInferior}{Sci Inf}
-% \fontspec[Vert Pos=Sci Inf]{Warnock Pro}
+% \fontspec[Vert Pos=Sci Inf]{Linux Libertine}
% Scientific Inferior: 12345
% \end{Lexample}
%
@@ -2179,22 +2242,22 @@ This work consists of this file fontspec.dtx
% \end{macro}
%
% \begin{macro}{\fontspec_if_script:nTF}
-% Returns whether the currently selected font contains the raw OpenType
+% Test whether the currently selected font contains the raw OpenType
% script |#1|. E.g.: |\fontspec_if_script:nTF {latn} {True} {False}|.
% Returns false if the font is not loaded by fontspec or is not an OpenType
% font.
% \end{macro}
%
% \begin{macro}{\fontspec_if_language:nTF}
-% Test whether the currently selected font contains the raw OpenType
-% feature |#1|. E.g.: |\fontspec_if_feature:nTF {pnum} {True} {False}|.
+% Test whether the currently selected font contains the raw OpenType language
+% tag |#1|. E.g.: |\fontspec_if_language:nTF {ROM} {True} {False}|.
% Returns false if the font is not loaded by fontspec or is not an OpenType
% font.
% \end{macro}
%
% \begin{macro}{\fontspec_if_language:nnTF}
-% Test whether the currently selected font contains the raw OpenType
-% feature |#2| in script |#1|. E.g.: |\fontspec_if_feature:nTF {latn} {pnum} {True} {False}|.
+% Test whether the currently selected font contains the raw OpenType language
+% tag |#2| in script |#1|. E.g.: |\fontspec_if_language:nnTF {cyrl} {SRB} {True} {False}|.
% Returns false if the font is not loaded by fontspec or is not an OpenType
% font.
% \end{macro}
@@ -2220,7 +2283,8 @@ This work consists of this file fontspec.dtx
% function.
% \end{macro}
%
-% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
% \part{The patching/improvement of \LaTeXe\ and other packages}
% \label{sec:patching}
%
@@ -2239,20 +2303,19 @@ This work consists of this file fontspec.dtx
% By default \LaTeX\ defines symbolic footnote characters in terms of commands
% that don't resolve well; better results can be achieved by using specific Unicode characters or proper LICRs with the \pkg{xunicode} package.
%
-% This problem has been solved by loading the
-% \pkg{fixltx2e} and \pkg{xunicode} packages in \pkg{xltxtra}.
+% This problem has been solved by loading the \pkg{fixltx2e} package.
%
% \section{Verbatim}
% \label{sec:verb}
%
% Many verbatim mechanisms assume the existence of a `visible space' character that exists in the \textsc{ascii} space slot of the typewriter font. This character is known in Unicode as \unichar{2434}{box open}, which looks like this: `\verb*| |'.
%
-% When a Unicode typewriter font is used, \LaTeX\ no longer prints visible spaces for the |verbatim*| environment and |\verb*| command. \pkg{xltxtra} fixes this problem by using the correct Unicode glyph, and patches the following packages to do the same:
+% When a Unicode typewriter font is used, \LaTeX\ no longer prints visible spaces for the |verbatim*| environment and |\verb*| command. This problem is fixed by using the correct Unicode glyph, and the following packages are patched to do the same:
% \pkg{listings}, \pkg{fancyvrb}, \pkg{moreverb}, and \pkg{verbatim}.
%
-% In the case that the typewriter font does not contain `\verb*| |', the Latin Modern Mono font is used as a fallback.
+% In the case that the typewriter font does not contain `\verb*| |', the Latin Modern Mono font is used as a fallback.
%
-% \section{Discrectionary hyphenation: \cmd\-}
+% \section{Discretionary hyphenation: \cmd\-}
% \label{sec:hyphen}
%
% \LaTeX\ defines the macro \cmd\-\ to insert discretionary hyphenation points.
@@ -2363,6 +2426,20 @@ This work consists of this file fontspec.dtx
\cs_set:Npn \use_iv:nnnnn #1#2#3#4#5 {#4}
% \end{macrocode}
%
+%
+% \begin{macro}{\fontspec_glyph_if_exist:NnTF}
+% \begin{macrocode}
+\prg_new_conditional:Nnn \fontspec_glyph_if_exist:Nn {p,TF,T,F} {
+ \etex_iffontchar:D #1 #2 \scan_stop:
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
% \begin{macrocode}
\cs_new:Npn \fontspec_setkeys:xx #1#2
{
@@ -2405,7 +2482,7 @@ This work consists of this file fontspec.dtx
}
\msg_new:nnn {fontspec} {no-glyph}
{
- '\zf@fontname'~ doesn't~ appear~ to~ have~ the~ glyph~ corresponding~ to~ '#1'.
+ '\zf@fontname'~ does~ not~ contain~ glyph~ #1.
}
\msg_new:nnnn {fontspec} {unknown-options}
{
@@ -2948,7 +3025,7 @@ This work consists of this file fontspec.dtx
% from a \verb|\newfontfamily| macro or from \verb|\setmainfont| and so on.)
%
% \begin{macro}{\fontspec_if_fontspec_font:TF}
-% Returns whether the currently selected font has been loaded by fontspec.
+% Test whether the currently selected font has been loaded by fontspec.
% \begin{macrocode}
\prg_new_conditional:Nnn \fontspec_if_fontspec_font: {TF,T,F} {
\ifcsname zf@family@fontdef\f@family\endcsname
@@ -2987,7 +3064,7 @@ This work consists of this file fontspec.dtx
%
%
% \begin{macro}{\fontspec_if_opentype:TF}
-% Returns whether the currently selected font is an OpenType font.
+% Test whether the currently selected font is an OpenType font.
% Always true for LuaTeX fonts.
% \begin{macrocode}
\prg_new_conditional:Nnn \fontspec_if_opentype: {TF,T,F} {
@@ -3007,7 +3084,7 @@ This work consists of this file fontspec.dtx
% \end{macro}
%
% \begin{macro}{\fontspec_if_feature:nTF}
-% Returns whether the currently selected font contains the raw OpenType
+% Test whether the currently selected font contains the raw OpenType
% feature |#1|. E.g.: |\fontspec_if_feature:nTF {pnum} {True} {False}|
% Returns false if the font is not loaded by fontspec or is not an OpenType
% font.
@@ -3035,7 +3112,7 @@ This work consists of this file fontspec.dtx
% \end{macro}
%
% \begin{macro}{\fontspec_if_feature:nnnTF}
-% Returns whether the currently selected font with raw OpenType script tag |#1| and raw OpenType language tag |#2| contains the raw OpenType feature tag |#3|. E.g.: |\fontspec_if_feature:nTF {latn} {ROM} {pnum} {True} {False}|
+% Test whether the currently selected font with raw OpenType script tag |#1| and raw OpenType language tag |#2| contains the raw OpenType feature tag |#3|. E.g.: |\fontspec_if_feature:nTF {latn} {ROM} {pnum} {True} {False}|
% Returns false if the font is not loaded by fontspec or is not an OpenType
% font.
% \begin{macrocode}
@@ -3058,7 +3135,7 @@ This work consists of this file fontspec.dtx
% \end{macro}
%
% \begin{macro}{\fontspec_if_script:nTF}
-% Returns whether the currently selected font contains the raw OpenType
+% Test whether the currently selected font contains the raw OpenType
% script |#1|. E.g.: |\fontspec_if_script:nTF {latn} {True} {False}|
% Returns false if the font is not loaded by fontspec or is not an OpenType
% font.
@@ -3080,8 +3157,8 @@ This work consists of this file fontspec.dtx
% \end{macro}
%
% \begin{macro}{\fontspec_if_language:nTF}
-% Returns whether the currently selected font contains the raw OpenType
-% feature |#1|. E.g.: |\fontspec_if_feature:nTF {+pnum} {True} {False}|
+% Test whether the currently selected font contains the raw OpenType language
+% tag |#1|. E.g.: |\fontspec_if_language:nTF {ROM} {True} {False}|.
% Returns false if the font is not loaded by fontspec or is not an OpenType
% font.
% \begin{macrocode}
@@ -3105,8 +3182,8 @@ This work consists of this file fontspec.dtx
% \end{macro}
%
% \begin{macro}{\fontspec_if_language:nnTF}
-% Returns whether the currently selected font contains the raw OpenType
-% feature |#2| in script |#1|. E.g.: |\fontspec_if_feature:nTF {+pnum} {True} {False}|
+% Test whether the currently selected font contains the raw OpenType language
+% tag |#2| in script |#1|. E.g.: |\fontspec_if_language:nnTF {cyrl} {SRB} {True} {False}|.
% Returns false if the font is not loaded by fontspec or is not an OpenType
% font.
% \begin{macrocode}
@@ -3130,7 +3207,7 @@ This work consists of this file fontspec.dtx
%
%
% \begin{macro}{\fontspec_if_current_script:nTF}
-% Returns whether the currently loaded font is using the specified raw
+% Test whether the currently loaded font is using the specified raw
% OpenType script tag |#1|.
% \begin{macrocode}
\prg_new_conditional:Nnn \fontspec_if_current_script:n {TF,T,F} {
@@ -3151,7 +3228,7 @@ This work consists of this file fontspec.dtx
% \end{macro}
%
% \begin{macro}{\fontspec_if_current_language:nTF}
-% Returns whether the currently loaded font is using the specified raw
+% Test whether the currently loaded font is using the specified raw
% OpenType language tag |#1|.
% \begin{macrocode}
\prg_new_conditional:Nnn \fontspec_if_current_language:n {TF,T,F} {
@@ -3387,10 +3464,8 @@ This work consists of this file fontspec.dtx
\fontspec_check_script:nTF {latn}
{
\tl_set:Nn \l_fontspec_script_name_tl {Latin}
- \tl_set:Nn \l_fontspec_script_tl {latn}
- \tl_if_empty:NT \l_fontspec_lang_tl {
+ \tl_if_empty:NT \l_fontspec_lang_name_tl {
\tl_set:Nn \l_fontspec_lang_name_tl {Default}
- \tl_set:Nn \l_fontspec_lang_tl {DFLT}
}
\fontspec_setkeys:xxx {feat} {Script} {\l_fontspec_script_name_tl}
\fontspec_setkeys:xxx {feat} {Lang} {\l_fontspec_lang_name_tl}
@@ -3400,9 +3475,8 @@ This work consists of this file fontspec.dtx
}
}
{
- \tl_if_empty:NT \l_fontspec_lang_tl {
+ \tl_if_empty:NT \l_fontspec_lang_name_tl {
\tl_set:Nn \l_fontspec_lang_name_tl {Default}
- \tl_set:Nn \l_fontspec_lang_tl {DFLT}
}
\fontspec_setkeys:xxx {feat} {Script} {\l_fontspec_script_name_tl}
\fontspec_setkeys:xxx {feat} {Lang} {\l_fontspec_lang_name_tl}
@@ -3557,7 +3631,7 @@ This work consists of this file fontspec.dtx
% \subsubsection{Fonts}
%
% \begin{macro}{\fontspec_set_font_type:}
-% Now check if the font is to be rendered with ATSUI or ICU. This will either
+% Now check if the font is to be rendered with \ATSUI\ or \ICU. This will either
% be automatic (based on the font type), or specified by the user via a font feature.
%
% This macro sets \cs{zf@atsui} or \cs{zf@icu} or \cs{zf@mm} booleans
@@ -4567,53 +4641,26 @@ This work consists of this file fontspec.dtx
% \begin{macrocode}
\define@key[zf]{options}{HyphenChar}{
\zf@update@family{+hyphenchar:#1}
- \edef\@tempa{#1}
- \edef\@tempb{None}
- \ifx\@tempa\@tempb
- \xetex_or_luatex:nnn { \g@addto@macro\zf@adjust }
- { \hyphenchar\font-1\relax }
- { \luatexprehyphenchar=-1\relax }
- \else
- \zf@check@one@char#1\zf@@
- \ifx\@tempb\@empty
- \xetex_or_luatex:nn {
- {\zf@basefont\expandafter\ifnum\expandafter\XeTeXcharglyph
- \expandafter`#1 > \z@
- \g@addto@macro\zf@adjust{%
- {\expandafter\hyphenchar\expandafter
- \font\expandafter`#1}}%
- \else
- \fontspec_error:nx {no-glyph}{#1}
- \fi}%
- }{
- \ifnum\directlua{
- fontspec.sprint(fontspec.charglyph('#1', 'zf@basefont'))
- } > \z@
- \g@addto@macro\zf@adjust{\luatexprehyphenchar=`#1\relax}
- \else
- \fontspec_error:nx {no-glyph}{#1}
- \fi
- }
- \else
- \xetex_or_luatex:nn {
- {\zf@basefont\ifnum\XeTeXcharglyph#1 > \z@
- \g@addto@macro\zf@adjust{\hyphenchar\font#1\relax}%
- \else
- \fontspec_error:nx {no-glyph}{#1}
- \fi}%
- }{
- \ifnum\directlua{
- fontspec.sprint(fontspec.charglyph('#1', 'zf@basefont'))
- } > \z@
- \g@addto@macro\zf@adjust{\luatexprehyphenchar=#1\relax}
- \else
- \fontspec_error:nx {no-glyph}{#1}
- \fi
- }
- \fi
- \fi
+ \tl_if_eq:nnTF {#1} {None}
+ {
+ \tl_put_right:Nn \zf@adjust { \hyphenchar \font = \c_minus_one }
+ }
+ {
+ \tl_if_single:nTF {#1}
+ { \tl_set:Nn \l_fontspec_hyphenchar_tl {`#1} }
+ { \tl_set:Nn \l_fontspec_hyphenchar_tl { #1} }
+ \fontspec_glyph_if_exist:NnTF \zf@basefont {\l_fontspec_hyphenchar_tl}
+ {
+ \xetex_or_luatex:nnn { \tl_put_right:Nn \zf@adjust }
+ { \hyphenchar \font = \l_fontspec_hyphenchar_tl \scan_stop: }
+ {
+ \hyphenchar \font = \c_zero
+ \luatexprehyphenchar = \l_fontspec_hyphenchar_tl \scan_stop:
+ }
+ }
+ { \fontspec_error:nx {no-glyph}{#1} }
+ }
}
-\def\zf@check@one@char#1#2\zf@@{\def\@tempb{#2}}
% \end{macrocode}
%
% \paragraph{Color}
@@ -4849,7 +4896,6 @@ This work consists of this file fontspec.dtx
% \begin{macrocode}
\luatex_if_engine:T {
\zf@define@feature@option{Numbers}{Arabic}{}{}{+anum}
- \zf@define@feature@option{Numbers}{Farsi} {}{}{+anum}
}
% \end{macrocode}
%
@@ -5127,7 +5173,10 @@ This work consists of this file fontspec.dtx
\newfontlanguage{Spanish}{ESP}\newfontlanguage{Estonian}{ETI}
\newfontlanguage{Basque}{EUQ}\newfontlanguage{Evenki}{EVK}
\newfontlanguage{Even}{EVN}\newfontlanguage{Ewe}{EWE}
-\newfontlanguage{French~Antillean}{FAN}\newfontlanguage{Farsi}{FAR}
+\newfontlanguage{French~Antillean}{FAN}
+\newfontlanguage{Farsi}{FAR}
+\newfontlanguage{Parsi}{FAR}
+\newfontlanguage{Persian}{FAR}
\newfontlanguage{Finnish}{FIN}\newfontlanguage{Fijian}{FJI}
\newfontlanguage{Flemish}{FLE}\newfontlanguage{Forest~Nenets}{FNE}
\newfontlanguage{Fon}{FON}\newfontlanguage{Faroese}{FOS}
@@ -5704,22 +5753,6 @@ local function check_feature(id, feature, language, script)
end
% \end{macrocode}
-% This function takes a font csname (without the leading slash) and returns its
-% internal font id. Since \LuaTeX~0.47, there is a built in \texttt{font.id()}
-% function.
-% \begin{macrocode}
-
-local function font_id(str)
- local id
- if tex.luatexversion >= 47 then
- id = font.id(str)
- else
- id = token.create(str)[2]
- end
- return id
-end
-
-% \end{macrocode}
% The following are the function that get called from \TeX\ end.
% \begin{macrocode}
@@ -5727,7 +5760,7 @@ local function tempswatrue() fontspec.sprint([[\@tempswatrue]]) end
local function tempswafalse() fontspec.sprint([[\@tempswafalse]]) end
function fontspec.check_ot_script(fnt, script)
- if check_script(font_id(fnt), script) then
+ if check_script(font.id(fnt), script) then
tempswatrue()
else
tempswafalse()
@@ -5735,7 +5768,7 @@ function fontspec.check_ot_script(fnt, script)
end
function fontspec.check_ot_lang(fnt, lang, script)
- if check_language(font_id(fnt), lang, script) then
+ if check_language(font.id(fnt), lang, script) then
tempswatrue()
else
tempswafalse()
@@ -5749,34 +5782,13 @@ function fontspec.check_ot_feat(fnt, feat, lang, script)
return
end
end
- if check_feature(font_id(fnt), feat, lang, script) then
+ if check_feature(font.id(fnt), feat, lang, script) then
tempswatrue()
else
tempswafalse()
end
end
-function fontspec.charglyph(char)
- if char then
- local id, c
- if utf.len(char) > 1 then
- c = utf.byte(utf.char(char:gsub('"', '0x')))
- else
- c = utf.byte(char)
- end
-
- id = font.current()
-
- if font.fonts[id]["characters"][c] then
- return font.fonts[id]["characters"][c].index
- else
- return 0
- end
- else
- return 0
- end
-end
-
% \end{macrocode}
%
% \iffalse
@@ -6117,8 +6129,13 @@ If you want to run just a single test, use
% \begin{macrocode}
\ProvidesPackage{fontspec-style}
-\usepackage{booktabs,calc,color,enumitem,fancyvrb,hologo,graphicx,ifthen,url,varioref,varwidth}
+\usepackage{booktabs,calc,caption,color,enumitem,fancyvrb,hologo,graphicx,ifthen,url,varioref,varwidth}
+
\fvset{gobble=2}
+
+\captionsetup[table]{position=above}
+\captionsetup[figure]{position=above}
+
\newcommand\XeTeX{\hologo{XeTeX}}
\newcommand\XeLaTeX{\hologo{XeLaTeX}}
\newcommand\LuaTeX{\hologo{LuaTeX}}
@@ -6242,7 +6259,7 @@ If you want to run just a single test, use
\else
\parbox{\linewidth}{\centering\@tempa~\captiontext}%
\fi
- \par\rule[0.4\baselineskip]{\columnwidth}{1pt}\par
+ \par\rule[0.4\baselineskip]{\columnwidth}{0.4pt}\par
\ifdim\dimexpr\wd\X+\wd\Y>\linewidth\relax
\null\hfill\makebox[0pt][r]{\usebox\Y}\usebox\X
\else
@@ -6281,6 +6298,8 @@ If you want to run just a single test, use
\def\MacOSX{Mac~OS~X}
\def\AAT{\textsc{aat}}
+\def\ATSUI{\textsc{atsui}}
+\def\ICU{\textsc{icu}}
\def\LuaTeX{L\kern-0.08emu\kern-0.03ema\kern-0.12em\TeX}
%% (La)TeX font-related declarations:
@@ -6325,6 +6344,8 @@ If you want to run just a single test, use
\def\thisfeatname{#1}%
\def\featname{\thisfeatname~~\texttt=~~\null\gdef\featname{}}%
\begin{table}
+ \caption{Options for the OpenType font feature `\thisfeatname'.}
+ \edef\@tempa{\noexpand\label{feat:\thisfeatname}}\@tempa
\centering
\begin{tabular}{@{}l@{}l@{\hspace{0.5\tabcolsep}}l@{\hspace{0.5\tabcolsep}}l@{}}
\toprule
@@ -6334,8 +6355,6 @@ If you want to run just a single test, use
\bottomrule
\end{tabular}
\NOTE
- \caption{Options for the OpenType font feature `\thisfeatname'.}
- \edef\@tempa{\noexpand\label{feat:\thisfeatname}}\@tempa
\end{table}
}