summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/fontspec
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-09-13 22:53:04 +0000
committerKarl Berry <karl@freefriends.org>2011-09-13 22:53:04 +0000
commite646dedf9c5e492e2598cdfd13cda820ad2f62a7 (patch)
tree081a6eab5571d8fbe3292abda0a0064d9c616422 /Master/texmf-dist/tex/latex/fontspec
parent2ff31e7482486eeb8c9d13664a15c30fc293da95 (diff)
fontspec 2.2 (13sep11)
git-svn-id: svn://tug.org/texlive/trunk@23936 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/fontspec')
-rw-r--r--Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty1972
-rw-r--r--Master/texmf-dist/tex/latex/fontspec/fontspec-patches.sty20
-rw-r--r--Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty2044
-rw-r--r--Master/texmf-dist/tex/latex/fontspec/fontspec.lua32
-rw-r--r--Master/texmf-dist/tex/latex/fontspec/fontspec.sty2045
5 files changed, 4085 insertions, 2028 deletions
diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty b/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty
new file mode 100644
index 00000000000..02a6ab12561
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty
@@ -0,0 +1,1972 @@
+%%
+%% This is file `fontspec-luatex.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% fontspec.dtx (with options: `fontspec,luatex')
+%%
+%% _________________________________________
+%% The fontspec package for XeLaTeX/LuaLaTeX
+%% (C) 2004--2011 Will Robertson and Khaled Hosny
+%%
+%% License information appended.
+%%
+%%
+\ProvidesPackage{fontspec-luatex}
+ [2011/09/13 v2.2 Advanced font selection for XeLaTeX/LuaLaTeX]
+
+
+\ExplSyntaxOn
+\tl_set:Nn \g_fontspec_encoding_tl {EU2}
+\tl_set:Nn \rmdefault {lmr}
+\tl_set:Nn \sfdefault {lmss}
+\tl_set:Nn \ttdefault {lmtt}
+\RequirePackage[\g_fontspec_encoding_tl]{fontenc}
+\tl_set_eq:NN \UTFencname \g_fontspec_encoding_tl % for xunicode
+\tl_set_eq:NN \cyrillicencoding \g_fontspec_encoding_tl
+\tl_set_eq:NN \latinencoding \g_fontspec_encoding_tl
+\tl_put_right:Nn \document {
+ \tl_set_eq:NN \cyrillicencoding \g_fontspec_encoding_tl
+ \tl_set_eq:NN \latinencoding \g_fontspec_encoding_tl
+}
+\cs_set_eq:NN \fontspec_tmp: \XeTeXpicfile
+\cs_set:Npn \XeTeXpicfile {}
+\RequirePackage{xunicode}
+\cs_set_eq:NN \XeTeXpicfile \fontspec_tmp:
+\DeclareDocumentCommand \fontspec { O{} m } {
+ \fontencoding {\g_fontspec_encoding_tl}
+ \fontspec_set_family:Nnn \f@family {#1}{#2}
+ \selectfont
+ \ignorespaces
+}
+\DeclareDocumentCommand \setmainfont { O{} m } {
+ \fontspec_set_family:Nnn \rmdefault {#1}{#2}
+ \normalfont
+}
+\DeclareDocumentCommand \setsansfont { O{} m } {
+ \fontspec_set_family:Nnn \sfdefault {#1}{#2}
+ \normalfont
+}
+\DeclareDocumentCommand \setmonofont { O{} m } {
+ \fontspec_set_family:Nnn \ttdefault {#1}{#2}
+ \normalfont
+}
+\cs_set_eq:NN \setromanfont \setmainfont
+\DeclareDocumentCommand \setmathrm { O{} m } {
+ \fontspec_set_family:Nnn \g_fontspec_mathrm_tl {#1}{#2}
+}
+\DeclareDocumentCommand \setboldmathrm { O{} m } {
+ \fontspec_set_family:Nnn \g_fontspec_bfmathrm_tl {#1}{#2}
+}
+\DeclareDocumentCommand \setmathsf { O{} m } {
+ \fontspec_set_family:Nnn \g_fontspec_mathsf_tl {#1}{#2}
+}
+\DeclareDocumentCommand \setmathtt { O{} m } {
+ \fontspec_set_family:Nnn \g_fontspec_mathtt_tl {#1}{#2}
+}
+\@onlypreamble\setmathrm
+\@onlypreamble\setboldmathrm
+\@onlypreamble\setmathsf
+\@onlypreamble\setmathtt
+\def\g_fontspec_mathrm_tl{\rmdefault}
+\def\g_fontspec_mathsf_tl{\sfdefault}
+\def\g_fontspec_mathtt_tl{\ttdefault}
+\tl_clear:N \g_fontspec_bfmathrm_tl
+\DeclareDocumentCommand \newfontfamily { m O{} m } {
+ \fontspec_select:nn{#2}{#3}
+ \use:x {
+ \exp_not:N \DeclareRobustCommand \exp_not:N #1 {
+ \exp_not:N \fontencoding {\g_fontspec_encoding_tl}
+ \exp_not:N \fontfamily {\l_fontspec_family_tl} \exp_not:N \selectfont
+ }
+ }
+}
+\DeclareDocumentCommand \newfontface { m O{} m } {
+ \newfontfamily #1 [ BoldFont={},ItalicFont={},SmallCapsFont={},#2 ] {#3}
+}
+\DeclareDocumentCommand \defaultfontfeatures {m} {
+ \tl_set:Nn \g_fontspec_default_fontopts_tl {#1,}
+}
+\tl_clear:N \g_fontspec_default_fontopts_tl
+\DeclareDocumentCommand \addfontfeatures {m} {
+ \ifcsname zf@family@fontdef\f@family\endcsname
+ \group_begin:
+ \tl_clear:N \g_fontspec_default_fontopts_tl
+ \use:x {
+ \exp_not:N\fontspec_select:nn
+ {\csname zf@family@options\f@family\endcsname,#1}
+ {\csname zf@family@fontname\f@family\endcsname}
+ }
+ \group_end:
+ \fontfamily\l_fontspec_family_tl\selectfont
+ \else
+ \fontspec_warning:n {addfontfeatures-ignored}
+ \fi
+ \ignorespaces
+}
+\cs_set_eq:NN \addfontfeature \addfontfeatures
+\DeclareDocumentCommand \newfontfeature {mm}
+ {
+ \keys_define:nn { fontspec }
+ {
+ #1 .code:n = {
+ \fontspec_update_fontid:n {+zf-#1}
+ \fontspec_update_featstr:n {#2}
+ }
+ }
+ }
+\DeclareDocumentCommand \newAATfeature {mmmm} {
+ \keys_if_exist:nnF { fontspec } {#1}
+ { \fontspec_define_font_feature:n {#1} }
+ \keys_if_choice_exist:nnnT {fontspec} {#1} {#2}
+ { \fontspec_warning:nxx {feature-option-overwrite}{#1}{#2} }
+ \fontspec_define_feature_option:nnnnn{#1}{#2}{#3}{#4}{}
+}
+\DeclareDocumentCommand \newICUfeature {mmm} {
+ \keys_if_exist:nnF { fontspec / options } {#1}
+ { \fontspec_define_font_feature:n{#1} }
+ \keys_if_choice_exist:nnnT {fontspec} {#1} {#2}
+ { \fontspec_warning:nxx {feature-option-overwrite}{#1}{#2} }
+ \fontspec_define_feature_option:nnnnn{#1}{#2}{}{}{#3}
+}
+\cs_set_eq:NN \newopentypefeature \newICUfeature
+\DeclareDocumentCommand \aliasfontfeature {mm}
+ {
+ \keys_if_exist:nnTF {fontspec} {#1}
+ {
+ \keys_define:nn {fontspec}
+ { #2 .code:n = { \keys_set:nn {fontspec} { #1 = {##1} } } }
+ }
+ {
+ \keys_if_exist:nnTF {fontspec-preparse} {#1}
+ {
+ \keys_define:nn {fontspec-preparse}
+ { #2 .code:n = { \keys_set:nn {fontspec-preparse} { #1 = {##1} } } }
+ }
+ {
+ \keys_if_exist:nnTF {fontspec-preparse-external} {#1}
+ {
+ \keys_define:nn {fontspec-preparse-external}
+ {
+ #2 .code:n =
+ { \keys_set:nn {fontspec-preparse-external} { #1 = {##1} } }
+ }
+ }
+ { \fontspec_warning:nx {rename-feature-not-exist} {#1} }
+ }
+ }
+ }
+\DeclareDocumentCommand \aliasfontfeatureoption {mmm}
+ {
+ \cs_set_eq:cc { \c_keys_code_root_tl fontspec/#1/#3 }
+ { \c_keys_code_root_tl fontspec/#1/#2 }
+ }
+\DeclareDocumentCommand \newfontscript {mm}
+{
+ \fontspec_new_script:nn {#1} {#2}
+ \fontspec_new_script:nn {#2} {#2}
+}
+\keys_define:nn { fontspec } { Script .choice: }
+\cs_new:Nn \fontspec_new_script:nn
+{
+ \keys_define:nn { fontspec } { Script / #1 .code:n =
+ \fontspec_check_script:nTF {#2} {
+ \fontspec_update_fontid:n {+script=#1}
+ \tl_set:Nn \l_fontspec_script_tl {#2}
+ \int_set:Nn \l_fontspec_script_int {\l_fontspec_strnum_int}
+ }{
+ \fontspec_check_script:nTF {latn} {
+ \fontspec_warning:nx {script-not-exist-latn} {#1}
+ \keys_set:nn {fontspec} {Script=Latin}
+ }{
+ \fontspec_warning:nx {script-not-exist} {#1}
+ }
+ }
+ }
+}
+\DeclareDocumentCommand \newfontlanguage {mm}
+{
+ \fontspec_new_lang:nn {#1} {#2}
+ \fontspec_new_lang:nn {#2} {#2}
+}
+\keys_define:nn { fontspec } { Language .choice: }
+\cs_new:Nn \fontspec_new_lang:nn
+{
+ \keys_define:nn { fontspec } { Language / #1 .code:n =
+ \fontspec_check_lang:nTF {#2} {
+ \fontspec_update_fontid:n {+lang=#1}
+ \tl_set:Nn \l_fontspec_lang_tl {#2}
+ \int_set:Nn \l_fontspec_language_int {\l_fontspec_strnum_int}
+ }{
+ \fontspec_warning:nx {language-not-exist} {#1}
+ \keys_set:nn { fontspec } { Language = Default }
+ }
+ }
+}
+\DeclareDocumentCommand \DeclareFontsExtensions {m}
+{
+ \tl_set:Nn \l_fontspec_extensions_clist { #1 }
+ \tl_remove_all:Nn \l_fontspec_extensions_clist {~}
+}
+\DeclareFontsExtensions{.otf,.ttf,.OTF,.TTF,.ttc,.TTC,.dfont}
+\prg_new_conditional:Nnn \fontspec_if_fontspec_font: {TF,T,F} {
+ \cs_if_exist:cTF {g_fontspec_ \f@family _prop} {
+ \prg_return_true:
+ }{
+ \prg_return_false:
+ }
+}
+\prg_new_conditional:Nnn \fontspec_if_aat_feature:nn {TF,T,F} {
+ \fontspec_if_fontspec_font:TF {
+ \fontspec_font_set:Nnn \l_fontspec_font {\use:c{zf@family@fontdef\f@family}} {\f@size pt}
+ \bool_if:NTF \l_fontspec_atsui_bool {
+ \fontspec_make_AAT_feature_string:nnTF {#1}{#2}
+ \prg_return_true: \prg_return_false:
+ }{
+ \prg_return_false:
+ }
+ }{
+ \prg_return_false:
+ }
+}
+\prg_new_conditional:Nnn \fontspec_if_opentype: {TF,T,F} {
+ \fontspec_if_fontspec_font:TF {
+ \fontspec_font_set:Nnn \l_fontspec_font {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt}
+ \fontspec_set_font_type:
+ \bool_if:NTF \l_fontspec_icu_bool \prg_return_true: \prg_return_false:
+ }{
+ \prg_return_false:
+ }
+}
+\prg_new_conditional:Nnn \fontspec_if_feature:n {TF,T,F} {
+ \fontspec_if_fontspec_font:TF {
+ \fontspec_font_set:Nnn \l_fontspec_font {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt}
+ \fontspec_set_font_type:
+ \bool_if:NTF \l_fontspec_icu_bool {
+ \int_set:Nv \l_fontspec_script_int {g_fontspec_script_num_(\f@family)_tl}
+ \int_set:Nv \l_fontspec_language_int {g_fontspec_lang_num_(\f@family)_tl}
+ \tl_set:Nv \l_fontspec_script_tl {g_fontspec_script_(\f@family)_tl}
+ \tl_set:Nv \l_fontspec_lang_tl {g_fontspec_lang_(\f@family)_tl}
+ \fontspec_check_ot_feat:nTF {#1} {\prg_return_true:} {\prg_return_false:}
+ }{
+ \prg_return_false:
+ }
+ }{
+ \prg_return_false:
+ }
+}
+\prg_new_conditional:Nnn \fontspec_if_feature:nnn {TF,T,F} {
+ \fontspec_if_fontspec_font:TF {
+ \fontspec_font_set:Nnn \l_fontspec_font {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt}
+ \fontspec_set_font_type:
+ \bool_if:NTF \l_fontspec_icu_bool {
+ \fontspec_iv_str_to_num:Nn \l_fontspec_script_int {#1}
+ \fontspec_iv_str_to_num:Nn \l_fontspec_language_int {#2}
+ \fontspec_check_ot_feat:nTF {#3} \prg_return_true: \prg_return_false:
+ }{
+ \prg_return_false:
+ }
+ }{
+ \prg_return_false:
+ }
+}
+\prg_new_conditional:Nnn \fontspec_if_script:n {TF,T,F} {
+ \fontspec_if_fontspec_font:TF {
+ \fontspec_font_set:Nnn \l_fontspec_font {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt}
+ \fontspec_set_font_type:
+ \bool_if:NTF \l_fontspec_icu_bool {
+ \fontspec_check_script:nTF {#1} \prg_return_true: \prg_return_false:
+ }{
+ \prg_return_false:
+ }
+ }{
+ \prg_return_false:
+ }
+}
+\prg_new_conditional:Nnn \fontspec_if_language:n {TF,T,F} {
+ \fontspec_if_fontspec_font:TF {
+ \fontspec_font_set:Nnn \l_fontspec_font {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt}
+ \fontspec_set_font_type:
+ \bool_if:NTF \l_fontspec_icu_bool {
+ \tl_set:Nv \l_fontspec_script_tl {g_fontspec_script_(\f@family)_tl}
+ \int_set:Nv \l_fontspec_script_int {g_fontspec_script_num_(\f@family)_tl}
+ \fontspec_check_lang:nTF {#1} \prg_return_true: \prg_return_false:
+ }{
+ \prg_return_false:
+ }
+ }{
+ \prg_return_false:
+ }
+}
+\prg_new_conditional:Nnn \fontspec_if_language:nn {TF,T,F} {
+ \fontspec_if_fontspec_font:TF {
+ \fontspec_font_set:Nnn \l_fontspec_font {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt}
+ \fontspec_set_font_type:
+ \bool_if:NTF \l_fontspec_icu_bool {
+ \tl_set:Nn \l_fontspec_script_tl {#1}
+ \fontspec_iv_str_to_num:Nn \l_fontspec_script_int {#1}
+ \fontspec_check_lang:nTF {#2} \prg_return_true: \prg_return_false:
+ }{
+ \prg_return_false:
+ }
+ }{
+ \prg_return_false:
+ }
+}
+\prg_new_conditional:Nnn \fontspec_if_current_script:n {TF,T,F} {
+ \fontspec_if_fontspec_font:TF {
+ \fontspec_font_set:Nnn \l_fontspec_font {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt}
+ \fontspec_set_font_type:
+ \bool_if:NTF \l_fontspec_icu_bool {
+ \str_if_eq:nvTF {#1} {g_fontspec_script_(\f@family)_tl}
+ {\prg_return_true:} {\prg_return_false:}
+ }{
+ \prg_return_false:
+ }
+ }{
+ \prg_return_false:
+ }
+}
+\prg_new_conditional:Nnn \fontspec_if_current_language:n {TF,T,F} {
+ \fontspec_if_fontspec_font:TF {
+ \fontspec_font_set:Nnn \l_fontspec_font {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt}
+ \fontspec_set_font_type:
+ \bool_if:NTF \l_fontspec_icu_bool {
+ \str_if_eq:nvTF {#1} {g_fontspec_lang_(\f@family)_tl}
+ {\prg_return_true:} {\prg_return_false:}
+ }{
+ \prg_return_false:
+ }
+ }{
+ \prg_return_false:
+ }
+}
+\cs_new:Nn \fontspec_set_family:Nnn {
+ \fontspec_select:nn {#2}{#3}
+ \tl_set_eq:NN #1 \l_fontspec_family_tl
+}
+\cs_new:Nn \fontspec_set_fontface:NNnn
+ {
+ \fontspec_select:nn {#3}{#4}
+ \tl_set_eq:NN #1 \l_fontspec_font
+ \tl_set_eq:NN #2 \l_fontspec_family_tl
+ }
+\cs_set:Nn \fontspec_fontwrap:n { "#1" }
+\cs_if_free:NT \font_set_eq:NN {
+ \cs_set_eq:NN \font_set_eq:NN \tex_let:D
+ \cs_set:Npn \font_set:Nnn #1#2#3 {
+ \font #1 = #2 ~at~ #3\scan_stop:
+ }
+ \cs_set:Npn \font_gset:Nnn #1#2#3 {
+ \global \font #1 = #2 ~at~ #3 \scan_stop:
+ }
+ \cs_set:Npn \font_suppress_not_found_error:
+ {\luatexsuppressfontnotfounderror=1}
+ \prg_set_conditional:Nnn \font_if_null:N {p,TF,T,F} {
+ \ifx #1 \nullfont
+ \prg_return_true:
+ \else
+ \prg_return_false:
+ \fi
+ }
+}
+\cs_new:Nn \fontspec_font_set:Nnn {
+ \font_set:Nnn #1 {\fontspec_fontwrap:n {#2}} {#3}
+}
+\cs_new:Nn \fontspec_font_gset:Nnn {
+ \font_gset:Nnn #1 {\fontspec_fontwrap:n {#2}} {#3}
+}
+\prg_new_conditional:Nnn \font_glyph_if_exist:Nn {p,TF,T,F} {
+ \etex_iffontchar:D #1 #2 \scan_stop:
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+}
+\cs_set:Nn \fontspec_select:nn {
+ \group_begin:
+ \font_suppress_not_found_error:
+ \fontspec_init:
+ \tl_set:Nx \l_fontspec_fontname_tl {#2}
+ \tl_remove_all:Nn \l_fontspec_fontname_tl {~}
+ \tl_set_eq:NN \l_fontspec_fontid_tl \l_fontspec_fontname_tl
+ \tl_set_eq:NN \l_fontspec_fontname_up_tl \l_fontspec_fontname_tl
+ \exp_args:NnV \fontspec_preparse_features:nn {#1} \l_fontspec_fontname_tl
+ \fontspec_font_set:Nnn \l_fontspec_font {\fontspec_fullname:n {\l_fontspec_fontname_up_tl}} {\f@size pt}
+ \font_if_null:NT \l_fontspec_font { \fontspec_error:nx {font-not-found} {\l_fontspec_fontname_up_tl} }
+ \fontspec_set_font_type:
+ \fontspec_font_gset:Nnn \l_fontspec_font {\fontspec_fullname:n {\l_fontspec_fontname_up_tl}} {\f@size pt}
+ \l_fontspec_font % this is necessary for LuaLaTeX to check the scripts properly
+ \fontspec_set_scriptlang:
+ \fontspec_get_features:n {}
+ \bool_set_false:N \l_fontspec_firsttime_bool
+ \fontspec_save_family:nT {#2} {
+ \fontspec_save_fontinfo:nn {#1} {#2}
+ \DeclareFontFamily{\g_fontspec_encoding_tl}{\l_fontspec_family_tl}{}
+ \fontspec_set_upright:
+ \fontspec_set_bold:
+ \fontspec_set_italic:
+ \fontspec_set_slanted:
+ \fontspec_set_bold_italic:
+ \fontspec_set_bold_slanted:
+ }
+ \fontspec_info:nxx {defining-font} {#1} {#2}
+ \group_end:
+}
+\cs_new:Nn \fontspec_preparse_features:nn {
+ \fontspec_if_detect_external:nT {#2}
+ { \keys_set:nn {fontspec-preparse-external} {ExternalLocation} }
+ \keys_set_known:nxN {fontspec-preparse-external}
+ {\g_fontspec_default_fontopts_tl #1} \l_fontspec_keys_leftover_clist
+ \tl_set_eq:NN \l_fontspec_fontname_tl \l_fontspec_fontname_up_tl
+ \keys_set_known:nxN {fontspec-preparse} {\l_fontspec_keys_leftover_clist}
+ \l_fontspec_fontfeat_clist
+}
+\prg_new_conditional:Nnn \fontspec_if_detect_external:n {T}
+ {
+ \clist_map_inline:Nn \l_fontspec_extensions_clist
+ {
+ \bool_set_false:N \l_tmpa_bool
+ \tl_if_in:nnT {#1 <= end_of_string} {##1 <= end_of_string}
+ { \bool_set_true:N \l_tmpa_bool \clist_map_break: }
+ }
+ \bool_if:NTF \l_tmpa_bool \prg_return_true: \prg_return_false:
+ }
+\cs_set:Nn \fontspec_fullname:n {
+ \fontspec_namewrap:n { #1 \l_fontspec_extension_tl }
+ \l_fontspec_renderer_tl
+ \l_fontspec_optical_size_tl
+}
+%% Now we have a unique (in fact, too unique!) string that contains
+\prg_new_conditional:Nnn \fontspec_save_family:n {T} {
+ \cs_if_exist:cF {g_fontspec_UID_\l_fontspec_fontid_tl}
+ {
+ \cs_if_exist:cTF {g_fontspec_family_#1_int} {
+ \int_gincr:c {g_fontspec_family_#1_int}
+ }{
+ \int_new:c {g_fontspec_family_#1_int}
+ }
+ \tl_set:Nx \l_fontspec_tmp_tl {#1}
+ \tl_remove_all:Nn \l_fontspec_tmp_tl {~}
+ \tl_gset:cx {g_fontspec_UID_\l_fontspec_fontid_tl}
+ {
+ \l_fontspec_tmp_tl ( \int_use:c {g_fontspec_family_#1_int} )
+ }
+ }
+ \tl_gset:Nv \l_fontspec_family_tl {g_fontspec_UID_\l_fontspec_fontid_tl}
+ \cs_if_exist:cTF {g_fontspec_ \l_fontspec_family_tl _prop}
+ \prg_return_false: \prg_return_true:
+}
+\cs_new:Nn \fontspec_set_scriptlang: {
+ \bool_if:NT \l_fontspec_firsttime_bool {
+ \tl_if_empty:NTF \l_fontspec_script_name_tl {
+ \fontspec_check_script:nTF {latn}
+ {
+ \tl_set:Nn \l_fontspec_script_name_tl {Latin}
+ \tl_if_empty:NT \l_fontspec_lang_name_tl {
+ \tl_set:Nn \l_fontspec_lang_name_tl {Default}
+ }
+ \keys_set:nx {fontspec} {Script=\l_fontspec_script_name_tl}
+ \keys_set:nx {fontspec} {Language=\l_fontspec_lang_name_tl}
+ }
+ {
+ \fontspec_info:n {no-scripts}
+ }
+ }
+ {
+ \tl_if_empty:NT \l_fontspec_lang_name_tl {
+ \tl_set:Nn \l_fontspec_lang_name_tl {Default}
+ }
+ \keys_set:nx {fontspec} {Script=\l_fontspec_script_name_tl}
+ \keys_set:nx {fontspec} {Language=\l_fontspec_lang_name_tl}
+ }
+ }
+}
+\cs_generate_variant:Nn \prop_gput:Nnn {cnV}
+\cs_generate_variant:Nn \prop_gput:Nnn {cnx}
+\cs_new:Nn \fontspec_save_fontinfo:nn {
+
+ \prop_new:c {g_fontspec_ \l_fontspec_family_tl _prop}
+ \prop_gput:cnx {g_fontspec_ \l_fontspec_family_tl _prop} {fontname} {#2}
+ \prop_gput:cnx {g_fontspec_ \l_fontspec_family_tl _prop} {options} {\g_fontspec_default_fontopts_tl #1}
+ \prop_gput:cnx {g_fontspec_ \l_fontspec_family_tl _prop} {fontdef} {
+ \fontspec_fullname:n {\l_fontspec_fontname_tl} :
+ \l_fontspec_pre_feat_sclist \l_fontspec_rawfeatures_sclist
+ }
+ \prop_gput:cnV {g_fontspec_ \l_fontspec_family_tl _prop} {script-num} \l_fontspec_script_int
+ \prop_gput:cnV {g_fontspec_ \l_fontspec_family_tl _prop} {lang-num} \l_fontspec_language_int
+ \prop_gput:cnV {g_fontspec_ \l_fontspec_family_tl _prop} {script-tag} \l_fontspec_script_tl
+ \prop_gput:cnV {g_fontspec_ \l_fontspec_family_tl _prop} {lang-tag} \l_fontspec_lang_tl
+
+ \tl_gset:cx {zf@family@fontname\l_fontspec_family_tl} {#2}
+ \tl_gset:cx {zf@family@options\l_fontspec_family_tl} {\g_fontspec_default_fontopts_tl #1}
+ \tl_gset:cx {zf@family@fontdef\l_fontspec_family_tl} {
+ \fontspec_fullname:n {\l_fontspec_fontname_tl} :
+ \l_fontspec_pre_feat_sclist \l_fontspec_rawfeatures_sclist
+ }
+ \tl_gset:cV {g_fontspec_script_num_(\l_fontspec_family_tl)_tl} \l_fontspec_script_int
+ \tl_gset:cV {g_fontspec_lang_num_(\l_fontspec_family_tl)_tl} \l_fontspec_language_int
+ \tl_gset_eq:cN {g_fontspec_script_(\l_fontspec_family_tl)_tl} \l_fontspec_script_tl
+ \tl_gset_eq:cN {g_fontspec_lang_(\l_fontspec_family_tl)_tl} \l_fontspec_lang_tl
+}
+\cs_new:Nn \fontspec_set_upright: {
+ \fontspec_make_font_shapes:nnnn \l_fontspec_fontname_tl
+ \mddefault \updefault \l_fontspec_fontfeat_up_clist
+}
+\cs_new:Nn \fontspec_set_bold: {
+ \bool_if:NF \l_fontspec_nobf_bool {
+ \tl_if_empty:NTF \l_fontspec_fontname_bf_tl {
+ \fontspec_make_auto_font_shapes:nnnnn \l_fontspec_fontname_tl {/B}
+ \bfdefault \updefault \l_fontspec_fontfeat_bf_clist
+ }{
+ \fontspec_make_font_shapes:nnnn \l_fontspec_fontname_bf_tl
+ \bfdefault \updefault \l_fontspec_fontfeat_bf_clist
+ }
+ }
+}
+\cs_new:Nn \fontspec_set_italic: {
+ \bool_if:NF \l_fontspec_noit_bool {
+ \tl_if_empty:NTF \l_fontspec_fontname_it_tl
+ { \fontspec_make_auto_font_shapes:nnnnn \l_fontspec_fontname_tl {/I} }
+ { \fontspec_make_font_shapes:nnnn \l_fontspec_fontname_it_tl }
+ \mddefault \itdefault \l_fontspec_fontfeat_it_clist
+ }
+}
+\cs_new:Nn \fontspec_set_slanted:
+ {
+ \tl_if_empty:NF \l_fontspec_fontname_sl_tl
+ {
+ \fontspec_make_font_shapes:nnnn
+ \l_fontspec_fontname_sl_tl \mddefault \sldefault
+ \l_fontspec_fontfeat_sl_clist
+ }
+ }
+\cs_new:Nn \fontspec_set_bold_italic: {
+ \bool_if:nF {\l_fontspec_noit_bool || \l_fontspec_nobf_bool} {
+ \tl_if_empty:NTF \l_fontspec_fontname_bfit_tl
+ {
+ \tl_if_empty:NTF \l_fontspec_fontname_bf_tl
+ {
+ \tl_if_empty:NTF \l_fontspec_fontname_it_tl
+ {
+ \fontspec_make_auto_font_shapes:nnnnn \l_fontspec_fontname_tl {/BI}
+ }
+ {
+ \fontspec_make_auto_font_shapes:nnnnn \l_fontspec_fontname_it_tl {/B}
+ }
+ }
+ {
+ \fontspec_make_auto_font_shapes:nnnnn \l_fontspec_fontname_bf_tl {/I}
+ }
+ }
+ {
+ \fontspec_make_font_shapes:nnnn \l_fontspec_fontname_bfit_tl
+ }
+ \bfdefault \itdefault \l_fontspec_fontfeat_bfit_clist
+ }
+}
+\cs_new:Nn \fontspec_set_bold_slanted:
+ {
+ \tl_if_empty:NTF \l_fontspec_fontname_bfsl_tl
+ {
+ \tl_if_empty:NF \l_fontspec_fontname_sl_tl {
+ \fontspec_make_auto_font_shapes:nnnnn \l_fontspec_fontname_sl_tl {/B}
+ \bfdefault \sldefault \l_fontspec_fontfeat_bfsl_clist
+ }
+ }{
+ \fontspec_make_font_shapes:nnnn \l_fontspec_fontname_bfsl_tl
+ \bfdefault \sldefault \l_fontspec_fontfeat_bfsl_clist
+ }
+ }
+\cs_new:Nn \fontspec_set_font_type:
+ {
+ \bool_set_true:N \l_fontspec_icu_bool
+ }
+\cs_new:Nn \fontspec_make_auto_font_shapes:nnnnn
+ {
+ \bool_if:NF \l_fontspec_external_bool
+ {
+ \fontspec_font_set:Nnn \l_tmpa_font
+ { \fontspec_fullname:n {#1} } {\f@size pt}
+ \fontspec_font_set:Nnn \l_tmpb_font
+ { \fontspec_fullname:n {#1#2} } {\f@size pt}
+ \str_if_eq:xxTF { \fontname \l_tmpa_font } { \fontname \l_tmpb_font }
+ { \fontspec_info:nx {no-font-shape} {#1#2} }
+ { \fontspec_make_font_shapes:nnnn {#1#2}{#3}{#4}{#5} }
+ }
+ }
+\cs_new:Nn \fontspec_make_font_shapes:nnnn {
+ \group_begin:
+ \tl_set:Nx \l_fontspec_fontname_tl {#1}
+ \fontspec_font_set:Nnn \l_fontspec_font {\fontspec_fullname:n {#1}} {\f@size pt}
+ \font_if_null:NT \l_fontspec_font { \fontspec_error:nx {font-not-found} {#1} }
+ \fontspec_declare_shape:nnn {#2}{#3}{#4}
+ \tl_if_empty:NTF \l_fontspec_fontname_sc_tl {
+ \bool_if:NF \l_fontspec_nosc_bool {
+ \fontspec_make_smallcaps:T {
+ \fontspec_declare_shape:nnn {#2}
+ { \tl_if_eq:NNTF #3 \itdefault \sidefault \scdefault }
+ { #4 , Letters=SmallCaps, \l_fontspec_fontfeat_sc_clist }
+ }
+ }
+ }{
+ \fontspec_font_set:Nnn \l_fontspec_font {\fontspec_fullname:n {\l_fontspec_fontname_sc_tl}} {\f@size pt}
+ \tl_set:Nx \l_fontspec_fontname_tl {\l_fontspec_fontname_sc_tl}
+ \fontspec_declare_shape:nnn {#2}
+ { \tl_if_eq:NNTF #3 \itdefault \sidefault \scdefault }
+ { #4 , \l_fontspec_fontfeat_sc_clist }
+ }
+ \group_end:
+}
+\cs_new:Nn \fontspec_declare_shape:nnn {
+ \clist_if_empty:NTF \l_fontspec_sizefeat_clist
+ {
+ \fontspec_get_features:n {#3}
+ \tl_set:Nx \l_fontspec_nfss_tl {
+ <-> \l_fontspec_scale_tl
+ \fontspec_fontwrap:n {
+ \fontspec_fullname:n {\l_fontspec_fontname_tl} :
+ \l_fontspec_pre_feat_sclist \l_fontspec_rawfeatures_sclist
+ }
+ }
+ }
+ {
+ \tl_clear:N \l_fontspec_nfss_tl
+ \clist_map_inline:Nn \l_fontspec_sizefeat_clist {
+
+ \tl_clear:N \l_fontspec_size_tl
+ \tl_set_eq:NN \l_fontspec_sizedfont_tl \l_fontspec_fontname_tl
+
+ \keys_set_known:nxN {fontspec-sizing} { \exp_after:wN \use:n ##1 }
+ \l_fontspec_keys_leftover_clist
+
+ \tl_if_empty:NT \l_fontspec_size_tl { \fontspec_error:n {no-size-info} }
+ \fontspec_get_features:n{ #3 , \l_fontspec_keys_leftover_clist }
+
+ \tl_put_right:Nx \l_fontspec_nfss_tl {
+ <\l_fontspec_size_tl> \l_fontspec_scale_tl
+ \fontspec_fontwrap:n {
+ \fontspec_fullname:n { \l_fontspec_sizedfont_tl }
+ : \l_fontspec_pre_feat_sclist \l_fontspec_rawfeatures_sclist
+ }
+ }
+
+ }
+ }
+ \use:x{
+ \exp_not:N\DeclareFontShape{\g_fontspec_encoding_tl}{\l_fontspec_family_tl}{#1}{#2}
+ {\l_fontspec_nfss_tl}{\l_fontspec_postadjust_tl}
+ }
+ \bool_if:nT {
+ \str_if_eq_p:xx {#2} {\itdefault} &&
+ !(\str_if_eq_p:xx {\itdefault} {\sldefault})
+ }
+ {
+ \use:x {
+ \exp_not:N \DeclareFontShape {\g_fontspec_encoding_tl}{\l_fontspec_family_tl}{#2}{\sldefault}
+ {<->ssub*\l_fontspec_family_tl/#1/\itdefault}{\l_fontspec_postadjust_tl}
+ }
+ }
+ \tl_gput_right:Nx \l_fontspec_defined_shapes_tl
+ { \exp_not:n { \\ \\ }
+ *~ '\exp_not:N \prg_case_str:nnn {#1/#2} {
+ {\mddefault/\updefault} {normal}
+ {\mddefault/\scdefault} {small~ caps}
+ {\bfdefault/\updefault} {bold}
+ {\bfdefault/\scdefault} {bold~ small~ caps}
+ {\mddefault/\itdefault} {italic}
+ {\mddefault/\sidefault} {italic~ small~ caps}
+ {\bfdefault/\itdefault} {bold~ italic}
+ {\bfdefault/\sidefault} {bold~ italic~ small~ caps}
+ } {#2/#3}'~
+ with~ NFSS~ spec.: \exp_not:N \\
+ \l_fontspec_nfss_tl
+ \tl_if_empty:NF \l_fontspec_postadjust_tl {
+ \exp_not:N \\ and~ font~ adjustment~ code: \exp_not:N \\ \l_fontspec_postadjust_tl
+ }
+ }
+}
+\tl_set:Nn \l_fontspec_pre_feat_sclist
+ {
+ mode = \l_fontspec_mode_tl ;
+ \tl_if_empty:NF \l_fontspec_script_tl
+ {
+ script = \l_fontspec_script_tl ;
+ language = \l_fontspec_lang_tl ;
+ }
+ }
+\cs_new:Nn \fontspec_update_fontid:n {
+ \bool_if:NT \l_fontspec_firsttime_bool {
+ \tl_gput_right:Nx \l_fontspec_fontid_tl {#1}
+ }
+}
+\cs_set:Npn \fontspec_get_features:n #1 {
+ \sclist_clear:N \l_fontspec_rawfeatures_sclist
+ \tl_clear:N \l_fontspec_scale_tl
+ \tl_set_eq:NN \l_fontspec_opacity_tl \g_fontspec_opacity_tl
+ \tl_set_eq:NN \l_fontspec_hexcol_tl \g_fontspec_hexcol_tl
+ \tl_clear:N \l_fontspec_postadjust_tl
+ \keys_set:nx {fontspec} {\l_fontspec_fontfeat_clist #1}
+ \str_if_eq:xxF { \l_fontspec_hexcol_tl \l_fontspec_opacity_tl }
+ { \g_fontspec_hexcol_tl \g_fontspec_opacity_tl }
+ {
+ \fontspec_update_featstr:n{color=\l_fontspec_hexcol_tl\l_fontspec_opacity_tl}
+ }
+}
+\tl_clear:N \l_fontspec_fontname_bf_tl
+\tl_clear:N \l_fontspec_fontname_it_tl
+\tl_clear:N \l_fontspec_fake_slant_tl
+\tl_clear:N \l_fontspec_fake_embolden_tl
+\tl_clear:N \l_fontspec_fontname_bfit_tl
+\tl_clear:N \l_fontspec_fontname_sl_tl
+\tl_clear:N \l_fontspec_fontname_bfsl_tl
+\tl_clear:N \l_fontspec_fontname_sc_tl
+\tl_clear:N \l_fontspec_fontfeat_up_clist
+\tl_clear:N \l_fontspec_fontfeat_bf_clist
+\tl_clear:N \l_fontspec_fontfeat_it_clist
+\tl_clear:N \l_fontspec_fontfeat_bfit_clist
+\tl_clear:N \l_fontspec_fontfeat_sl_clist
+\tl_clear:N \l_fontspec_fontfeat_bfsl_clist
+\tl_clear:N \l_fontspec_fontfeat_sc_clist
+\tl_clear:N \l_fontspec_script_name_tl
+\tl_clear:N \l_fontspec_script_tl
+\tl_clear:N \l_fontspec_lang_name_tl
+\tl_clear:N \l_fontspec_lang_tl
+\clist_clear:N \l_fontspec_sizefeat_clist
+\tl_new:N \g_fontspec_hexcol_tl
+\tl_new:N \g_fontspec_opacity_tl
+\tl_set:Nn \g_fontspec_hexcol_tl {000000}
+\tl_set:Nn \g_fontspec_opacity_tl {FF~}
+\cs_set:Npn \fontspec_init: {
+ \bool_set_false:N \l_fontspec_icu_bool
+ \bool_set_true:N \l_fontspec_firsttime_bool
+ \cs_set:Npn \fontspec_namewrap:n ##1
+ { name:##1 }
+ \tl_clear:N \l_fontspec_optical_size_tl
+ \tl_clear:N \l_fontspec_renderer_tl
+ \tl_clear:N \l_fontspec_defined_shapes_tl
+ \tl_set:Nn \l_fontspec_mode_tl {node}
+ \luatexprehyphenchar =`\- % fixme
+ \luatexposthyphenchar = 0 % fixme
+ \luatexpreexhyphenchar = 0 % fixme
+ \luatexpostexhyphenchar= 0 % fixme
+}
+\cs_set:Nn \fontspec_make_ot_smallcaps:T {
+ \fontspec_check_ot_feat:nT {+smcp} { #1 }
+}
+\cs_set_eq:NN \fontspec_make_smallcaps:T \fontspec_make_ot_smallcaps:T
+\cs_set_eq:NN \sclist_clear:N \tl_clear:N
+\cs_new:Nn \sclist_gput_right:Nn {
+ \tl_gput_right:Nn #1 {#2;}
+}
+\cs_generate_variant:Nn \sclist_gput_right:Nn {Nx}
+\cs_new:Nn \fontspec_update_featstr:n {
+ \bool_if:NF \l_fontspec_firsttime_bool {
+ \sclist_gput_right:Nx \l_fontspec_rawfeatures_sclist {#1}
+ }
+}
+\cs_new:Nn \fontspec_make_feature:nnn
+ {
+ \fontspec_make_ICU_feature:n {#3}
+ }
+\cs_generate_variant:Nn \fontspec_make_feature:nnn {nnx}
+\cs_new:Nn \fontspec_make_AAT_feature:nn {
+ \tl_if_empty:nTF {#1}
+ { \fontspec_warning:n {aat-feature-not-exist} }
+ {
+ \fontspec_make_AAT_feature_string:nnTF {#1}{#2}
+ {
+ \fontspec_update_fontid:n {+#1,#2}
+ \fontspec_update_featstr:n {\l_fontspec_feature_string_tl}
+ }
+ { \fontspec_warning:nx {aat-feature-not-exist-in-font} {#1,#2} }
+ }
+}
+\cs_new:Nn \fontspec_make_ICU_feature:n {
+ \tl_if_empty:nTF {#1}
+ { \fontspec_warning:n {icu-feature-not-exist} }
+ {
+ \fontspec_check_ot_feat:nTF {#1}
+ {
+ \fontspec_update_fontid:n {#1}
+ \fontspec_update_featstr:n{#1}
+ }
+ { \fontspec_warning:nx {icu-feature-not-exist-in-font} {#1} }
+ }
+}
+\cs_new_protected:Nn \fontspec_make_numbered_feature:nn
+ {
+ \fontspec_check_ot_feat:nTF {#1}
+ {
+ \fontspec_update_fontid:n {#1=#2}
+ \fontspec_update_featstr:n { #1 = \int_eval:n {#2+1} }
+ }
+ { \fontspec_warning:nx {icu-feature-not-exist-in-font} {#1} }
+ }
+\cs_generate_variant:Nn \fontspec_make_numbered_feature:nn {xn}
+\cs_new:Nn \fontspec_define_font_feature:n {
+ \keys_define:nn {fontspec} { #1 .multichoice: }
+}
+\cs_new:Nn \fontspec_define_feature_option:nnnnn {
+ \keys_define:nn {fontspec} {
+ #1/#2 .code:n = { \fontspec_make_feature:nnn{#3}{#4}{#5} }
+ }
+}
+\cs_new:Nn \fontspec_define_numbered_feat:nnnn
+ {
+ \keys_define:nn {fontspec}
+ {
+ #1/#2 .code:n =
+ { \fontspec_make_numbered_feature:nn {#3}{#4} }
+ }
+ }
+\prg_new_conditional:Nnn \fontspec_make_AAT_feature_string:nn {TF,T,F} {
+ \tl_set:Nx \l_tmpa_tl { \XeTeXfeaturename \l_fontspec_font #1 }
+ \tl_if_empty:NTF \l_tmpa_tl
+ { \prg_return_false: }
+ {
+ \int_compare:nTF { \XeTeXisexclusivefeature\l_fontspec_font #1 > 0 }
+ {
+ \tl_set:Nx \l_tmpb_tl {\XeTeXselectorname\l_fontspec_font #1\space #2}
+ }{
+ \int_if_even:nTF {#2}
+ {
+ \tl_set:Nx \l_tmpb_tl {\XeTeXselectorname\l_fontspec_font #1\space #2}
+ }{
+ \tl_set:Nx \l_tmpb_tl {
+ \XeTeXselectorname\l_fontspec_font #1\space \numexpr#2-1\relax
+ }
+ \tl_if_empty:NF \l_tmpb_tl { \tl_put_left:Nn \l_tmpb_tl {!} }
+ }
+ }
+ \tl_if_empty:NTF \l_tmpb_tl
+ { \prg_return_false: }
+ {
+ \tl_set:Nx \l_fontspec_feature_string_tl { \l_tmpa_tl = \l_tmpb_tl }
+ \prg_return_true:
+ }
+ }
+}
+\cs_set:Npn \fontspec_iv_str_to_num:Nn #1#2 {
+ \fontspec_iv_str_to_num:w #1 \q_nil #2 \c_empty_tl \c_empty_tl \q_nil
+}
+\cs_set:Npn \fontspec_iv_str_to_num:w #1 \q_nil #2#3#4#5#6 \q_nil {
+ \int_set:Nn #1 {
+ `#2 * "1000000
+ + `#3 * "10000
+ + \ifx \c_empty_tl #4 32 \else `#4 \fi * "100
+ + \ifx \c_empty_tl #5 32 \else `#5 \fi
+ }
+}
+\cs_generate_variant:Nn \fontspec_iv_str_to_num:Nn {No}
+\cs_set:Npn \fontspec_v_str_to_num:Nn #1#2 {
+ \bool_if:nTF
+ {
+ \tl_if_head_eq_charcode_p:nN {#2} {+} ||
+ \tl_if_head_eq_charcode_p:nN {#2} {-}
+ }
+ { \fontspec_iv_str_to_num:No #1 { \use_none:n #2 } }
+ { \fontspec_iv_str_to_num:Nn #1 {#2} }
+}
+\prg_new_conditional:Nnn \fontspec_check_script:n {TF}
+ {
+ \directlua{fontspec.check_ot_script("l_fontspec_font", "#1")}
+ \if@tempswa \prg_return_true: \else: \prg_return_false: \fi:
+ }
+\prg_new_conditional:Nnn \fontspec_check_lang:n {TF}
+ {
+ \directlua{
+ fontspec.check_ot_lang( "l_fontspec_font", "#1", "\l_fontspec_script_tl" )
+ }
+ \if@tempswa \prg_return_true: \else: \prg_return_false: \fi:
+ }
+\prg_new_conditional:Nnn \fontspec_check_ot_feat:n {TF,T}
+ {
+ \directlua{
+ fontspec.check_ot_feat(
+ "l_fontspec_font", "#1",
+ "\l_fontspec_lang_tl", "\l_fontspec_script_tl"
+ )
+ }
+ \if@tempswa \prg_return_true: \else: \prg_return_false: \fi:
+ }
+\cs_generate_variant:Nn \keys_set:nn {nx}
+\cs_generate_variant:Nn \keys_set_known:nnN {nx}
+\bool_new:N \l_fontspec_external_bool
+\keys_define:nn {fontspec-preparse-external} {
+ ExternalLocation .code:n = {
+ \bool_set_true:N \l_fontspec_nobf_bool
+ \bool_set_true:N \l_fontspec_noit_bool
+ \bool_set_true:N \l_fontspec_external_bool
+ \cs_gset:Npn \fontspec_namewrap:n ##1
+ { file: #1 ##1 }
+ }
+}
+\aliasfontfeature{ExternalLocation}{Path}
+\keys_define:nn {fontspec-preparse-external} {
+ Extension .code:n = {
+ \tl_set:Nn \l_fontspec_extension_tl {#1}
+ \bool_if:NF \l_fontspec_external_bool {
+ \keys_set:nn {fontspec-preparse-external} {ExternalLocation}
+ }
+}
+}
+\tl_clear:N \l_fontspec_extension_tl
+\keys_define:nn {fontspec-preparse} {
+ Renderer .choice_code:n = {
+ \fontspec_update_fontid:n {+rend:\l_keys_choice_tl}
+ \int_compare:nTF {\l_keys_choice_int < 3} {
+ \fontspec_warning:nx {only-xetex-feature} {Renderer=AAT/ICU/Graphite}
+ }{
+ \tl_set:Nv \l_fontspec_mode_tl
+ { g_fontspec_mode_tag_ \l_keys_choice_tl }
+ }
+ }
+ ,
+ Renderer .generate_choices:n = {AAT,ICU,Graphite,Full,Basic}
+}
+\tl_set:cn {g_fontspec_renderer_tag_AAT} {/AAT}
+\tl_set:cn {g_fontspec_renderer_tag_ICU} {/ICU}
+\tl_set:cn {g_fontspec_renderer_tag_Graphite} {/GR}
+\tl_set:cn {g_fontspec_mode_tag_Full} {node}
+\tl_set:cn {g_fontspec_mode_tag_Basic} {base}
+\keys_define:nn {fontspec-preparse} { Script .code:n = {
+ \tl_set:Nn \l_fontspec_script_name_tl {#1}
+ \fontspec_update_fontid:n {+script:#1}
+ }
+}
+\keys_define:nn {fontspec-preparse} { Language .code:n = {
+ \tl_set:Nn \l_fontspec_lang_name_tl {#1}
+ \fontspec_update_fontid:n {+language:#1}
+ }
+}
+\keys_define:nn {fontspec-preparse-external} { UprightFont .code:n = {
+ \fontspec_complete_fontname:Nn \l_fontspec_fontname_up_tl {#1}
+ \fontspec_update_fontid:n {up:#1}
+ }
+}
+\keys_define:nn {fontspec-preparse-external} { BoldFont .code:n = {
+ \tl_if_empty:nTF {#1}
+ {
+ \bool_set_true:N \l_fontspec_nobf_bool
+ \fontspec_update_fontid:n {nobf}
+ }
+ {
+ \bool_set_false:N \l_fontspec_nobf_bool
+ \fontspec_complete_fontname:Nn \l_fontspec_fontname_bf_tl {#1}
+ \fontspec_update_fontid:n {bf:#1}
+ }
+ }
+}
+\keys_define:nn {fontspec-preparse-external} { ItalicFont .code:n = {
+ \tl_if_empty:nTF {#1}
+ {
+ \bool_set_true:N \l_fontspec_noit_bool
+ \fontspec_update_fontid:n {noit}
+ }{
+ \bool_set_false:N \l_fontspec_noit_bool
+ \fontspec_complete_fontname:Nn \l_fontspec_fontname_it_tl {#1}
+ \fontspec_update_fontid:n {it:#1}
+ }
+ }
+}
+\keys_define:nn {fontspec-preparse-external} { BoldItalicFont .code:n = {
+ \fontspec_complete_fontname:Nn \l_fontspec_fontname_bfit_tl {#1}
+ \fontspec_update_fontid:n {bfit:#1}
+ }
+}
+\keys_define:nn {fontspec-preparse-external}
+ {
+ SlantedFont .code:n =
+ {
+ \fontspec_complete_fontname:Nn \l_fontspec_fontname_sl_tl {#1}
+ \fontspec_update_fontid:n {sl:#1}
+ }
+ }
+\keys_define:nn {fontspec-preparse-external} { BoldSlantedFont .code:n = {
+ \fontspec_complete_fontname:Nn \l_fontspec_fontname_bfsl_tl {#1}
+ \fontspec_update_fontid:n {bfsl:#1}
+ }
+}
+\keys_define:nn {fontspec} { SmallCapsFont .code:n = {
+ \tl_if_empty:nTF {#1}
+ {
+ \bool_set_true:N \l_fontspec_nosc_bool
+ \fontspec_update_fontid:n {nosc}
+ }{
+ \bool_set_true:N \l_fontspec_nosc_bool
+ \fontspec_complete_fontname:Nn \l_fontspec_fontname_sc_tl {#1}
+ \fontspec_update_fontid:n {sc:#1}
+ }
+ }
+}
+\cs_set:Npn \fontspec_complete_fontname:Nn #1#2 {
+ \tl_set:Nn #1 {#2}
+ \tl_replace_all:Nnx #1 {*} {\l_fontspec_fontname_tl}
+ \tl_remove_all:Nn #1 {~}
+}
+\cs_generate_variant:Nn \tl_replace_all:Nnn {Nnx}
+\keys_define:nn {fontspec-preparse} { UprightFeatures .code:n = {
+ \def\l_fontspec_fontfeat_up_clist{, #1}
+ \fontspec_update_fontid:n {rmfeat:#1}
+ }
+}
+\keys_define:nn {fontspec-preparse} { BoldFeatures .code:n = {
+ \def\l_fontspec_fontfeat_bf_clist{, #1}
+ \fontspec_update_fontid:n {bffeat:#1}
+ }
+}
+\keys_define:nn {fontspec-preparse} { ItalicFeatures .code:n = {
+ \def\l_fontspec_fontfeat_it_clist{, #1}
+ \fontspec_update_fontid:n {itfeat:#1}
+ }
+}
+\keys_define:nn {fontspec-preparse} { BoldItalicFeatures .code:n = {
+ \def\l_fontspec_fontfeat_bfit_clist{, #1}
+ \fontspec_update_fontid:n {bfitfeat:#1}
+ }
+}
+\keys_define:nn {fontspec-preparse} { SlantedFeatures .code:n = {
+ \def\l_fontspec_fontfeat_sl_clist{, #1}
+ \fontspec_update_fontid:n {slfeat:#1}
+ }
+}
+\keys_define:nn {fontspec-preparse} { BoldSlantedFeatures .code:n = {
+ \def\l_fontspec_fontfeat_bfsl_clist{, #1}
+ \fontspec_update_fontid:n {bfslfeat:#1}
+ }
+}
+\keys_define:nn {fontspec} { SmallCapsFeatures .code:n = {
+ \bool_if:NF \l_fontspec_firsttime_bool {
+ \def\l_fontspec_fontfeat_sc_clist{, #1}
+ }
+ \fontspec_update_fontid:n {scfeat:#1}
+ }
+}
+\keys_define:nn {fontspec-preparse} { SizeFeatures .code:n = {
+ \tl_set:Nn \l_fontspec_sizefeat_clist {#1}
+ \fontspec_update_fontid:n {sizefeat:#1}
+ }
+}
+\keys_define:nn {fontspec-sizing}
+ {
+ Size .code:n =
+ {
+ \tl_set:Nn \l_fontspec_size_tl {#1}
+ }
+ }
+\keys_define:nn {fontspec-sizing}
+ {
+ Font .code:n =
+ {
+ \fontspec_complete_fontname:Nn \l_fontspec_sizedfont_tl {#1}
+ }
+ }
+\keys_define:nn {fontspec} { Scale .code:n = {
+ \prg_case_str:nnn {#1}
+ {
+ {MatchLowercase} { \fontspec_calc_scale:n {5} }
+ {MatchUppercase} { \fontspec_calc_scale:n {8} }
+ }
+ { \tl_set:Nx \l_fontspec_scale_tl {#1} }
+ \fontspec_update_fontid:n {+scale:\l_fontspec_scale_tl}
+ \tl_set:Nx \l_fontspec_scale_tl { s*[\l_fontspec_scale_tl] }
+ }
+}
+\cs_new:Nn \fontspec_calc_scale:n {
+ \group_begin:
+ \rmfamily
+ \fontspec_set_font_dimen:NnN \l_fontspec_tmpa_dim {#1} \font
+ \fontspec_set_font_dimen:NnN \l_fontspec_tmpb_dim {#1} \l_fontspec_font
+ \fp_set_from_dim:Nn \l_fontspec_tmpa_fp { \l_fontspec_tmpa_dim }
+ \fp_set_from_dim:Nn \l_fontspec_tmpb_fp { \l_fontspec_tmpb_dim }
+ \fp_div:Nn \l_fontspec_tmpa_fp { \l_fontspec_tmpb_fp }
+ \tl_gset:Nx \l_fontspec_scale_tl { \fp_use:N \l_fontspec_tmpa_fp }
+ \fontspec_info:n {set-scale}
+ \group_end:
+}
+\cs_new:Nn \fontspec_set_font_dimen:NnN
+{
+ \dim_set:Nn #1 { \fontdimen #2 #3 }
+ \dim_compare:nNnT #1 = {0pt} {
+ \settoheight #1 {
+ \str_if_eq:nnTF {#3} {\font} \rmfamily #3
+ \prg_case_int:nnn #2 {
+ {5} {x} % x-height
+ {8} {X} % cap-height
+ } {?} % "else" clause; never reached.
+ }
+ }
+}
+\keys_define:nn {fontspec} { WordSpace .code:n = {
+ \fontspec_update_fontid:n {+wordspace:#1}
+ \bool_if:NF \l_fontspec_firsttime_bool {
+ \_fontspec_parse_wordspace:w #1,,,\q_stop
+ }
+ }
+}
+\cs_set:Npn \_fontspec_parse_wordspace:w #1,#2,#3,#4 \q_stop {
+ \tl_if_empty:nTF {#4}
+ {
+ \tl_put_right:Nn \l_fontspec_postadjust_tl {
+ \fontdimen 2 \font = #1 \fontdimen 2 \font
+ \fontdimen 3 \font = #1 \fontdimen 3 \font
+ \fontdimen 4 \font = #1 \fontdimen 4 \font
+ }
+ }{
+ \tl_put_right:Nn \l_fontspec_postadjust_tl {
+ \fontdimen 2 \font = #1 \fontdimen 2 \font
+ \fontdimen 3 \font = #2 \fontdimen 3 \font
+ \fontdimen 4 \font = #3 \fontdimen 4 \font
+ }
+ }
+}
+\keys_define:nn {fontspec}
+ {
+ PunctuationSpace .code:n =
+ {
+ \fontspec_update_fontid:n {+punctspace:#1}
+ \tl_put_right:Nx \l_fontspec_postadjust_tl
+ { \fontdimen 7 \font = #1 \fontdimen 7 \font }
+ }
+ }
+\keys_define:nn {fontspec} { FontAdjustment .code:n = {
+ \fontspec_update_fontid:n {+fontadjust:\detokenize{#1}}
+ \tl_put_right:Nx \l_fontspec_postadjust_tl {#1}
+ }
+}
+\keys_define:nn {fontspec} { LetterSpace .code:n = {
+ \fontspec_update_fontid:n {+tracking:#1}
+ \fontspec_update_featstr:n{letterspace=#1}
+ }
+}
+\keys_define:nn {fontspec} { HyphenChar .code:n = {
+ \fontspec_update_fontid:n {+hyphenchar:#1}
+ \str_if_eq:nnTF {#1} {None}
+ {
+ \tl_put_right:Nn \l_fontspec_postadjust_tl
+ { \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} }
+ \font_glyph_if_exist:NnTF \l_fontspec_font {\l_fontspec_hyphenchar_tl}
+ {
+ \tl_put_right:Nn \l_fontspec_postadjust_tl
+ {
+ \hyphenchar \font = \c_zero
+ \luatexprehyphenchar = \l_fontspec_hyphenchar_tl \scan_stop:
+ }
+ }
+ { \fontspec_error:nx {no-glyph}{#1} }
+ }
+ }
+}
+\keys_define:nn {fontspec} { Color .code:n = {
+ \fontspec_update_fontid:n {+col:#1}
+ \cs_if_exist:cTF { \token_to_str:N \color@ #1 }
+ {
+ \convertcolorspec{named}{#1}{HTML}\l_fontspec_hexcol_tl
+ }
+ {
+ \int_compare:nTF { \tl_length:n {#1} == 6 }
+ { \tl_set:Nn \l_fontspec_hexcol_tl {#1} }
+ {
+ \int_compare:nTF { \tl_length:n {#1} == 8 }
+ { \fontspec_parse_colour:viii #1 }
+ {
+ \bool_if:NF \l_fontspec_firsttime_bool {
+ \fontspec_warning:nx {bad-colour} {#1}
+ }
+ }
+ }
+ }
+ }
+}
+\cs_set:Npn \fontspec_parse_colour:viii #1#2#3#4#5#6#7#8 {
+ \tl_set:Nn \l_fontspec_hexcol_tl {#1#2#3#4#5#6}
+ \tl_if_eq:NNF \l_fontspec_opacity_tl \g_fontspec_opacity_tl
+ {
+ \bool_if:NF \l_fontspec_firsttime_bool {
+ \fontspec_warning:nx {opa-twice-col} {#7#8}
+ }
+ }
+ \tl_set:Nn \l_fontspec_opacity_tl {#7#8}
+}
+\aliasfontfeature{Color}{Colour}
+\newcounter{fontspec_tmp_int}
+\keys_define:nn {fontspec} { Opacity .code:n = {
+ \fontspec_update_fontid:n {+opac:#1}
+ \setcounter {fontspec_tmp_int} { 255*\real{#1} }
+ \tl_if_eq:NNF \l_fontspec_opacity_tl \g_fontspec_opacity_tl
+ {
+ \bool_if:NF \l_fontspec_firsttime_bool {
+ \fontspec_warning:nx {opa-twice} {#1}
+ }
+ }
+ \tl_set:Nx \l_fontspec_opacity_tl
+ {
+ \int_compare:nT { \value{fontspec_tmp_int} <= "F } {0} % zero pad
+ \int_to_hexadecimal:n { \value{fontspec_tmp_int} }
+ }
+ }
+}
+\keys_define:nn {fontspec}
+{
+ Mapping .code:n = {
+ \str_if_eq:nnTF {#1} {tex-text} {
+ \fontspec_warning:n {no-mapping-ligtex}
+ \msg_redirect_name:nnn {fontspec} {no-mapping-ligtex} {none}
+ \keys_set:nn {fontspec} { Ligatures=TeX }
+ }{
+ \fontspec_warning:n {no-mapping}
+ }
+ }
+}
+\keys_define:nn {fontspec} { FeatureFile .code:n = {
+ \fontspec_update_fontid:n {+fea:#1}
+ \fontspec_update_featstr:n{featurefile=#1}
+ }
+}
+\keys_define:nn {fontspec} { Weight .code:n = {
+ \fontspec_update_fontid:n {+weight:#1}
+ \fontspec_update_featstr:n{weight=#1}
+ }
+}
+\keys_define:nn {fontspec} { Width .code:n = {
+ \fontspec_update_fontid:n {+width:#1}
+ \fontspec_update_featstr:n{width=#1}
+ }
+}
+\keys_define:nn {fontspec} { OpticalSize .code:n =
+ {
+ \tl_set:Nn \l_fontspec_optical_size_tl {/ S = #1}
+ \fontspec_update_fontid:n {+size:#1}
+ }
+}
+\keys_define:nn {fontspec} { FakeSlant .code:n = {
+ \fontspec_update_fontid:n {+slant:#1}
+ \fontspec_update_featstr:n{slant=#1}
+ },
+ FakeSlant .default:n = {0.2}
+}
+\keys_define:nn {fontspec} { FakeStretch .code:n = {
+ \fontspec_update_fontid:n {+extend:#1}
+ \fontspec_update_featstr:n{extend=#1}
+ },
+ FakeStretch .default:n = {1.2}
+}
+\keys_define:nn {fontspec} { FakeBold .code:n = {
+ \fontspec_update_fontid:n {+embolden:#1}
+ \fontspec_update_featstr:n{embolden=#1}
+ },
+ FakeBold .default:n = {1.5}
+}
+\keys_define:nn {fontspec} { AutoFakeSlant .code:n = {
+ \bool_if:NT \l_fontspec_firsttime_bool {
+ \tl_set:Nn \l_fontspec_fake_slant_tl {#1}
+ \clist_put_right:Nn \l_fontspec_fontfeat_it_clist {,FakeSlant=#1}
+ \tl_set_eq:NN \l_fontspec_fontname_it_tl \l_fontspec_fontname_tl
+ \fontspec_update_fontid:n {fakeit:#1}
+ \tl_if_empty:NF \l_fontspec_fake_embolden_tl {
+ \tl_put_right:Nx \l_fontspec_fontfeat_bfit_clist
+ {,FakeBold=\l_fontspec_fake_embolden_tl,FakeSlant=#1}
+ \tl_set_eq:NN \l_fontspec_fontname_bfit_tl \l_fontspec_fontname_tl
+ }
+ }
+ },
+ AutoFakeSlant .default:n = {0.2}
+}
+\keys_define:nn {fontspec} { AutoFakeBold .code:n = {
+ \bool_if:NT \l_fontspec_firsttime_bool {
+ \tl_set:Nn \l_fontspec_fake_embolden_tl {#1}
+ \tl_put_right:Nn \l_fontspec_fontfeat_bf_clist {,FakeBold=#1}
+ \tl_set_eq:NN \l_fontspec_fontname_bf_tl \l_fontspec_fontname_tl
+ \fontspec_update_fontid:n {fakebf:#1}
+ \tl_if_empty:NF \l_fontspec_fake_slant_tl {
+ \tl_put_right:Nx \l_fontspec_fontfeat_bfit_clist
+ {,FakeSlant=\l_fontspec_fake_slant_tl,FakeBold=#1}
+ \tl_set_eq:NN \l_fontspec_fontname_bfit_tl \l_fontspec_fontname_tl
+ }
+ }
+ },
+ AutoFakeBold .default:n = {1.5}
+}
+\fontspec_define_font_feature:n{Ligatures}
+\fontspec_define_feature_option:nnnnn{Ligatures}{Required} {1}{0}{+rlig}
+\fontspec_define_feature_option:nnnnn{Ligatures}{NoRequired} {1}{1}{-rlig}
+\fontspec_define_feature_option:nnnnn{Ligatures}{Common} {1}{2}{+liga}
+\fontspec_define_feature_option:nnnnn{Ligatures}{NoCommon} {1}{3}{-liga}
+\fontspec_define_feature_option:nnnnn{Ligatures}{Rare} {1}{4}{+dlig}
+\fontspec_define_feature_option:nnnnn{Ligatures}{NoRare} {1}{5}{-dlig}
+\fontspec_define_feature_option:nnnnn{Ligatures}{Discretionary} {1}{4}{+dlig}
+\fontspec_define_feature_option:nnnnn{Ligatures}{NoDiscretionary}{1}{5}{-dlig}
+\fontspec_define_feature_option:nnnnn{Ligatures}{Contextual} {}{} {+clig}
+\fontspec_define_feature_option:nnnnn{Ligatures}{NoContextual} {}{} {-clig}
+\fontspec_define_feature_option:nnnnn{Ligatures}{Historic} {}{} {+hlig}
+\fontspec_define_feature_option:nnnnn{Ligatures}{NoHistoric} {}{} {-hlig}
+\fontspec_define_feature_option:nnnnn{Ligatures}{Logos} {1}{6} {}
+\fontspec_define_feature_option:nnnnn{Ligatures}{NoLogos} {1}{7} {}
+\fontspec_define_feature_option:nnnnn{Ligatures}{Rebus} {1}{8} {}
+\fontspec_define_feature_option:nnnnn{Ligatures}{NoRebus} {1}{9} {}
+\fontspec_define_feature_option:nnnnn{Ligatures}{Diphthong} {1}{10}{}
+\fontspec_define_feature_option:nnnnn{Ligatures}{NoDiphthong} {1}{11}{}
+\fontspec_define_feature_option:nnnnn{Ligatures}{Squared} {1}{12}{}
+\fontspec_define_feature_option:nnnnn{Ligatures}{NoSquared} {1}{13}{}
+\fontspec_define_feature_option:nnnnn{Ligatures}{AbbrevSquared} {1}{14}{}
+\fontspec_define_feature_option:nnnnn{Ligatures}{NoAbbrevSquared}{1}{15}{}
+\fontspec_define_feature_option:nnnnn{Ligatures}{Icelandic} {1}{32}{}
+\fontspec_define_feature_option:nnnnn{Ligatures}{NoIcelandic} {1}{33}{}
+\keys_define:nn {fontspec}
+{
+ Ligatures / TeX .code:n = {
+ \fontspec_update_fontid:n {+tlig+trep}
+ \fontspec_update_featstr:n{+tlig;+trep}
+ }
+}
+\fontspec_define_font_feature:n{Letters}
+\fontspec_define_feature_option:nnnnn{Letters}{Normal} {3}{0}{}
+\fontspec_define_feature_option:nnnnn{Letters}{Uppercase} {3}{1}{+case}
+\fontspec_define_feature_option:nnnnn{Letters}{Lowercase} {3}{2}{}
+\fontspec_define_feature_option:nnnnn{Letters}{SmallCaps} {3}{3}{+smcp}
+\fontspec_define_feature_option:nnnnn{Letters}{PetiteCaps} {} {} {+pcap}
+\fontspec_define_feature_option:nnnnn{Letters}{UppercaseSmallCaps} {} {} {+c2sc}
+\fontspec_define_feature_option:nnnnn{Letters}{UppercasePetiteCaps}{} {} {+c2pc}
+\fontspec_define_feature_option:nnnnn{Letters}{InitialCaps} {3}{4}{}
+\fontspec_define_feature_option:nnnnn{Letters}{Unicase} {} {} {+unic}
+\fontspec_define_feature_option:nnnnn{Letters}{Random} {} {} {+rand}
+\fontspec_define_font_feature:n{Numbers}
+\fontspec_define_feature_option:nnnnn{Numbers}{Monospaced} {6} {0}{+tnum}
+\fontspec_define_feature_option:nnnnn{Numbers}{Proportional} {6} {1}{+pnum}
+\fontspec_define_feature_option:nnnnn{Numbers}{Lowercase} {21}{0}{+onum}
+\fontspec_define_feature_option:nnnnn{Numbers}{OldStyle} {21}{0}{+onum}
+\fontspec_define_feature_option:nnnnn{Numbers}{Uppercase} {21}{1}{+lnum}
+\fontspec_define_feature_option:nnnnn{Numbers}{Lining} {21}{1}{+lnum}
+\fontspec_define_feature_option:nnnnn{Numbers}{SlashedZero} {14}{5}{+zero}
+\fontspec_define_feature_option:nnnnn{Numbers}{NoSlashedZero}{14}{4}{-zero}
+\luatex_if_engine:T {
+ \fontspec_define_feature_option:nnnnn{Numbers}{Arabic}{}{}{+anum}
+}
+\fontspec_define_font_feature:n {Contextuals}
+\fontspec_define_feature_option:nnnnn{Contextuals}{Swash} {} {} {+cswh}
+\fontspec_define_feature_option:nnnnn{Contextuals}{NoSwash} {} {} {-cswh}
+\fontspec_define_feature_option:nnnnn{Contextuals}{Alternate} {} {} {+calt}
+\fontspec_define_feature_option:nnnnn{Contextuals}{NoAlternate} {} {} {-calt}
+\fontspec_define_feature_option:nnnnn{Contextuals}{WordInitial} {8}{0}{+init}
+\fontspec_define_feature_option:nnnnn{Contextuals}{NoWordInitial}{8}{1}{-init}
+\fontspec_define_feature_option:nnnnn{Contextuals}{WordFinal} {8}{2}{+fina}
+\fontspec_define_feature_option:nnnnn{Contextuals}{NoWordFinal} {8}{3}{-fina}
+\fontspec_define_feature_option:nnnnn{Contextuals}{LineInitial} {8}{4}{}
+\fontspec_define_feature_option:nnnnn{Contextuals}{NoLineInitial}{8}{5}{}
+\fontspec_define_feature_option:nnnnn{Contextuals}{LineFinal} {8}{6}{+falt}
+\fontspec_define_feature_option:nnnnn{Contextuals}{NoLineFinal} {8}{7}{-falt}
+\fontspec_define_feature_option:nnnnn{Contextuals}{Inner} {8}{8}{+medi}
+\fontspec_define_feature_option:nnnnn{Contextuals}{NoInner} {8}{9}{-medi}
+\fontspec_define_font_feature:n{Diacritics}
+\fontspec_define_feature_option:nnnnn{Diacritics}{Show} {9}{0}{}
+\fontspec_define_feature_option:nnnnn{Diacritics}{Hide} {9}{1}{}
+\fontspec_define_feature_option:nnnnn{Diacritics}{Decompose} {9}{2}{}
+\fontspec_define_feature_option:nnnnn{Diacritics}{MarkToBase} {}{}{+mark}
+\fontspec_define_feature_option:nnnnn{Diacritics}{NoMarkToBase}{}{}{-mark}
+\fontspec_define_feature_option:nnnnn{Diacritics}{MarkToMark} {}{}{+mkmk}
+\fontspec_define_feature_option:nnnnn{Diacritics}{NoMarkToMark}{}{}{-mkmk}
+\fontspec_define_feature_option:nnnnn{Diacritics}{AboveBase} {}{}{+abvm}
+\fontspec_define_feature_option:nnnnn{Diacritics}{NoAboveBase} {}{}{-abvm}
+\fontspec_define_feature_option:nnnnn{Diacritics}{BelowBase} {}{}{+blwm}
+\fontspec_define_feature_option:nnnnn{Diacritics}{NoBelowBase} {}{}{-blwm}
+\fontspec_define_font_feature:n{Kerning}
+\fontspec_define_feature_option:nnnnn{Kerning}{Uppercase}{}{}{+cpsp}
+\fontspec_define_feature_option:nnnnn{Kerning}{On} {}{}{+kern}
+\fontspec_define_feature_option:nnnnn{Kerning}{Off} {}{}{-kern}
+\fontspec_define_font_feature:n{VerticalPosition}
+\fontspec_define_feature_option:nnnnn{VerticalPosition}{Normal} {10}{0}{}
+\fontspec_define_feature_option:nnnnn{VerticalPosition}{Superior} {10}{1}{+sups}
+\fontspec_define_feature_option:nnnnn{VerticalPosition}{Inferior} {10}{2}{+subs}
+\fontspec_define_feature_option:nnnnn{VerticalPosition}{Ordinal} {10}{3}{+ordn}
+\fontspec_define_feature_option:nnnnn{VerticalPosition}{Numerator} {} {} {+numr}
+\fontspec_define_feature_option:nnnnn{VerticalPosition}{Denominator}{} {} {+dnom}
+\fontspec_define_feature_option:nnnnn{VerticalPosition}{ScientificInferior}{}{}{+sinf}
+\fontspec_define_font_feature:n{Fractions}
+\fontspec_define_feature_option:nnnnn{Fractions}{On} {11}{1}{+frac}
+\fontspec_define_feature_option:nnnnn{Fractions}{Off} {11}{0}{-frac}
+\fontspec_define_feature_option:nnnnn{Fractions}{Diagonal} {11}{2}{}
+\fontspec_define_feature_option:nnnnn{Fractions}{Alternate}{} {} {+afrc}
+\fontspec_define_font_feature:n { Alternate }
+\keys_define:nn {fontspec}
+ {
+ Alternate .default:n = {0} ,
+ Alternate / unknown .code:n =
+ {
+ \fontspec_make_feature:nnx {17}{#1} { \fontspec_salt:n {#1} }
+ }
+ }
+\cs_set:Nn \fontspec_salt:n
+ { +salt = \int_eval:n {#1+1} }
+\fontspec_define_font_feature:n { Variant }
+\keys_define:nn {fontspec}
+ {
+ Variant .default:n = {0} ,
+ Variant / unknown .code:n =
+ {
+ \fontspec_make_feature:nnx {18}{#1} { +ss \two@digits {#1} }
+ }
+ }
+\aliasfontfeature{Variant}{StylisticSet}
+\fontspec_define_font_feature:n { CharacterVariant }
+\use:x
+ {
+ \cs_new:Npn \exp_not:N \fontspec_parse_cv:w
+ ##1 \c_colon_str ##2 \c_colon_str ##3 \exp_not:N \q_nil
+ {
+ \fontspec_make_numbered_feature:xn
+ { +cv \exp_not:N \two@digits {##1} } {##2}
+ }
+ \keys_define:nn {fontspec}
+ {
+ CharacterVariant / unknown .code:n =
+ {
+ \clist_map_inline:nn {##1}
+ {
+ \exp_not:N \fontspec_parse_cv:w
+ ####1 \c_colon_str 0 \c_colon_str \exp_not:N \q_nil
+ }
+ }
+ }
+ }
+\keys_define:nn {fontspec}
+ {
+ ScriptStyle .code:n = {
+ \fontspec_update_fontid:n {+ssty=1}
+ \fontspec_update_featstr:n{+sstyle}
+ },
+ ScriptScriptStyle .code:n = {
+ \fontspec_update_fontid:n {+ssty=2}
+ \fontspec_update_featstr:n{+ssstyle}
+ }
+ }
+\fontspec_define_font_feature:n{Style}
+\fontspec_define_feature_option:nnnnn{Style}{Alternate} {} {} {+salt}
+\fontspec_define_feature_option:nnnnn{Style}{Italic} {32}{2}{+ital}
+\fontspec_define_feature_option:nnnnn{Style}{Ruby} {28}{2}{+ruby}
+\fontspec_define_feature_option:nnnnn{Style}{Swash} {} {} {+swsh}
+\fontspec_define_feature_option:nnnnn{Style}{Historic} {} {} {+hist}
+\fontspec_define_feature_option:nnnnn{Style}{Display} {19}{1}{}
+\fontspec_define_feature_option:nnnnn{Style}{Engraved} {19}{2}{}
+\fontspec_define_feature_option:nnnnn{Style}{TitlingCaps} {19}{4}{+titl}
+\fontspec_define_feature_option:nnnnn{Style}{TallCaps} {19}{5}{}
+\fontspec_define_feature_option:nnnnn{Style}{HorizontalKana}{} {} {+hkna}
+\fontspec_define_feature_option:nnnnn{Style}{VerticalKana} {} {} {+vkna}
+\fontspec_define_numbered_feat:nnnn {Style} {MathScript} {+ssty} {0}
+\fontspec_define_numbered_feat:nnnn {Style} {MathScriptScript} {+ssty} {1}
+\fontspec_define_font_feature:n{CJKShape}
+\fontspec_define_feature_option:nnnnn{CJKShape}{Traditional}{20}{0} {+trad}
+\fontspec_define_feature_option:nnnnn{CJKShape}{Simplified} {20}{1} {+smpl}
+\fontspec_define_feature_option:nnnnn{CJKShape}{JIS1978} {20}{2} {+jp78}
+\fontspec_define_feature_option:nnnnn{CJKShape}{JIS1983} {20}{3} {+jp83}
+\fontspec_define_feature_option:nnnnn{CJKShape}{JIS1990} {20}{4} {+jp90}
+\fontspec_define_feature_option:nnnnn{CJKShape}{Expert} {20}{10}{+expt}
+\fontspec_define_feature_option:nnnnn{CJKShape}{NLC} {20}{13}{+nlck}
+\fontspec_define_font_feature:n{CharacterWidth}
+\fontspec_define_feature_option:nnnnn{CharacterWidth}{Proportional}{22}{0}{+pwid}
+\fontspec_define_feature_option:nnnnn{CharacterWidth}{Full}{22}{1}{+fwid}
+\fontspec_define_feature_option:nnnnn{CharacterWidth}{Half}{22}{2}{+hwid}
+\fontspec_define_feature_option:nnnnn{CharacterWidth}{Third}{22}{3}{+twid}
+\fontspec_define_feature_option:nnnnn{CharacterWidth}{Quarter}{22}{4}{+qwid}
+\fontspec_define_feature_option:nnnnn{CharacterWidth}{AlternateProportional}{22}{5}{+palt}
+\fontspec_define_feature_option:nnnnn{CharacterWidth}{AlternateHalf}{22}{6}{+halt}
+\fontspec_define_feature_option:nnnnn{CharacterWidth}{Default}{22}{7}{}
+\fontspec_define_feature_option:nnnnn{Annotation}{Off}{24}{0}{}
+\fontspec_define_feature_option:nnnnn{Annotation}{Box}{24}{1}{}
+\fontspec_define_feature_option:nnnnn{Annotation}{RoundedBox}{24}{2}{}
+\fontspec_define_feature_option:nnnnn{Annotation}{Circle}{24}{3}{}
+\fontspec_define_feature_option:nnnnn{Annotation}{BlackCircle}{24}{4}{}
+\fontspec_define_feature_option:nnnnn{Annotation}{Parenthesis}{24}{5}{}
+\fontspec_define_feature_option:nnnnn{Annotation}{Period}{24}{6}{}
+\fontspec_define_feature_option:nnnnn{Annotation}{RomanNumerals}{24}{7}{}
+\fontspec_define_feature_option:nnnnn{Annotation}{Diamond}{24}{8}{}
+\fontspec_define_feature_option:nnnnn{Annotation}{BlackSquare}{24}{9}{}
+\fontspec_define_feature_option:nnnnn{Annotation}{BlackRoundSquare}{24}{10}{}
+\fontspec_define_feature_option:nnnnn{Annotation}{DoubleCircle}{24}{11}{}
+\fontspec_define_font_feature:n { Annotation }
+\keys_define:nn {fontspec}
+ {
+ Annotation .default:n = {0} ,
+ Annotation / unknown .code:n =
+ {
+ \fontspec_make_feature:nnx {}{}
+ { +nalt= \int_eval:n {#1+1} }
+ }
+ }
+\keys_define:nn {fontspec}
+ {
+ Vertical .choice: ,
+ Vertical / RotatedGlyphs .code:n =
+ {
+ \bool_if:NTF \l_fontspec_icu_bool {
+ \fontspec_make_feature:nnn{}{}{+vrt2}
+ \fontspec_update_fontid:n {+vert}
+ \fontspec_update_featstr:n{vertical}
+ }{
+ \fontspec_update_fontid:n {+vert}
+ \fontspec_update_featstr:n{vertical}
+ }
+ }
+ }
+\newfontscript{Arabic}{arab} \newfontscript{Armenian}{armn}
+\newfontscript{Balinese}{bali} \newfontscript{Bengali}{beng}
+\newfontscript{Bopomofo}{bopo} \newfontscript{Braille}{brai}
+\newfontscript{Buginese}{bugi} \newfontscript{Buhid}{buhd}
+\newfontscript{Byzantine~Music}{byzm}
+\newfontscript{Canadian~Syllabics}{cans}
+\newfontscript{Cherokee}{cher}
+\newfontscript{CJK~Ideographic}{hani} \newfontscript{Coptic}{copt}
+\newfontscript{Cypriot~Syllabary}{cprt} \newfontscript{Cyrillic}{cyrl}
+\newfontscript{Default}{DFLT} \newfontscript{Deseret}{dsrt}
+\newfontscript{Devanagari}{deva} \newfontscript{Ethiopic}{ethi}
+\newfontscript{Georgian}{geor} \newfontscript{Glagolitic}{glag}
+\newfontscript{Gothic}{goth} \newfontscript{Greek}{grek}
+\newfontscript{Gujarati}{gujr} \newfontscript{Gurmukhi}{guru}
+\newfontscript{Hangul~Jamo}{jamo} \newfontscript{Hangul}{hang}
+\newfontscript{Hanunoo}{hano} \newfontscript{Hebrew}{hebr}
+\newfontscript{Hiragana~and~Katakana}{kana}
+\newfontscript{Javanese}{java} \newfontscript{Kannada}{knda}
+\newfontscript{Kharosthi}{khar} \newfontscript{Khmer}{khmr}
+\newfontscript{Lao}{lao~} \newfontscript{Latin}{latn}
+\newfontscript{Limbu}{limb} \newfontscript{Linear~B}{linb}
+\newfontscript{Malayalam}{mlym} \newfontscript{Math}{math}
+\newfontscript{Mongolian}{mong}
+\newfontscript{Musical~Symbols}{musc} \newfontscript{Myanmar}{mymr}
+\newfontscript{N'ko}{nko~} \newfontscript{Ogham}{ogam}
+\newfontscript{Old~Italic}{ital}
+\newfontscript{Old~Persian~Cuneiform}{xpeo}
+\newfontscript{Oriya}{orya} \newfontscript{Osmanya}{osma}
+\newfontscript{Phags-pa}{phag} \newfontscript{Phoenician}{phnx}
+\newfontscript{Runic}{runr} \newfontscript{Shavian}{shaw}
+\newfontscript{Sinhala}{sinh}
+\newfontscript{Sumero-Akkadian~Cuneiform}{xsux}
+\newfontscript{Syloti~Nagri}{sylo} \newfontscript{Syriac}{syrc}
+\newfontscript{Tagalog}{tglg} \newfontscript{Tagbanwa}{tagb}
+\newfontscript{Tai~Le}{tale} \newfontscript{Tai~Lu}{talu}
+\newfontscript{Tamil}{taml} \newfontscript{Telugu}{telu}
+\newfontscript{Thaana}{thaa} \newfontscript{Thai}{thai}
+\newfontscript{Tibetan}{tibt} \newfontscript{Tifinagh}{tfng}
+\newfontscript{Ugaritic~Cuneiform}{ugar}\newfontscript{Yi}{yi~~}
+\newfontscript{Kana}{kana}
+\newfontscript{Maths}{math}
+\newfontscript{CJK}{hani}
+\newfontlanguage{Abaza}{ABA}\newfontlanguage{Abkhazian}{ABK}
+\newfontlanguage{Adyghe}{ADY}\newfontlanguage{Afrikaans}{AFK}
+\newfontlanguage{Afar}{AFR}\newfontlanguage{Agaw}{AGW}
+\newfontlanguage{Altai}{ALT}\newfontlanguage{Amharic}{AMH}
+\newfontlanguage{Arabic}{ARA}\newfontlanguage{Aari}{ARI}
+\newfontlanguage{Arakanese}{ARK}\newfontlanguage{Assamese}{ASM}
+\newfontlanguage{Athapaskan}{ATH}\newfontlanguage{Avar}{AVR}
+\newfontlanguage{Awadhi}{AWA}\newfontlanguage{Aymara}{AYM}
+\newfontlanguage{Azeri}{AZE}\newfontlanguage{Badaga}{BAD}
+\newfontlanguage{Baghelkhandi}{BAG}\newfontlanguage{Balkar}{BAL}
+\newfontlanguage{Baule}{BAU}\newfontlanguage{Berber}{BBR}
+\newfontlanguage{Bench}{BCH}\newfontlanguage{Bible~Cree}{BCR}
+\newfontlanguage{Belarussian}{BEL}\newfontlanguage{Bemba}{BEM}
+\newfontlanguage{Bengali}{BEN}\newfontlanguage{Bulgarian}{BGR}
+\newfontlanguage{Bhili}{BHI}\newfontlanguage{Bhojpuri}{BHO}
+\newfontlanguage{Bikol}{BIK}\newfontlanguage{Bilen}{BIL}
+\newfontlanguage{Blackfoot}{BKF}\newfontlanguage{Balochi}{BLI}
+\newfontlanguage{Balante}{BLN}\newfontlanguage{Balti}{BLT}
+\newfontlanguage{Bambara}{BMB}\newfontlanguage{Bamileke}{BML}
+\newfontlanguage{Breton}{BRE}\newfontlanguage{Brahui}{BRH}
+\newfontlanguage{Braj~Bhasha}{BRI}\newfontlanguage{Burmese}{BRM}
+\newfontlanguage{Bashkir}{BSH}\newfontlanguage{Beti}{BTI}
+\newfontlanguage{Catalan}{CAT}\newfontlanguage{Cebuano}{CEB}
+\newfontlanguage{Chechen}{CHE}\newfontlanguage{Chaha~Gurage}{CHG}
+\newfontlanguage{Chattisgarhi}{CHH}\newfontlanguage{Chichewa}{CHI}
+\newfontlanguage{Chukchi}{CHK}\newfontlanguage{Chipewyan}{CHP}
+\newfontlanguage{Cherokee}{CHR}\newfontlanguage{Chuvash}{CHU}
+\newfontlanguage{Comorian}{CMR}\newfontlanguage{Coptic}{COP}
+\newfontlanguage{Cree}{CRE}\newfontlanguage{Carrier}{CRR}
+\newfontlanguage{Crimean~Tatar}{CRT}\newfontlanguage{Church~Slavonic}{CSL}
+\newfontlanguage{Czech}{CSY}\newfontlanguage{Danish}{DAN}
+\newfontlanguage{Dargwa}{DAR}\newfontlanguage{Woods~Cree}{DCR}
+\newfontlanguage{German}{DEU}
+\newfontlanguage{Dogri}{DGR}\newfontlanguage{Divehi}{DIV}
+\newfontlanguage{Djerma}{DJR}\newfontlanguage{Dangme}{DNG}
+\newfontlanguage{Dinka}{DNK}\newfontlanguage{Dungan}{DUN}
+\newfontlanguage{Dzongkha}{DZN}\newfontlanguage{Ebira}{EBI}
+\newfontlanguage{Eastern~Cree}{ECR}\newfontlanguage{Edo}{EDO}
+\newfontlanguage{Efik}{EFI}\newfontlanguage{Greek}{ELL}
+\newfontlanguage{English}{ENG}\newfontlanguage{Erzya}{ERZ}
+\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{Parsi}{FAR}
+\newfontlanguage{Persian}{FAR}
+\newfontlanguage{Finnish}{FIN}\newfontlanguage{Fijian}{FJI}
+\newfontlanguage{Flemish}{FLE}\newfontlanguage{Forest~Nenets}{FNE}
+\newfontlanguage{Fon}{FON}\newfontlanguage{Faroese}{FOS}
+\newfontlanguage{French}{FRA}\newfontlanguage{Frisian}{FRI}
+\newfontlanguage{Friulian}{FRL}\newfontlanguage{Futa}{FTA}
+\newfontlanguage{Fulani}{FUL}\newfontlanguage{Ga}{GAD}
+\newfontlanguage{Gaelic}{GAE}\newfontlanguage{Gagauz}{GAG}
+\newfontlanguage{Galician}{GAL}\newfontlanguage{Garshuni}{GAR}
+\newfontlanguage{Garhwali}{GAW}\newfontlanguage{Ge'ez}{GEZ}
+\newfontlanguage{Gilyak}{GIL}\newfontlanguage{Gumuz}{GMZ}
+\newfontlanguage{Gondi}{GON}\newfontlanguage{Greenlandic}{GRN}
+\newfontlanguage{Garo}{GRO}\newfontlanguage{Guarani}{GUA}
+\newfontlanguage{Gujarati}{GUJ}\newfontlanguage{Haitian}{HAI}
+\newfontlanguage{Halam}{HAL}\newfontlanguage{Harauti}{HAR}
+\newfontlanguage{Hausa}{HAU}\newfontlanguage{Hawaiin}{HAW}
+\newfontlanguage{Hammer-Banna}{HBN}\newfontlanguage{Hiligaynon}{HIL}
+\newfontlanguage{Hindi}{HIN}\newfontlanguage{High~Mari}{HMA}
+\newfontlanguage{Hindko}{HND}\newfontlanguage{Ho}{HO}
+\newfontlanguage{Harari}{HRI}\newfontlanguage{Croatian}{HRV}
+\newfontlanguage{Hungarian}{HUN}\newfontlanguage{Armenian}{HYE}
+\newfontlanguage{Igbo}{IBO}\newfontlanguage{Ijo}{IJO}
+\newfontlanguage{Ilokano}{ILO}\newfontlanguage{Indonesian}{IND}
+\newfontlanguage{Ingush}{ING}\newfontlanguage{Inuktitut}{INU}
+\newfontlanguage{Irish}{IRI}\newfontlanguage{Irish~Traditional}{IRT}
+\newfontlanguage{Icelandic}{ISL}\newfontlanguage{Inari~Sami}{ISM}
+\newfontlanguage{Italian}{ITA}\newfontlanguage{Hebrew}{IWR}
+\newfontlanguage{Javanese}{JAV}\newfontlanguage{Yiddish}{JII}
+\newfontlanguage{Japanese}{JAN}\newfontlanguage{Judezmo}{JUD}
+\newfontlanguage{Jula}{JUL}\newfontlanguage{Kabardian}{KAB}
+\newfontlanguage{Kachchi}{KAC}\newfontlanguage{Kalenjin}{KAL}
+\newfontlanguage{Kannada}{KAN}\newfontlanguage{Karachay}{KAR}
+\newfontlanguage{Georgian}{KAT}\newfontlanguage{Kazakh}{KAZ}
+\newfontlanguage{Kebena}{KEB}\newfontlanguage{Khutsuri~Georgian}{KGE}
+\newfontlanguage{Khakass}{KHA}\newfontlanguage{Khanty-Kazim}{KHK}
+\newfontlanguage{Khmer}{KHM}\newfontlanguage{Khanty-Shurishkar}{KHS}
+\newfontlanguage{Khanty-Vakhi}{KHV}\newfontlanguage{Khowar}{KHW}
+\newfontlanguage{Kikuyu}{KIK}\newfontlanguage{Kirghiz}{KIR}
+\newfontlanguage{Kisii}{KIS}\newfontlanguage{Kokni}{KKN}
+\newfontlanguage{Kalmyk}{KLM}\newfontlanguage{Kamba}{KMB}
+\newfontlanguage{Kumaoni}{KMN}\newfontlanguage{Komo}{KMO}
+\newfontlanguage{Komso}{KMS}\newfontlanguage{Kanuri}{KNR}
+\newfontlanguage{Kodagu}{KOD}\newfontlanguage{Korean~Old~Hangul}{KOH}
+\newfontlanguage{Konkani}{KOK}\newfontlanguage{Kikongo}{KON}
+\newfontlanguage{Komi-Permyak}{KOP}\newfontlanguage{Korean}{KOR}
+\newfontlanguage{Komi-Zyrian}{KOZ}\newfontlanguage{Kpelle}{KPL}
+\newfontlanguage{Krio}{KRI}\newfontlanguage{Karakalpak}{KRK}
+\newfontlanguage{Karelian}{KRL}\newfontlanguage{Karaim}{KRM}
+\newfontlanguage{Karen}{KRN}\newfontlanguage{Koorete}{KRT}
+\newfontlanguage{Kashmiri}{KSH}\newfontlanguage{Khasi}{KSI}
+\newfontlanguage{Kildin~Sami}{KSM}\newfontlanguage{Kui}{KUI}
+\newfontlanguage{Kulvi}{KUL}\newfontlanguage{Kumyk}{KUM}
+\newfontlanguage{Kurdish}{KUR}\newfontlanguage{Kurukh}{KUU}
+\newfontlanguage{Kuy}{KUY}\newfontlanguage{Koryak}{KYK}
+\newfontlanguage{Ladin}{LAD}\newfontlanguage{Lahuli}{LAH}
+\newfontlanguage{Lak}{LAK}\newfontlanguage{Lambani}{LAM}
+\newfontlanguage{Lao}{LAO}\newfontlanguage{Latin}{LAT}
+\newfontlanguage{Laz}{LAZ}\newfontlanguage{L-Cree}{LCR}
+\newfontlanguage{Ladakhi}{LDK}\newfontlanguage{Lezgi}{LEZ}
+\newfontlanguage{Lingala}{LIN}\newfontlanguage{Low~Mari}{LMA}
+\newfontlanguage{Limbu}{LMB}\newfontlanguage{Lomwe}{LMW}
+\newfontlanguage{Lower~Sorbian}{LSB}\newfontlanguage{Lule~Sami}{LSM}
+\newfontlanguage{Lithuanian}{LTH}\newfontlanguage{Luba}{LUB}
+\newfontlanguage{Luganda}{LUG}\newfontlanguage{Luhya}{LUH}
+\newfontlanguage{Luo}{LUO}\newfontlanguage{Latvian}{LVI}
+\newfontlanguage{Majang}{MAJ}\newfontlanguage{Makua}{MAK}
+\newfontlanguage{Malayalam~Traditional}{MAL}\newfontlanguage{Mansi}{MAN}
+\newfontlanguage{Marathi}{MAR}\newfontlanguage{Marwari}{MAW}
+\newfontlanguage{Mbundu}{MBN}\newfontlanguage{Manchu}{MCH}
+\newfontlanguage{Moose~Cree}{MCR}\newfontlanguage{Mende}{MDE}
+\newfontlanguage{Me'en}{MEN}\newfontlanguage{Mizo}{MIZ}
+\newfontlanguage{Macedonian}{MKD}\newfontlanguage{Male}{MLE}
+\newfontlanguage{Malagasy}{MLG}\newfontlanguage{Malinke}{MLN}
+\newfontlanguage{Malayalam~Reformed}{MLR}\newfontlanguage{Malay}{MLY}
+\newfontlanguage{Mandinka}{MND}\newfontlanguage{Mongolian}{MNG}
+\newfontlanguage{Manipuri}{MNI}\newfontlanguage{Maninka}{MNK}
+\newfontlanguage{Manx~Gaelic}{MNX}\newfontlanguage{Moksha}{MOK}
+\newfontlanguage{Moldavian}{MOL}\newfontlanguage{Mon}{MON}
+\newfontlanguage{Moroccan}{MOR}\newfontlanguage{Maori}{MRI}
+\newfontlanguage{Maithili}{MTH}\newfontlanguage{Maltese}{MTS}
+\newfontlanguage{Mundari}{MUN}\newfontlanguage{Naga-Assamese}{NAG}
+\newfontlanguage{Nanai}{NAN}\newfontlanguage{Naskapi}{NAS}
+\newfontlanguage{N-Cree}{NCR}\newfontlanguage{Ndebele}{NDB}
+\newfontlanguage{Ndonga}{NDG}\newfontlanguage{Nepali}{NEP}
+\newfontlanguage{Newari}{NEW}\newfontlanguage{Nagari}{NGR}
+\newfontlanguage{Norway~House~Cree}{NHC}\newfontlanguage{Nisi}{NIS}
+\newfontlanguage{Niuean}{NIU}\newfontlanguage{Nkole}{NKL}
+\newfontlanguage{N'ko}{NKO}\newfontlanguage{Dutch}{NLD}
+\newfontlanguage{Nogai}{NOG}\newfontlanguage{Norwegian}{NOR}
+\newfontlanguage{Northern~Sami}{NSM}\newfontlanguage{Northern~Tai}{NTA}
+\newfontlanguage{Esperanto}{NTO}\newfontlanguage{Nynorsk}{NYN}
+\newfontlanguage{Oji-Cree}{OCR}\newfontlanguage{Ojibway}{OJB}
+\newfontlanguage{Oriya}{ORI}\newfontlanguage{Oromo}{ORO}
+\newfontlanguage{Ossetian}{OSS}\newfontlanguage{Palestinian~Aramaic}{PAA}
+\newfontlanguage{Pali}{PAL}\newfontlanguage{Punjabi}{PAN}
+\newfontlanguage{Palpa}{PAP}\newfontlanguage{Pashto}{PAS}
+\newfontlanguage{Polytonic~Greek}{PGR}\newfontlanguage{Pilipino}{PIL}
+\newfontlanguage{Palaung}{PLG}\newfontlanguage{Polish}{PLK}
+\newfontlanguage{Provencal}{PRO}\newfontlanguage{Portuguese}{PTG}
+\newfontlanguage{Chin}{QIN}\newfontlanguage{Rajasthani}{RAJ}
+\newfontlanguage{R-Cree}{RCR}\newfontlanguage{Russian~Buriat}{RBU}
+\newfontlanguage{Riang}{RIA}\newfontlanguage{Rhaeto-Romanic}{RMS}
+\newfontlanguage{Romanian}{ROM}\newfontlanguage{Romany}{ROY}
+\newfontlanguage{Rusyn}{RSY}\newfontlanguage{Ruanda}{RUA}
+\newfontlanguage{Russian}{RUS}\newfontlanguage{Sadri}{SAD}
+\newfontlanguage{Sanskrit}{SAN}\newfontlanguage{Santali}{SAT}
+\newfontlanguage{Sayisi}{SAY}\newfontlanguage{Sekota}{SEK}
+\newfontlanguage{Selkup}{SEL}\newfontlanguage{Sango}{SGO}
+\newfontlanguage{Shan}{SHN}\newfontlanguage{Sibe}{SIB}
+\newfontlanguage{Sidamo}{SID}\newfontlanguage{Silte~Gurage}{SIG}
+\newfontlanguage{Skolt~Sami}{SKS}\newfontlanguage{Slovak}{SKY}
+\newfontlanguage{Slavey}{SLA}\newfontlanguage{Slovenian}{SLV}
+\newfontlanguage{Somali}{SML}\newfontlanguage{Samoan}{SMO}
+\newfontlanguage{Sena}{SNA}\newfontlanguage{Sindhi}{SND}
+\newfontlanguage{Sinhalese}{SNH}\newfontlanguage{Soninke}{SNK}
+\newfontlanguage{Sodo~Gurage}{SOG}\newfontlanguage{Sotho}{SOT}
+\newfontlanguage{Albanian}{SQI}\newfontlanguage{Serbian}{SRB}
+\newfontlanguage{Saraiki}{SRK}\newfontlanguage{Serer}{SRR}
+\newfontlanguage{South~Slavey}{SSL}\newfontlanguage{Southern~Sami}{SSM}
+\newfontlanguage{Suri}{SUR}\newfontlanguage{Svan}{SVA}
+\newfontlanguage{Swedish}{SVE}\newfontlanguage{Swadaya~Aramaic}{SWA}
+\newfontlanguage{Swahili}{SWK}\newfontlanguage{Swazi}{SWZ}
+\newfontlanguage{Sutu}{SXT}\newfontlanguage{Syriac}{SYR}
+\newfontlanguage{Tabasaran}{TAB}\newfontlanguage{Tajiki}{TAJ}
+\newfontlanguage{Tamil}{TAM}\newfontlanguage{Tatar}{TAT}
+\newfontlanguage{TH-Cree}{TCR}\newfontlanguage{Telugu}{TEL}
+\newfontlanguage{Tongan}{TGN}\newfontlanguage{Tigre}{TGR}
+\newfontlanguage{Tigrinya}{TGY}\newfontlanguage{Thai}{THA}
+\newfontlanguage{Tahitian}{THT}\newfontlanguage{Tibetan}{TIB}
+\newfontlanguage{Turkmen}{TKM}\newfontlanguage{Temne}{TMN}
+\newfontlanguage{Tswana}{TNA}\newfontlanguage{Tundra~Nenets}{TNE}
+\newfontlanguage{Tonga}{TNG}\newfontlanguage{Todo}{TOD}
+\newfontlanguage{Tsonga}{TSG}\newfontlanguage{Turoyo~Aramaic}{TUA}
+\newfontlanguage{Tulu}{TUL}\newfontlanguage{Tuvin}{TUV}
+\newfontlanguage{Twi}{TWI}\newfontlanguage{Udmurt}{UDM}
+\newfontlanguage{Ukrainian}{UKR}\newfontlanguage{Urdu}{URD}
+\newfontlanguage{Upper~Sorbian}{USB}\newfontlanguage{Uyghur}{UYG}
+\newfontlanguage{Uzbek}{UZB}\newfontlanguage{Venda}{VEN}
+\newfontlanguage{Vietnamese}{VIT}\newfontlanguage{Wa}{WA}
+\newfontlanguage{Wagdi}{WAG}\newfontlanguage{West-Cree}{WCR}
+\newfontlanguage{Welsh}{WEL}\newfontlanguage{Wolof}{WLF}
+\newfontlanguage{Tai~Lue}{XBD}\newfontlanguage{Xhosa}{XHS}
+\newfontlanguage{Yakut}{YAK}\newfontlanguage{Yoruba}{YBA}
+\newfontlanguage{Y-Cree}{YCR}\newfontlanguage{Yi~Classic}{YIC}
+\newfontlanguage{Yi~Modern}{YIM}\newfontlanguage{Chinese~Hong~Kong}{ZHH}
+\newfontlanguage{Chinese~Phonetic}{ZHP}
+\newfontlanguage{Chinese~Simplified}{ZHS}
+\newfontlanguage{Chinese~Traditional}{ZHT}\newfontlanguage{Zande}{ZND}
+\newfontlanguage{Zulu}{ZUL}
+\keys_define:nn {fontspec}
+ {
+ Language / Turkish .code:n =
+ {
+ \fontspec_check_lang:nTF {TRK} {
+ \int_set:Nn \l_fontspec_language_int {\l_fontspec_strnum_int}
+ \fontspec_update_fontid:n {+lang=Turkish}
+ \tl_set:Nn \l_fontspec_lang_tl {TRK}
+ }{
+ \fontspec_check_lang:nTF {TUR} {
+ \int_set:Nn \l_fontspec_language_int {\l_fontspec_strnum_int}
+ \fontspec_update_fontid:n {+lang=Turkish}
+ \tl_set:Nn \l_fontspec_lang_tl {TUR}
+ }{
+ \fontspec_warning:nx {language-not-exist} {Turkish}
+ \keys_set:nn {fontspec} {Language=Default}
+ }
+ }
+ }
+ }
+\keys_define:nn {fontspec}
+ {
+ Language / Default .code:n =
+ {
+ \fontspec_update_fontid:n {+lang=dflt}
+ \tl_set:Nn \l_fontspec_lang_tl {DFLT}
+ \int_zero:N \l_fontspec_language_int
+ }
+ }
+\keys_define:nn {fontspec}
+ {
+ RawFeature .code:n =
+ {
+ \fontspec_update_fontid:n {+Raw:#1}
+ \fontspec_update_featstr:n{#1}
+ }
+ }
+\providecommand*{\sidefault}{si}
+\DeclareRobustCommand{\sishape}{
+ \not@math@alphabet\sishape\relax
+ \fontshape\sidefault\selectfont
+}
+\DeclareTextFontCommand{\textsi}{\sishape}
+\cs_new:Nn \fontspec_blend_shape:nnn {
+ \bool_if:nTF
+ {
+ \str_if_eq_p:xx {\f@shape} {#2} &&
+ \cs_if_exist_p:c {\f@encoding/\f@family/\f@series/#3}
+ }
+ { \fontshape{#3}\selectfont }
+ { \fontshape{#1}\selectfont }
+}
+\DeclareRobustCommand \itshape {
+ \not@math@alphabet\itshape\mathit
+ \fontspec_blend_shape:nnn\itdefault\scdefault\sidefault
+}
+\DeclareRobustCommand \slshape {
+ \not@math@alphabet\slshape\relax
+ \fontspec_blend_shape:nnn\sldefault\scdefault\sidefault
+}
+\DeclareRobustCommand \scshape {
+ \not@math@alphabet\scshape\relax
+ \fontspec_blend_shape:nnn\scdefault\itdefault\sidefault
+}
+\DeclareRobustCommand \upshape {
+ \not@math@alphabet\upshape\relax
+ \fontspec_blend_shape:nnn\updefault\sidefault\scdefault
+}
+\@ifpackageloaded{euler}{
+ \bool_set_true:N \g_fontspec_package_euler_loaded_bool
+}{
+ \bool_set_false:N \g_fontspec_package_euler_loaded_bool
+}
+\cs_set:Nn \fontspec_setup_maths: {
+ \@ifpackageloaded{euler}{
+ \bool_if:NTF \g_fontspec_package_euler_loaded_bool {
+ \bool_set_true:N \g_fontspec_math_euler_bool
+ }{
+ \fontspec_error:n {euler-too-late}
+ }
+ }{}
+ \@ifpackageloaded{lucbmath}{\bool_set_true:N \g_fontspec_math_lucida_bool}{}
+ \@ifpackageloaded{lucidabr}{\bool_set_true:N \g_fontspec_math_lucida_bool}{}
+ \@ifpackageloaded{lucimatx}{\bool_set_true:N \g_fontspec_math_lucida_bool}{}
+ \DeclareSymbolFont{legacymaths}{OT1}{cmr}{m}{n}
+ \SetSymbolFont{legacymaths}{bold}{OT1}{cmr}{bx}{n}
+ \DeclareMathAccent{\acute} {\mathalpha}{legacymaths}{19}
+ \DeclareMathAccent{\grave} {\mathalpha}{legacymaths}{18}
+ \DeclareMathAccent{\ddot} {\mathalpha}{legacymaths}{127}
+ \DeclareMathAccent{\tilde} {\mathalpha}{legacymaths}{126}
+ \DeclareMathAccent{\bar} {\mathalpha}{legacymaths}{22}
+ \DeclareMathAccent{\breve} {\mathalpha}{legacymaths}{21}
+ \DeclareMathAccent{\check} {\mathalpha}{legacymaths}{20}
+ \DeclareMathAccent{\hat} {\mathalpha}{legacymaths}{94} % too bad, euler
+ \DeclareMathAccent{\dot} {\mathalpha}{legacymaths}{95}
+ \DeclareMathAccent{\mathring}{\mathalpha}{legacymaths}{23}
+ \group_begin:
+ \mathchardef\@tempa="603A \relax
+ \ifx\colon\@tempa
+ \DeclareMathSymbol{\colon}{\mathpunct}{legacymaths}{58}
+ \fi
+ \group_end:
+ \bool_if:NF \g_fontspec_math_euler_bool {
+ \DeclareMathSymbol{!}{\mathclose}{legacymaths}{33}
+ \DeclareMathSymbol{:}{\mathrel} {legacymaths}{58}
+ \DeclareMathSymbol{;}{\mathpunct}{legacymaths}{59}
+ \DeclareMathSymbol{?}{\mathclose}{legacymaths}{63}
+ \bool_if:NF \g_fontspec_math_lucida_bool {
+ \DeclareMathSymbol{0}{\mathalpha}{legacymaths}{`0}
+ \DeclareMathSymbol{1}{\mathalpha}{legacymaths}{`1}
+ \DeclareMathSymbol{2}{\mathalpha}{legacymaths}{`2}
+ \DeclareMathSymbol{3}{\mathalpha}{legacymaths}{`3}
+ \DeclareMathSymbol{4}{\mathalpha}{legacymaths}{`4}
+ \DeclareMathSymbol{5}{\mathalpha}{legacymaths}{`5}
+ \DeclareMathSymbol{6}{\mathalpha}{legacymaths}{`6}
+ \DeclareMathSymbol{7}{\mathalpha}{legacymaths}{`7}
+ \DeclareMathSymbol{8}{\mathalpha}{legacymaths}{`8}
+ \DeclareMathSymbol{9}{\mathalpha}{legacymaths}{`9}
+ \DeclareMathSymbol{\Gamma}{\mathalpha}{legacymaths}{0}
+ \DeclareMathSymbol{\Delta}{\mathalpha}{legacymaths}{1}
+ \DeclareMathSymbol{\Theta}{\mathalpha}{legacymaths}{2}
+ \DeclareMathSymbol{\Lambda}{\mathalpha}{legacymaths}{3}
+ \DeclareMathSymbol{\Xi}{\mathalpha}{legacymaths}{4}
+ \DeclareMathSymbol{\Pi}{\mathalpha}{legacymaths}{5}
+ \DeclareMathSymbol{\Sigma}{\mathalpha}{legacymaths}{6}
+ \DeclareMathSymbol{\Upsilon}{\mathalpha}{legacymaths}{7}
+ \DeclareMathSymbol{\Phi}{\mathalpha}{legacymaths}{8}
+ \DeclareMathSymbol{\Psi}{\mathalpha}{legacymaths}{9}
+ \DeclareMathSymbol{\Omega}{\mathalpha}{legacymaths}{10}
+ \DeclareMathSymbol{+}{\mathbin}{legacymaths}{43}
+ \DeclareMathSymbol{=}{\mathrel}{legacymaths}{61}
+ \DeclareMathDelimiter{(}{\mathopen} {legacymaths}{40}{largesymbols}{0}
+ \DeclareMathDelimiter{)}{\mathclose}{legacymaths}{41}{largesymbols}{1}
+ \DeclareMathDelimiter{[}{\mathopen} {legacymaths}{91}{largesymbols}{2}
+ \DeclareMathDelimiter{]}{\mathclose}{legacymaths}{93}{largesymbols}{3}
+ \DeclareMathDelimiter{/}{\mathord}{legacymaths}{47}{largesymbols}{14}
+ \DeclareMathSymbol{\mathdollar}{\mathord}{legacymaths}{36}
+ }
+ }
+ \DeclareSymbolFont{operators}\g_fontspec_encoding_tl\g_fontspec_mathrm_tl\mddefault\updefault
+ \SetSymbolFont{operators}{normal}\g_fontspec_encoding_tl\g_fontspec_mathrm_tl\mddefault\updefault
+ \SetMathAlphabet\mathrm{normal}\g_fontspec_encoding_tl\g_fontspec_mathrm_tl\mddefault\updefault
+ \SetMathAlphabet\mathit{normal}\g_fontspec_encoding_tl\g_fontspec_mathrm_tl\mddefault\itdefault
+ \SetMathAlphabet\mathbf{normal}\g_fontspec_encoding_tl\g_fontspec_mathrm_tl\bfdefault\updefault
+ \SetMathAlphabet\mathsf{normal}\g_fontspec_encoding_tl\g_fontspec_mathsf_tl\mddefault\updefault
+ \SetMathAlphabet\mathtt{normal}\g_fontspec_encoding_tl\g_fontspec_mathtt_tl\mddefault\updefault
+ \SetSymbolFont{operators}{bold}\g_fontspec_encoding_tl\g_fontspec_mathrm_tl\bfdefault\updefault
+ \tl_if_empty:NTF \g_fontspec_bfmathrm_tl {
+ \SetMathAlphabet\mathrm{bold}\g_fontspec_encoding_tl\g_fontspec_mathrm_tl\bfdefault\updefault
+ \SetMathAlphabet\mathit{bold}\g_fontspec_encoding_tl\g_fontspec_mathrm_tl\bfdefault\itdefault
+ }{
+ \SetMathAlphabet\mathrm{bold}\g_fontspec_encoding_tl\g_fontspec_bfmathrm_tl\mddefault\updefault
+ \SetMathAlphabet\mathbf{bold}\g_fontspec_encoding_tl\g_fontspec_bfmathrm_tl\bfdefault\updefault
+ \SetMathAlphabet\mathit{bold}\g_fontspec_encoding_tl\g_fontspec_bfmathrm_tl\mddefault\itdefault
+ }
+ \SetMathAlphabet\mathsf{bold}\g_fontspec_encoding_tl\g_fontspec_mathsf_tl\bfdefault\updefault
+ \SetMathAlphabet\mathtt{bold}\g_fontspec_encoding_tl\g_fontspec_mathtt_tl\bfdefault\updefault
+}
+\cs_new:Nn \fontspec_maybe_setup_maths: {
+ \@ifpackageloaded{anttor}{
+ \ifx\define@antt@mathversions a\bool_set_false:N \g_fontspec_math_bool\fi}{}
+ \@ifpackageloaded{arev}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{eulervm}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{mathdesign}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{concmath}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{cmbright}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{mathesf}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{gfsartemisia}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{gfsneohellenic}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{iwona}{
+ \ifx\define@iwona@mathversions a\bool_set_false:N \g_fontspec_math_bool\fi}{}
+ \@ifpackageloaded{kpfonts}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{kmath}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{kurier}{
+ \ifx\define@kurier@mathversions a\bool_set_false:N \g_fontspec_math_bool\fi}{}
+ \@ifpackageloaded{fouriernc}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{fourier}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{lmodern}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{mathpazo}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{mathptmx}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{MinionPro}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{unicode-math}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{breqn}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \bool_if:NT \g_fontspec_math_bool {
+ \fontspec_info:n {setup-math}
+ \fontspec_setup_maths:
+ }
+}
+\AtBeginDocument{\fontspec_maybe_setup_maths:}
+\bool_if:NT \g_fontspec_cfg_bool {
+ \InputIfFileExists{fontspec.cfg}
+ {}
+ {\typeout{No~ fontspec.cfg~ file~ found;~ no~ configuration~ loaded.}}
+}
+\tl_set:Nn \zf@enc { \g_fontspec_encoding_tl }
+\tl_set:Nn \zf@family { \l_fontspec_family_tl }
+\tl_set:Nn \zf@basefont { \l_fontspec_font }
+\cs_set_eq:NN \zf@fontspec \fontspec_select:nn
+\ExplSyntaxOff
+%%
+%% Copyright 2004--2011 Will Robertson <wspr81@gmail.com>
+%% Copyright 2009--2010 Khaled Hosny <khaledhosny@eglug.org>
+%%
+%% Distributable under the LaTeX Project Public License,
+%% version 1.3c or higher (your choice). The latest version of
+%% this license is at: http://www.latex-project.org/lppl.txt
+%%
+%% This work is "author-maintained" by Will Robertson.
+%%
+%% This work consists of this file fontspec.dtx
+%% and the derived files fontspec.sty,
+%% fontspec.lua,
+%% fontspec.cfg,
+%% fontspec-xetex.tex,
+%% fontspec-luatex.tex,
+%% and fontspec.pdf.
+%%
+%%
+%% End of file `fontspec-luatex.sty'.
diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec-patches.sty b/Master/texmf-dist/tex/latex/fontspec/fontspec-patches.sty
index 4d0c28169ff..72b3dfc6bd4 100644
--- a/Master/texmf-dist/tex/latex/fontspec/fontspec-patches.sty
+++ b/Master/texmf-dist/tex/latex/fontspec/fontspec-patches.sty
@@ -14,7 +14,7 @@
%%
%%
\ProvidesPackage{fontspec-patches}
- [2011/02/26 v2.1f Advanced font selection for XeLaTeX/LuaLaTeX]
+ [2011/09/13 v2.2 Advanced font selection for XeLaTeX/LuaLaTeX]
\ExplSyntaxOn
@@ -37,21 +37,21 @@
\hyphenchar\font
\fi}{}{}}
\def\xlx@defaulthyphenchar{`\-}
-\cs_new:Npn \fontspec_visible_space: {
+\cs_new:Nn \fontspec_visible_space: {
\font_glyph_if_exist:NnTF \font {"2423}
{\char"2423\relax}
{\fontspec_visible_space_fallback:}
}
-\cs_new:Npn \fontspec_visible_space_fallback: {
+\cs_new:Nn \fontspec_visible_space_fallback: {
{
- \usefont{\zf@enc}{lmtt}{\f@series}{\f@shape}
+ \usefont{\g_fontspec_encoding_tl}{lmtt}{\f@series}{\f@shape}
\textvisiblespace
}
}
\group_begin:
-\char_make_active:n{"20}%
+\char_set_catcode_active:n{"20}%
\cs_gset:Npn\fontspec_print_visible_spaces:{%
-\char_make_active:n{"20}%
+\char_set_catcode_active:n{"20}%
\cs_set_eq:NN^^20\fontspec_visible_space:%
}%
\group_end:
@@ -101,6 +101,14 @@
\cs_set_eq:NN \lst@visiblespace \fontspec_visible_space:
}{}
}
+\RenewDocumentCommand \oldstylenums {m}
+ {
+ { \addfontfeature{Numbers=OldStyle} #1 }
+ }
+\NewDocumentCommand \liningnums {m}
+ {
+ { \addfontfeature{Numbers=Lining} #1 }
+ }
%%
%% Copyright 2004--2011 Will Robertson <wspr81@gmail.com>
%% Copyright 2009--2010 Khaled Hosny <khaledhosny@eglug.org>
diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty b/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
new file mode 100644
index 00000000000..4fab045b766
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
@@ -0,0 +1,2044 @@
+%%
+%% This is file `fontspec-xetex.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% fontspec.dtx (with options: `fontspec,xetexx')
+%%
+%% _________________________________________
+%% The fontspec package for XeLaTeX/LuaLaTeX
+%% (C) 2004--2011 Will Robertson and Khaled Hosny
+%%
+%% License information appended.
+%%
+%%
+\ProvidesPackage{fontspec-xetex}
+ [2011/09/13 v2.2 Advanced font selection for XeLaTeX/LuaLaTeX]
+
+
+\ExplSyntaxOn
+\tl_set:Nn \g_fontspec_encoding_tl {EU1}
+\tl_set:Nn \rmdefault {lmr}
+\tl_set:Nn \sfdefault {lmss}
+\tl_set:Nn \ttdefault {lmtt}
+\RequirePackage[\g_fontspec_encoding_tl]{fontenc}
+\tl_set_eq:NN \UTFencname \g_fontspec_encoding_tl % for xunicode
+\tl_set_eq:NN \cyrillicencoding \g_fontspec_encoding_tl
+\tl_set_eq:NN \latinencoding \g_fontspec_encoding_tl
+\tl_put_right:Nn \document {
+ \tl_set_eq:NN \cyrillicencoding \g_fontspec_encoding_tl
+ \tl_set_eq:NN \latinencoding \g_fontspec_encoding_tl
+}
+\RequirePackage{xunicode}
+\DeclareDocumentCommand \fontspec { O{} m } {
+ \fontencoding {\g_fontspec_encoding_tl}
+ \fontspec_set_family:Nnn \f@family {#1}{#2}
+ \selectfont
+ \ignorespaces
+}
+\DeclareDocumentCommand \setmainfont { O{} m } {
+ \fontspec_set_family:Nnn \rmdefault {#1}{#2}
+ \normalfont
+}
+\DeclareDocumentCommand \setsansfont { O{} m } {
+ \fontspec_set_family:Nnn \sfdefault {#1}{#2}
+ \normalfont
+}
+\DeclareDocumentCommand \setmonofont { O{} m } {
+ \fontspec_set_family:Nnn \ttdefault {#1}{#2}
+ \normalfont
+}
+\cs_set_eq:NN \setromanfont \setmainfont
+\DeclareDocumentCommand \setmathrm { O{} m } {
+ \fontspec_set_family:Nnn \g_fontspec_mathrm_tl {#1}{#2}
+}
+\DeclareDocumentCommand \setboldmathrm { O{} m } {
+ \fontspec_set_family:Nnn \g_fontspec_bfmathrm_tl {#1}{#2}
+}
+\DeclareDocumentCommand \setmathsf { O{} m } {
+ \fontspec_set_family:Nnn \g_fontspec_mathsf_tl {#1}{#2}
+}
+\DeclareDocumentCommand \setmathtt { O{} m } {
+ \fontspec_set_family:Nnn \g_fontspec_mathtt_tl {#1}{#2}
+}
+\@onlypreamble\setmathrm
+\@onlypreamble\setboldmathrm
+\@onlypreamble\setmathsf
+\@onlypreamble\setmathtt
+\def\g_fontspec_mathrm_tl{\rmdefault}
+\def\g_fontspec_mathsf_tl{\sfdefault}
+\def\g_fontspec_mathtt_tl{\ttdefault}
+\tl_clear:N \g_fontspec_bfmathrm_tl
+\DeclareDocumentCommand \newfontfamily { m O{} m } {
+ \fontspec_select:nn{#2}{#3}
+ \use:x {
+ \exp_not:N \DeclareRobustCommand \exp_not:N #1 {
+ \exp_not:N \fontencoding {\g_fontspec_encoding_tl}
+ \exp_not:N \fontfamily {\l_fontspec_family_tl} \exp_not:N \selectfont
+ }
+ }
+}
+\DeclareDocumentCommand \newfontface { m O{} m } {
+ \newfontfamily #1 [ BoldFont={},ItalicFont={},SmallCapsFont={},#2 ] {#3}
+}
+\DeclareDocumentCommand \defaultfontfeatures {m} {
+ \tl_set:Nn \g_fontspec_default_fontopts_tl {#1,}
+}
+\tl_clear:N \g_fontspec_default_fontopts_tl
+\DeclareDocumentCommand \addfontfeatures {m} {
+ \ifcsname zf@family@fontdef\f@family\endcsname
+ \group_begin:
+ \tl_clear:N \g_fontspec_default_fontopts_tl
+ \use:x {
+ \exp_not:N\fontspec_select:nn
+ {\csname zf@family@options\f@family\endcsname,#1}
+ {\csname zf@family@fontname\f@family\endcsname}
+ }
+ \group_end:
+ \fontfamily\l_fontspec_family_tl\selectfont
+ \else
+ \fontspec_warning:n {addfontfeatures-ignored}
+ \fi
+ \ignorespaces
+}
+\cs_set_eq:NN \addfontfeature \addfontfeatures
+\DeclareDocumentCommand \newfontfeature {mm}
+ {
+ \keys_define:nn { fontspec }
+ {
+ #1 .code:n = {
+ \fontspec_update_fontid:n {+zf-#1}
+ \fontspec_update_featstr:n {#2}
+ }
+ }
+ }
+\DeclareDocumentCommand \newAATfeature {mmmm} {
+ \keys_if_exist:nnF { fontspec } {#1}
+ { \fontspec_define_font_feature:n {#1} }
+ \keys_if_choice_exist:nnnT {fontspec} {#1} {#2}
+ { \fontspec_warning:nxx {feature-option-overwrite}{#1}{#2} }
+ \fontspec_define_feature_option:nnnnn{#1}{#2}{#3}{#4}{}
+}
+\DeclareDocumentCommand \newICUfeature {mmm} {
+ \keys_if_exist:nnF { fontspec / options } {#1}
+ { \fontspec_define_font_feature:n{#1} }
+ \keys_if_choice_exist:nnnT {fontspec} {#1} {#2}
+ { \fontspec_warning:nxx {feature-option-overwrite}{#1}{#2} }
+ \fontspec_define_feature_option:nnnnn{#1}{#2}{}{}{#3}
+}
+\cs_set_eq:NN \newopentypefeature \newICUfeature
+\DeclareDocumentCommand \aliasfontfeature {mm}
+ {
+ \keys_if_exist:nnTF {fontspec} {#1}
+ {
+ \keys_define:nn {fontspec}
+ { #2 .code:n = { \keys_set:nn {fontspec} { #1 = {##1} } } }
+ }
+ {
+ \keys_if_exist:nnTF {fontspec-preparse} {#1}
+ {
+ \keys_define:nn {fontspec-preparse}
+ { #2 .code:n = { \keys_set:nn {fontspec-preparse} { #1 = {##1} } } }
+ }
+ {
+ \keys_if_exist:nnTF {fontspec-preparse-external} {#1}
+ {
+ \keys_define:nn {fontspec-preparse-external}
+ {
+ #2 .code:n =
+ { \keys_set:nn {fontspec-preparse-external} { #1 = {##1} } }
+ }
+ }
+ { \fontspec_warning:nx {rename-feature-not-exist} {#1} }
+ }
+ }
+ }
+\DeclareDocumentCommand \aliasfontfeatureoption {mmm}
+ {
+ \cs_set_eq:cc { \c_keys_code_root_tl fontspec/#1/#3 }
+ { \c_keys_code_root_tl fontspec/#1/#2 }
+ }
+\DeclareDocumentCommand \newfontscript {mm}
+{
+ \fontspec_new_script:nn {#1} {#2}
+ \fontspec_new_script:nn {#2} {#2}
+}
+\keys_define:nn { fontspec } { Script .choice: }
+\cs_new:Nn \fontspec_new_script:nn
+{
+ \keys_define:nn { fontspec } { Script / #1 .code:n =
+ \fontspec_check_script:nTF {#2} {
+ \fontspec_update_fontid:n {+script=#1}
+ \tl_set:Nn \l_fontspec_script_tl {#2}
+ \int_set:Nn \l_fontspec_script_int {\l_fontspec_strnum_int}
+ }{
+ \fontspec_check_script:nTF {latn} {
+ \fontspec_warning:nx {script-not-exist-latn} {#1}
+ \keys_set:nn {fontspec} {Script=Latin}
+ }{
+ \fontspec_warning:nx {script-not-exist} {#1}
+ }
+ }
+ }
+}
+\DeclareDocumentCommand \newfontlanguage {mm}
+{
+ \fontspec_new_lang:nn {#1} {#2}
+ \fontspec_new_lang:nn {#2} {#2}
+}
+\keys_define:nn { fontspec } { Language .choice: }
+\cs_new:Nn \fontspec_new_lang:nn
+{
+ \keys_define:nn { fontspec } { Language / #1 .code:n =
+ \fontspec_check_lang:nTF {#2} {
+ \fontspec_update_fontid:n {+lang=#1}
+ \tl_set:Nn \l_fontspec_lang_tl {#2}
+ \int_set:Nn \l_fontspec_language_int {\l_fontspec_strnum_int}
+ }{
+ \fontspec_warning:nx {language-not-exist} {#1}
+ \keys_set:nn { fontspec } { Language = Default }
+ }
+ }
+}
+\DeclareDocumentCommand \DeclareFontsExtensions {m}
+{
+ \tl_set:Nn \l_fontspec_extensions_clist { #1 }
+ \tl_remove_all:Nn \l_fontspec_extensions_clist {~}
+}
+\DeclareFontsExtensions{.otf,.ttf,.OTF,.TTF,.ttc,.TTC,.dfont}
+\prg_new_conditional:Nnn \fontspec_if_fontspec_font: {TF,T,F} {
+ \cs_if_exist:cTF {g_fontspec_ \f@family _prop} {
+ \prg_return_true:
+ }{
+ \prg_return_false:
+ }
+}
+\prg_new_conditional:Nnn \fontspec_if_aat_feature:nn {TF,T,F} {
+ \fontspec_if_fontspec_font:TF {
+ \fontspec_font_set:Nnn \l_fontspec_font {\use:c{zf@family@fontdef\f@family}} {\f@size pt}
+ \bool_if:NTF \l_fontspec_atsui_bool {
+ \fontspec_make_AAT_feature_string:nnTF {#1}{#2}
+ \prg_return_true: \prg_return_false:
+ }{
+ \prg_return_false:
+ }
+ }{
+ \prg_return_false:
+ }
+}
+\prg_new_conditional:Nnn \fontspec_if_opentype: {TF,T,F} {
+ \fontspec_if_fontspec_font:TF {
+ \fontspec_font_set:Nnn \l_fontspec_font {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt}
+ \fontspec_set_font_type:
+ \bool_if:NTF \l_fontspec_icu_bool \prg_return_true: \prg_return_false:
+ }{
+ \prg_return_false:
+ }
+}
+\prg_new_conditional:Nnn \fontspec_if_feature:n {TF,T,F} {
+ \fontspec_if_fontspec_font:TF {
+ \fontspec_font_set:Nnn \l_fontspec_font {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt}
+ \fontspec_set_font_type:
+ \bool_if:NTF \l_fontspec_icu_bool {
+ \int_set:Nv \l_fontspec_script_int {g_fontspec_script_num_(\f@family)_tl}
+ \int_set:Nv \l_fontspec_language_int {g_fontspec_lang_num_(\f@family)_tl}
+ \tl_set:Nv \l_fontspec_script_tl {g_fontspec_script_(\f@family)_tl}
+ \tl_set:Nv \l_fontspec_lang_tl {g_fontspec_lang_(\f@family)_tl}
+ \fontspec_check_ot_feat:nTF {#1} {\prg_return_true:} {\prg_return_false:}
+ }{
+ \prg_return_false:
+ }
+ }{
+ \prg_return_false:
+ }
+}
+\prg_new_conditional:Nnn \fontspec_if_feature:nnn {TF,T,F} {
+ \fontspec_if_fontspec_font:TF {
+ \fontspec_font_set:Nnn \l_fontspec_font {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt}
+ \fontspec_set_font_type:
+ \bool_if:NTF \l_fontspec_icu_bool {
+ \fontspec_iv_str_to_num:Nn \l_fontspec_script_int {#1}
+ \fontspec_iv_str_to_num:Nn \l_fontspec_language_int {#2}
+ \fontspec_check_ot_feat:nTF {#3} \prg_return_true: \prg_return_false:
+ }{
+ \prg_return_false:
+ }
+ }{
+ \prg_return_false:
+ }
+}
+\prg_new_conditional:Nnn \fontspec_if_script:n {TF,T,F} {
+ \fontspec_if_fontspec_font:TF {
+ \fontspec_font_set:Nnn \l_fontspec_font {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt}
+ \fontspec_set_font_type:
+ \bool_if:NTF \l_fontspec_icu_bool {
+ \fontspec_check_script:nTF {#1} \prg_return_true: \prg_return_false:
+ }{
+ \prg_return_false:
+ }
+ }{
+ \prg_return_false:
+ }
+}
+\prg_new_conditional:Nnn \fontspec_if_language:n {TF,T,F} {
+ \fontspec_if_fontspec_font:TF {
+ \fontspec_font_set:Nnn \l_fontspec_font {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt}
+ \fontspec_set_font_type:
+ \bool_if:NTF \l_fontspec_icu_bool {
+ \tl_set:Nv \l_fontspec_script_tl {g_fontspec_script_(\f@family)_tl}
+ \int_set:Nv \l_fontspec_script_int {g_fontspec_script_num_(\f@family)_tl}
+ \fontspec_check_lang:nTF {#1} \prg_return_true: \prg_return_false:
+ }{
+ \prg_return_false:
+ }
+ }{
+ \prg_return_false:
+ }
+}
+\prg_new_conditional:Nnn \fontspec_if_language:nn {TF,T,F} {
+ \fontspec_if_fontspec_font:TF {
+ \fontspec_font_set:Nnn \l_fontspec_font {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt}
+ \fontspec_set_font_type:
+ \bool_if:NTF \l_fontspec_icu_bool {
+ \tl_set:Nn \l_fontspec_script_tl {#1}
+ \fontspec_iv_str_to_num:Nn \l_fontspec_script_int {#1}
+ \fontspec_check_lang:nTF {#2} \prg_return_true: \prg_return_false:
+ }{
+ \prg_return_false:
+ }
+ }{
+ \prg_return_false:
+ }
+}
+\prg_new_conditional:Nnn \fontspec_if_current_script:n {TF,T,F} {
+ \fontspec_if_fontspec_font:TF {
+ \fontspec_font_set:Nnn \l_fontspec_font {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt}
+ \fontspec_set_font_type:
+ \bool_if:NTF \l_fontspec_icu_bool {
+ \str_if_eq:nvTF {#1} {g_fontspec_script_(\f@family)_tl}
+ {\prg_return_true:} {\prg_return_false:}
+ }{
+ \prg_return_false:
+ }
+ }{
+ \prg_return_false:
+ }
+}
+\prg_new_conditional:Nnn \fontspec_if_current_language:n {TF,T,F} {
+ \fontspec_if_fontspec_font:TF {
+ \fontspec_font_set:Nnn \l_fontspec_font {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt}
+ \fontspec_set_font_type:
+ \bool_if:NTF \l_fontspec_icu_bool {
+ \str_if_eq:nvTF {#1} {g_fontspec_lang_(\f@family)_tl}
+ {\prg_return_true:} {\prg_return_false:}
+ }{
+ \prg_return_false:
+ }
+ }{
+ \prg_return_false:
+ }
+}
+\cs_new:Nn \fontspec_set_family:Nnn {
+ \fontspec_select:nn {#2}{#3}
+ \tl_set_eq:NN #1 \l_fontspec_family_tl
+}
+\cs_new:Nn \fontspec_set_fontface:NNnn
+ {
+ \fontspec_select:nn {#3}{#4}
+ \tl_set_eq:NN #1 \l_fontspec_font
+ \tl_set_eq:NN #2 \l_fontspec_family_tl
+ }
+\cs_set:Nn \fontspec_fontwrap:n { "#1" }
+\cs_if_free:NT \font_set_eq:NN {
+ \cs_set_eq:NN \font_set_eq:NN \tex_let:D
+ \cs_set:Npn \font_set:Nnn #1#2#3 {
+ \font #1 = #2 ~at~ #3\scan_stop:
+ }
+ \cs_set:Npn \font_gset:Nnn #1#2#3 {
+ \global \font #1 = #2 ~at~ #3 \scan_stop:
+ }
+ \cs_set:Npn \font_suppress_not_found_error:
+ {\suppressfontnotfounderror=1}
+ \prg_set_conditional:Nnn \font_if_null:N {p,TF,T,F} {
+ \ifx #1 \nullfont
+ \prg_return_true:
+ \else
+ \prg_return_false:
+ \fi
+ }
+}
+\cs_new:Nn \fontspec_font_set:Nnn {
+ \font_set:Nnn #1 {\fontspec_fontwrap:n {#2}} {#3}
+}
+\cs_new:Nn \fontspec_font_gset:Nnn {
+ \font_gset:Nnn #1 {\fontspec_fontwrap:n {#2}} {#3}
+}
+\prg_new_conditional:Nnn \font_glyph_if_exist:Nn {p,TF,T,F} {
+ \etex_iffontchar:D #1 #2 \scan_stop:
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+}
+\cs_set:Nn \fontspec_select:nn {
+ \group_begin:
+ \font_suppress_not_found_error:
+ \fontspec_init:
+ \tl_set:Nx \l_fontspec_fontname_tl {#2}
+ \tl_set_eq:NN \l_fontspec_fontid_tl \l_fontspec_fontname_tl
+ \tl_set_eq:NN \l_fontspec_fontname_up_tl \l_fontspec_fontname_tl
+ \exp_args:NnV \fontspec_preparse_features:nn {#1} \l_fontspec_fontname_tl
+ \fontspec_font_set:Nnn \l_fontspec_font {\fontspec_fullname:n {\l_fontspec_fontname_up_tl}} {\f@size pt}
+ \font_if_null:NT \l_fontspec_font { \fontspec_error:nx {font-not-found} {\l_fontspec_fontname_up_tl} }
+ \fontspec_set_font_type:
+ \fontspec_font_gset:Nnn \l_fontspec_font {\fontspec_fullname:n {\l_fontspec_fontname_up_tl}} {\f@size pt}
+ \l_fontspec_font % this is necessary for LuaLaTeX to check the scripts properly
+ \fontspec_set_scriptlang:
+ \fontspec_get_features:n {}
+ \bool_set_false:N \l_fontspec_firsttime_bool
+ \fontspec_save_family:nT {#2} {
+ \fontspec_save_fontinfo:nn {#1} {#2}
+ \DeclareFontFamily{\g_fontspec_encoding_tl}{\l_fontspec_family_tl}{}
+ \fontspec_set_upright:
+ \fontspec_set_bold:
+ \fontspec_set_italic:
+ \fontspec_set_slanted:
+ \fontspec_set_bold_italic:
+ \fontspec_set_bold_slanted:
+ }
+ \fontspec_info:nxx {defining-font} {#1} {#2}
+ \group_end:
+}
+\cs_new:Nn \fontspec_preparse_features:nn {
+ \fontspec_if_detect_external:nT {#2}
+ { \keys_set:nn {fontspec-preparse-external} {ExternalLocation} }
+ \keys_set_known:nxN {fontspec-preparse-external}
+ {\g_fontspec_default_fontopts_tl #1} \l_fontspec_keys_leftover_clist
+ \tl_set_eq:NN \l_fontspec_fontname_tl \l_fontspec_fontname_up_tl
+ \keys_set_known:nxN {fontspec-preparse} {\l_fontspec_keys_leftover_clist}
+ \l_fontspec_fontfeat_clist
+}
+\prg_new_conditional:Nnn \fontspec_if_detect_external:n {T}
+ {
+ \clist_map_inline:Nn \l_fontspec_extensions_clist
+ {
+ \bool_set_false:N \l_tmpa_bool
+ \tl_if_in:nnT {#1 <= end_of_string} {##1 <= end_of_string}
+ { \bool_set_true:N \l_tmpa_bool \clist_map_break: }
+ }
+ \bool_if:NTF \l_tmpa_bool \prg_return_true: \prg_return_false:
+ }
+\cs_set:Nn \fontspec_fullname:n {
+ \fontspec_namewrap:n { #1 \l_fontspec_extension_tl }
+ \l_fontspec_renderer_tl
+ \l_fontspec_optical_size_tl
+}
+%% Now we have a unique (in fact, too unique!) string that contains
+\prg_new_conditional:Nnn \fontspec_save_family:n {T} {
+ \cs_if_exist:cF {g_fontspec_UID_\l_fontspec_fontid_tl}
+ {
+ \cs_if_exist:cTF {g_fontspec_family_#1_int} {
+ \int_gincr:c {g_fontspec_family_#1_int}
+ }{
+ \int_new:c {g_fontspec_family_#1_int}
+ }
+ \tl_set:Nx \l_fontspec_tmp_tl {#1}
+ \tl_remove_all:Nn \l_fontspec_tmp_tl {~}
+ \tl_gset:cx {g_fontspec_UID_\l_fontspec_fontid_tl}
+ {
+ \l_fontspec_tmp_tl ( \int_use:c {g_fontspec_family_#1_int} )
+ }
+ }
+ \tl_gset:Nv \l_fontspec_family_tl {g_fontspec_UID_\l_fontspec_fontid_tl}
+ \cs_if_exist:cTF {g_fontspec_ \l_fontspec_family_tl _prop}
+ \prg_return_false: \prg_return_true:
+}
+\cs_new:Nn \fontspec_set_scriptlang: {
+ \bool_if:NT \l_fontspec_firsttime_bool {
+ \tl_if_empty:NTF \l_fontspec_script_name_tl {
+ \fontspec_check_script:nTF {latn}
+ {
+ \tl_set:Nn \l_fontspec_script_name_tl {Latin}
+ \tl_if_empty:NT \l_fontspec_lang_name_tl {
+ \tl_set:Nn \l_fontspec_lang_name_tl {Default}
+ }
+ \keys_set:nx {fontspec} {Script=\l_fontspec_script_name_tl}
+ \keys_set:nx {fontspec} {Language=\l_fontspec_lang_name_tl}
+ }
+ {
+ \fontspec_info:n {no-scripts}
+ }
+ }
+ {
+ \tl_if_empty:NT \l_fontspec_lang_name_tl {
+ \tl_set:Nn \l_fontspec_lang_name_tl {Default}
+ }
+ \keys_set:nx {fontspec} {Script=\l_fontspec_script_name_tl}
+ \keys_set:nx {fontspec} {Language=\l_fontspec_lang_name_tl}
+ }
+ }
+}
+\cs_generate_variant:Nn \prop_gput:Nnn {cnV}
+\cs_generate_variant:Nn \prop_gput:Nnn {cnx}
+\cs_new:Nn \fontspec_save_fontinfo:nn {
+
+ \prop_new:c {g_fontspec_ \l_fontspec_family_tl _prop}
+ \prop_gput:cnx {g_fontspec_ \l_fontspec_family_tl _prop} {fontname} {#2}
+ \prop_gput:cnx {g_fontspec_ \l_fontspec_family_tl _prop} {options} {\g_fontspec_default_fontopts_tl #1}
+ \prop_gput:cnx {g_fontspec_ \l_fontspec_family_tl _prop} {fontdef} {
+ \fontspec_fullname:n {\l_fontspec_fontname_tl} :
+ \l_fontspec_pre_feat_sclist \l_fontspec_rawfeatures_sclist
+ }
+ \prop_gput:cnV {g_fontspec_ \l_fontspec_family_tl _prop} {script-num} \l_fontspec_script_int
+ \prop_gput:cnV {g_fontspec_ \l_fontspec_family_tl _prop} {lang-num} \l_fontspec_language_int
+ \prop_gput:cnV {g_fontspec_ \l_fontspec_family_tl _prop} {script-tag} \l_fontspec_script_tl
+ \prop_gput:cnV {g_fontspec_ \l_fontspec_family_tl _prop} {lang-tag} \l_fontspec_lang_tl
+
+ \tl_gset:cx {zf@family@fontname\l_fontspec_family_tl} {#2}
+ \tl_gset:cx {zf@family@options\l_fontspec_family_tl} {\g_fontspec_default_fontopts_tl #1}
+ \tl_gset:cx {zf@family@fontdef\l_fontspec_family_tl} {
+ \fontspec_fullname:n {\l_fontspec_fontname_tl} :
+ \l_fontspec_pre_feat_sclist \l_fontspec_rawfeatures_sclist
+ }
+ \tl_gset:cV {g_fontspec_script_num_(\l_fontspec_family_tl)_tl} \l_fontspec_script_int
+ \tl_gset:cV {g_fontspec_lang_num_(\l_fontspec_family_tl)_tl} \l_fontspec_language_int
+ \tl_gset_eq:cN {g_fontspec_script_(\l_fontspec_family_tl)_tl} \l_fontspec_script_tl
+ \tl_gset_eq:cN {g_fontspec_lang_(\l_fontspec_family_tl)_tl} \l_fontspec_lang_tl
+}
+\cs_new:Nn \fontspec_set_upright: {
+ \fontspec_make_font_shapes:nnnn \l_fontspec_fontname_tl
+ \mddefault \updefault \l_fontspec_fontfeat_up_clist
+}
+\cs_new:Nn \fontspec_set_bold: {
+ \bool_if:NF \l_fontspec_nobf_bool {
+ \tl_if_empty:NTF \l_fontspec_fontname_bf_tl {
+ \fontspec_make_auto_font_shapes:nnnnn \l_fontspec_fontname_tl {/B}
+ \bfdefault \updefault \l_fontspec_fontfeat_bf_clist
+ }{
+ \fontspec_make_font_shapes:nnnn \l_fontspec_fontname_bf_tl
+ \bfdefault \updefault \l_fontspec_fontfeat_bf_clist
+ }
+ }
+}
+\cs_new:Nn \fontspec_set_italic: {
+ \bool_if:NF \l_fontspec_noit_bool {
+ \tl_if_empty:NTF \l_fontspec_fontname_it_tl
+ { \fontspec_make_auto_font_shapes:nnnnn \l_fontspec_fontname_tl {/I} }
+ { \fontspec_make_font_shapes:nnnn \l_fontspec_fontname_it_tl }
+ \mddefault \itdefault \l_fontspec_fontfeat_it_clist
+ }
+}
+\cs_new:Nn \fontspec_set_slanted:
+ {
+ \tl_if_empty:NF \l_fontspec_fontname_sl_tl
+ {
+ \fontspec_make_font_shapes:nnnn
+ \l_fontspec_fontname_sl_tl \mddefault \sldefault
+ \l_fontspec_fontfeat_sl_clist
+ }
+ }
+\cs_new:Nn \fontspec_set_bold_italic: {
+ \bool_if:nF {\l_fontspec_noit_bool || \l_fontspec_nobf_bool} {
+ \tl_if_empty:NTF \l_fontspec_fontname_bfit_tl
+ {
+ \tl_if_empty:NTF \l_fontspec_fontname_bf_tl
+ {
+ \tl_if_empty:NTF \l_fontspec_fontname_it_tl
+ {
+ \fontspec_make_auto_font_shapes:nnnnn \l_fontspec_fontname_tl {/BI}
+ }
+ {
+ \fontspec_make_auto_font_shapes:nnnnn \l_fontspec_fontname_it_tl {/B}
+ }
+ }
+ {
+ \fontspec_make_auto_font_shapes:nnnnn \l_fontspec_fontname_bf_tl {/I}
+ }
+ }
+ {
+ \fontspec_make_font_shapes:nnnn \l_fontspec_fontname_bfit_tl
+ }
+ \bfdefault \itdefault \l_fontspec_fontfeat_bfit_clist
+ }
+}
+\cs_new:Nn \fontspec_set_bold_slanted:
+ {
+ \tl_if_empty:NTF \l_fontspec_fontname_bfsl_tl
+ {
+ \tl_if_empty:NF \l_fontspec_fontname_sl_tl {
+ \fontspec_make_auto_font_shapes:nnnnn \l_fontspec_fontname_sl_tl {/B}
+ \bfdefault \sldefault \l_fontspec_fontfeat_bfsl_clist
+ }
+ }{
+ \fontspec_make_font_shapes:nnnn \l_fontspec_fontname_bfsl_tl
+ \bfdefault \sldefault \l_fontspec_fontfeat_bfsl_clist
+ }
+ }
+\cs_new:Nn \fontspec_set_font_type:
+ {
+ \bool_set_false:N \l_fontspec_tfm_bool
+ \bool_set_false:N \l_fontspec_atsui_bool
+ \bool_set_false:N \l_fontspec_icu_bool
+ \bool_set_false:N \l_fontspec_mm_bool
+ \bool_set_false:N \l_fontspec_graphite_bool
+ \ifcase\XeTeXfonttype\l_fontspec_font
+ \bool_set_true:N \l_fontspec_tfm_bool
+ \or
+ \bool_set_true:N \l_fontspec_atsui_bool
+ \ifnum\XeTeXcountvariations\l_fontspec_font > \c_zero
+ \bool_set_true:N \l_fontspec_mm_bool
+ \fi
+ \or
+ \bool_set_true:N \l_fontspec_icu_bool
+ \fi
+ \tl_if_empty:NT \l_fontspec_renderer_tl {
+ \bool_if:NTF \l_fontspec_atsui_bool {
+ \tl_set:Nn \l_fontspec_renderer_tl {/AAT}
+ }{
+ \bool_if:NT \l_fontspec_icu_bool {
+ \tl_set:Nn \l_fontspec_renderer_tl {/ICU}
+ }
+ }
+ }
+ }
+\cs_new:Nn \fontspec_make_auto_font_shapes:nnnnn
+ {
+ \bool_if:NF \l_fontspec_external_bool
+ {
+ \fontspec_font_set:Nnn \l_tmpa_font
+ { \fontspec_fullname:n {#1} } {\f@size pt}
+ \fontspec_font_set:Nnn \l_tmpb_font
+ { \fontspec_fullname:n {#1#2} } {\f@size pt}
+ \str_if_eq:xxTF { \fontname \l_tmpa_font } { \fontname \l_tmpb_font }
+ { \fontspec_info:nx {no-font-shape} {#1#2} }
+ { \fontspec_make_font_shapes:nnnn {#1#2}{#3}{#4}{#5} }
+ }
+ }
+\cs_new:Nn \fontspec_make_font_shapes:nnnn {
+ \group_begin:
+ \tl_set:Nx \l_fontspec_fontname_tl {#1}
+ \fontspec_font_set:Nnn \l_fontspec_font {\fontspec_fullname:n {#1}} {\f@size pt}
+ \font_if_null:NT \l_fontspec_font { \fontspec_error:nx {font-not-found} {#1} }
+ \fontspec_declare_shape:nnn {#2}{#3}{#4}
+ \tl_if_empty:NTF \l_fontspec_fontname_sc_tl {
+ \bool_if:NF \l_fontspec_nosc_bool {
+ \fontspec_make_smallcaps:T {
+ \fontspec_declare_shape:nnn {#2}
+ { \tl_if_eq:NNTF #3 \itdefault \sidefault \scdefault }
+ { #4 , Letters=SmallCaps, \l_fontspec_fontfeat_sc_clist }
+ }
+ }
+ }{
+ \fontspec_font_set:Nnn \l_fontspec_font {\fontspec_fullname:n {\l_fontspec_fontname_sc_tl}} {\f@size pt}
+ \tl_set:Nx \l_fontspec_fontname_tl {\l_fontspec_fontname_sc_tl}
+ \fontspec_declare_shape:nnn {#2}
+ { \tl_if_eq:NNTF #3 \itdefault \sidefault \scdefault }
+ { #4 , \l_fontspec_fontfeat_sc_clist }
+ }
+ \group_end:
+}
+\cs_new:Nn \fontspec_declare_shape:nnn {
+ \clist_if_empty:NTF \l_fontspec_sizefeat_clist
+ {
+ \fontspec_get_features:n {#3}
+ \tl_set:Nx \l_fontspec_nfss_tl {
+ <-> \l_fontspec_scale_tl
+ \fontspec_fontwrap:n {
+ \fontspec_fullname:n {\l_fontspec_fontname_tl} :
+ \l_fontspec_pre_feat_sclist \l_fontspec_rawfeatures_sclist
+ }
+ }
+ }
+ {
+ \tl_clear:N \l_fontspec_nfss_tl
+ \clist_map_inline:Nn \l_fontspec_sizefeat_clist {
+
+ \tl_clear:N \l_fontspec_size_tl
+ \tl_set_eq:NN \l_fontspec_sizedfont_tl \l_fontspec_fontname_tl
+
+ \keys_set_known:nxN {fontspec-sizing} { \exp_after:wN \use:n ##1 }
+ \l_fontspec_keys_leftover_clist
+
+ \tl_if_empty:NT \l_fontspec_size_tl { \fontspec_error:n {no-size-info} }
+ \fontspec_get_features:n{ #3 , \l_fontspec_keys_leftover_clist }
+
+ \tl_put_right:Nx \l_fontspec_nfss_tl {
+ <\l_fontspec_size_tl> \l_fontspec_scale_tl
+ \fontspec_fontwrap:n {
+ \fontspec_fullname:n { \l_fontspec_sizedfont_tl }
+ : \l_fontspec_pre_feat_sclist \l_fontspec_rawfeatures_sclist
+ }
+ }
+
+ }
+ }
+ \use:x{
+ \exp_not:N\DeclareFontShape{\g_fontspec_encoding_tl}{\l_fontspec_family_tl}{#1}{#2}
+ {\l_fontspec_nfss_tl}{\l_fontspec_postadjust_tl}
+ }
+ \bool_if:nT {
+ \str_if_eq_p:xx {#2} {\itdefault} &&
+ !(\str_if_eq_p:xx {\itdefault} {\sldefault})
+ }
+ {
+ \use:x {
+ \exp_not:N \DeclareFontShape {\g_fontspec_encoding_tl}{\l_fontspec_family_tl}{#2}{\sldefault}
+ {<->ssub*\l_fontspec_family_tl/#1/\itdefault}{\l_fontspec_postadjust_tl}
+ }
+ }
+ \tl_gput_right:Nx \l_fontspec_defined_shapes_tl
+ { \exp_not:n { \\ \\ }
+ *~ '\exp_not:N \prg_case_str:nnn {#1/#2} {
+ {\mddefault/\updefault} {normal}
+ {\mddefault/\scdefault} {small~ caps}
+ {\bfdefault/\updefault} {bold}
+ {\bfdefault/\scdefault} {bold~ small~ caps}
+ {\mddefault/\itdefault} {italic}
+ {\mddefault/\sidefault} {italic~ small~ caps}
+ {\bfdefault/\itdefault} {bold~ italic}
+ {\bfdefault/\sidefault} {bold~ italic~ small~ caps}
+ } {#2/#3}'~
+ with~ NFSS~ spec.: \exp_not:N \\
+ \l_fontspec_nfss_tl
+ \tl_if_empty:NF \l_fontspec_postadjust_tl {
+ \exp_not:N \\ and~ font~ adjustment~ code: \exp_not:N \\ \l_fontspec_postadjust_tl
+ }
+ }
+}
+\tl_set:Nn \l_fontspec_pre_feat_sclist
+ {
+ \bool_if:NT \l_fontspec_icu_bool {
+ \tl_if_empty:NF \l_fontspec_script_tl
+ {
+ script = \l_fontspec_script_tl ;
+ language = \l_fontspec_lang_tl ;
+ }
+ }
+ }
+\cs_new:Nn \fontspec_update_fontid:n {
+ \bool_if:NT \l_fontspec_firsttime_bool {
+ \tl_gput_right:Nx \l_fontspec_fontid_tl {#1}
+ }
+}
+\cs_set:Npn \fontspec_get_features:n #1 {
+ \sclist_clear:N \l_fontspec_rawfeatures_sclist
+ \tl_clear:N \l_fontspec_scale_tl
+ \tl_set_eq:NN \l_fontspec_opacity_tl \g_fontspec_opacity_tl
+ \tl_set_eq:NN \l_fontspec_hexcol_tl \g_fontspec_hexcol_tl
+ \tl_clear:N \l_fontspec_postadjust_tl
+ \keys_set:nx {fontspec} {\l_fontspec_fontfeat_clist #1}
+ \str_if_eq:xxF { \l_fontspec_hexcol_tl \l_fontspec_opacity_tl }
+ { \g_fontspec_hexcol_tl \g_fontspec_opacity_tl }
+ {
+ \fontspec_update_featstr:n{color=\l_fontspec_hexcol_tl\l_fontspec_opacity_tl}
+ }
+}
+\tl_clear:N \l_fontspec_fontname_bf_tl
+\tl_clear:N \l_fontspec_fontname_it_tl
+\tl_clear:N \l_fontspec_fake_slant_tl
+\tl_clear:N \l_fontspec_fake_embolden_tl
+\tl_clear:N \l_fontspec_fontname_bfit_tl
+\tl_clear:N \l_fontspec_fontname_sl_tl
+\tl_clear:N \l_fontspec_fontname_bfsl_tl
+\tl_clear:N \l_fontspec_fontname_sc_tl
+\tl_clear:N \l_fontspec_fontfeat_up_clist
+\tl_clear:N \l_fontspec_fontfeat_bf_clist
+\tl_clear:N \l_fontspec_fontfeat_it_clist
+\tl_clear:N \l_fontspec_fontfeat_bfit_clist
+\tl_clear:N \l_fontspec_fontfeat_sl_clist
+\tl_clear:N \l_fontspec_fontfeat_bfsl_clist
+\tl_clear:N \l_fontspec_fontfeat_sc_clist
+\tl_clear:N \l_fontspec_script_name_tl
+\tl_clear:N \l_fontspec_script_tl
+\tl_clear:N \l_fontspec_lang_name_tl
+\tl_clear:N \l_fontspec_lang_tl
+\clist_clear:N \l_fontspec_sizefeat_clist
+\tl_new:N \g_fontspec_hexcol_tl
+\tl_new:N \g_fontspec_opacity_tl
+\tl_set:Nn \g_fontspec_hexcol_tl {000000}
+\tl_set:Nn \g_fontspec_opacity_tl {FF~}
+\cs_set:Npn \fontspec_init: {
+ \bool_set_false:N \l_fontspec_icu_bool
+ \bool_set_true:N \l_fontspec_firsttime_bool
+ \cs_set:Npn \fontspec_namewrap:n ##1
+ { ##1 }
+ \tl_clear:N \l_fontspec_optical_size_tl
+ \tl_clear:N \l_fontspec_renderer_tl
+ \tl_clear:N \l_fontspec_defined_shapes_tl
+}
+\cs_set:Nn \fontspec_make_ot_smallcaps:T {
+ \fontspec_check_ot_feat:nT {+smcp} { #1 }
+}
+\cs_set:Nn \fontspec_make_smallcaps:T
+ {
+ \bool_if:NTF \l_fontspec_icu_bool {
+ \fontspec_make_ot_smallcaps:T {#1}
+ }{
+ \bool_if:NT \l_fontspec_atsui_bool {
+ \fontspec_make_AAT_feature_string:nnT {3}{3} { #1 }
+ }
+ }
+ }
+\cs_set_eq:NN \sclist_clear:N \tl_clear:N
+\cs_new:Nn \sclist_gput_right:Nn {
+ \tl_gput_right:Nn #1 {#2;}
+}
+\cs_generate_variant:Nn \sclist_gput_right:Nn {Nx}
+\cs_new:Nn \fontspec_update_featstr:n {
+ \bool_if:NF \l_fontspec_firsttime_bool {
+ \sclist_gput_right:Nx \l_fontspec_rawfeatures_sclist {#1}
+ }
+}
+\cs_new:Nn \fontspec_make_feature:nnn
+ {
+ \bool_if:NTF \l_fontspec_icu_bool {
+ \fontspec_make_ICU_feature:n {#3}
+ }{
+ \bool_if:NT \l_fontspec_atsui_bool {
+ \fontspec_make_AAT_feature:nn {#1}{#2}
+ }
+ }
+ }
+\cs_generate_variant:Nn \fontspec_make_feature:nnn {nnx}
+\cs_new:Nn \fontspec_make_AAT_feature:nn {
+ \tl_if_empty:nTF {#1}
+ { \fontspec_warning:n {aat-feature-not-exist} }
+ {
+ \fontspec_make_AAT_feature_string:nnTF {#1}{#2}
+ {
+ \fontspec_update_fontid:n {+#1,#2}
+ \fontspec_update_featstr:n {\l_fontspec_feature_string_tl}
+ }
+ { \fontspec_warning:nx {aat-feature-not-exist-in-font} {#1,#2} }
+ }
+}
+\cs_new:Nn \fontspec_make_ICU_feature:n {
+ \tl_if_empty:nTF {#1}
+ { \fontspec_warning:n {icu-feature-not-exist} }
+ {
+ \fontspec_check_ot_feat:nTF {#1}
+ {
+ \fontspec_update_fontid:n {#1}
+ \fontspec_update_featstr:n{#1}
+ }
+ { \fontspec_warning:nx {icu-feature-not-exist-in-font} {#1} }
+ }
+}
+\cs_new_protected:Nn \fontspec_make_numbered_feature:nn
+ {
+ \fontspec_check_ot_feat:nTF {#1}
+ {
+ \fontspec_update_fontid:n {#1=#2}
+ \fontspec_update_featstr:n { #1 = #2 }
+ }
+ { \fontspec_warning:nx {icu-feature-not-exist-in-font} {#1} }
+ }
+\cs_generate_variant:Nn \fontspec_make_numbered_feature:nn {xn}
+\cs_new:Nn \fontspec_define_font_feature:n {
+ \keys_define:nn {fontspec} { #1 .multichoice: }
+}
+\cs_new:Nn \fontspec_define_feature_option:nnnnn {
+ \keys_define:nn {fontspec} {
+ #1/#2 .code:n = { \fontspec_make_feature:nnn{#3}{#4}{#5} }
+ }
+}
+\cs_new:Nn \fontspec_define_numbered_feat:nnnn
+ {
+ \keys_define:nn {fontspec}
+ {
+ #1/#2 .code:n =
+ { \fontspec_make_numbered_feature:nn {#3}{#4} }
+ }
+ }
+\prg_new_conditional:Nnn \fontspec_make_AAT_feature_string:nn {TF,T,F} {
+ \tl_set:Nx \l_tmpa_tl { \XeTeXfeaturename \l_fontspec_font #1 }
+ \tl_if_empty:NTF \l_tmpa_tl
+ { \prg_return_false: }
+ {
+ \int_compare:nTF { \XeTeXisexclusivefeature\l_fontspec_font #1 > 0 }
+ {
+ \tl_set:Nx \l_tmpb_tl {\XeTeXselectorname\l_fontspec_font #1\space #2}
+ }{
+ \int_if_even:nTF {#2}
+ {
+ \tl_set:Nx \l_tmpb_tl {\XeTeXselectorname\l_fontspec_font #1\space #2}
+ }{
+ \tl_set:Nx \l_tmpb_tl {
+ \XeTeXselectorname\l_fontspec_font #1\space \numexpr#2-1\relax
+ }
+ \tl_if_empty:NF \l_tmpb_tl { \tl_put_left:Nn \l_tmpb_tl {!} }
+ }
+ }
+ \tl_if_empty:NTF \l_tmpb_tl
+ { \prg_return_false: }
+ {
+ \tl_set:Nx \l_fontspec_feature_string_tl { \l_tmpa_tl = \l_tmpb_tl }
+ \prg_return_true:
+ }
+ }
+}
+\cs_set:Npn \fontspec_iv_str_to_num:Nn #1#2 {
+ \fontspec_iv_str_to_num:w #1 \q_nil #2 \c_empty_tl \c_empty_tl \q_nil
+}
+\cs_set:Npn \fontspec_iv_str_to_num:w #1 \q_nil #2#3#4#5#6 \q_nil {
+ \int_set:Nn #1 {
+ `#2 * "1000000
+ + `#3 * "10000
+ + \ifx \c_empty_tl #4 32 \else `#4 \fi * "100
+ + \ifx \c_empty_tl #5 32 \else `#5 \fi
+ }
+}
+\cs_generate_variant:Nn \fontspec_iv_str_to_num:Nn {No}
+\cs_set:Npn \fontspec_v_str_to_num:Nn #1#2 {
+ \bool_if:nTF
+ {
+ \tl_if_head_eq_charcode_p:nN {#2} {+} ||
+ \tl_if_head_eq_charcode_p:nN {#2} {-}
+ }
+ { \fontspec_iv_str_to_num:No #1 { \use_none:n #2 } }
+ { \fontspec_iv_str_to_num:Nn #1 {#2} }
+}
+\prg_new_conditional:Nnn \fontspec_check_script:n {TF}
+ {
+ \fontspec_iv_str_to_num:Nn \l_fontspec_strnum_int {#1}
+ \int_set:Nn \l_tmpb_int { \XeTeXOTcountscripts\l_fontspec_font }
+ \int_zero:N \l_tmpa_int
+ \@tempswafalse
+ \bool_until_do:nn { \int_compare_p:nNn \l_tmpa_int = \l_tmpb_int }
+ {
+ \ifnum \XeTeXOTscripttag\l_fontspec_font \l_tmpa_int = \l_fontspec_strnum_int
+ \@tempswatrue
+ \int_set:Nn \l_tmpa_int {\l_tmpb_int}
+ \else
+ \int_incr:N \l_tmpa_int
+ \fi
+ }
+ \if@tempswa \prg_return_true: \else: \prg_return_false: \fi:
+ }
+\prg_new_conditional:Nnn \fontspec_check_lang:n {TF}
+ {
+ \fontspec_iv_str_to_num:Nn \l_fontspec_strnum_int {#1}
+ \int_set:Nn \l_tmpb_int {
+ \XeTeXOTcountlanguages \l_fontspec_font \l_fontspec_script_int
+ }
+ \int_zero:N \l_tmpa_int
+ \@tempswafalse
+ \bool_until_do:nn { \int_compare_p:nNn \l_tmpa_int = \l_tmpb_int }
+ {
+ \ifnum\XeTeXOTlanguagetag\l_fontspec_font\l_fontspec_script_int \l_tmpa_int =\l_fontspec_strnum_int
+ \@tempswatrue
+ \int_set:Nn \l_tmpa_int {\l_tmpb_int}
+ \else
+ \int_incr:N \l_tmpa_int
+ \fi
+ }
+ \if@tempswa \prg_return_true: \else: \prg_return_false: \fi:
+ }
+\prg_new_conditional:Nnn \fontspec_check_ot_feat:n {TF,T}
+ {
+ \int_set:Nn \l_tmpb_int {
+ \XeTeXOTcountfeatures \l_fontspec_font
+ \l_fontspec_script_int
+ \l_fontspec_language_int
+ }
+ \fontspec_v_str_to_num:Nn \l_fontspec_strnum_int {#1}
+ \int_zero:N \l_tmpa_int
+ \@tempswafalse
+ \bool_until_do:nn { \int_compare_p:nNn \l_tmpa_int = \l_tmpb_int }
+ {
+ \ifnum\XeTeXOTfeaturetag\l_fontspec_font\l_fontspec_script_int\l_fontspec_language_int
+ \l_tmpa_int =\l_fontspec_strnum_int
+ \@tempswatrue
+ \int_set:Nn \l_tmpa_int {\l_tmpb_int}
+ \else
+ \int_incr:N \l_tmpa_int
+ \fi
+ }
+ \if@tempswa \prg_return_true: \else: \prg_return_false: \fi:
+ }
+\cs_generate_variant:Nn \keys_set:nn {nx}
+\cs_generate_variant:Nn \keys_set_known:nnN {nx}
+\bool_new:N \l_fontspec_external_bool
+\keys_define:nn {fontspec-preparse-external} {
+ ExternalLocation .code:n = {
+ \bool_set_true:N \l_fontspec_nobf_bool
+ \bool_set_true:N \l_fontspec_noit_bool
+ \bool_set_true:N \l_fontspec_external_bool
+ \cs_gset:Npn \fontspec_namewrap:n ##1
+ { [ #1 ##1 ] }
+ \keys_set:nn {fontspec-preparse} {Renderer=ICU}
+ }
+}
+\aliasfontfeature{ExternalLocation}{Path}
+\keys_define:nn {fontspec-preparse-external} {
+ Extension .code:n = {
+ \tl_set:Nn \l_fontspec_extension_tl {#1}
+ \bool_if:NF \l_fontspec_external_bool {
+ \keys_set:nn {fontspec-preparse-external} {ExternalLocation}
+ }
+}
+}
+\tl_clear:N \l_fontspec_extension_tl
+\keys_define:nn {fontspec-preparse} {
+ Renderer .choice_code:n = {
+ \fontspec_update_fontid:n {+rend:\l_keys_choice_tl}
+ \int_compare:nTF {\l_keys_choice_int < 3} {
+ \tl_set:Nv \l_fontspec_renderer_tl
+ { g_fontspec_renderer_tag_ \l_keys_choice_tl }
+ }{
+ \fontspec_warning:nx {only-luatex-feature} {Renderer=Full/Basic}
+ }
+ }
+ ,
+ Renderer .generate_choices:n = {AAT,ICU,Graphite,Full,Basic}
+}
+\tl_set:cn {g_fontspec_renderer_tag_AAT} {/AAT}
+\tl_set:cn {g_fontspec_renderer_tag_ICU} {/ICU}
+\tl_set:cn {g_fontspec_renderer_tag_Graphite} {/GR}
+\tl_set:cn {g_fontspec_mode_tag_Full} {node}
+\tl_set:cn {g_fontspec_mode_tag_Basic} {base}
+\keys_define:nn {fontspec-preparse} { Script .code:n = {
+ \keys_set:nn {fontspec-preparse} {Renderer=ICU}
+ \tl_set:Nn \l_fontspec_script_name_tl {#1}
+ \fontspec_update_fontid:n {+script:#1}
+ }
+}
+\keys_define:nn {fontspec-preparse} { Language .code:n = {
+ \keys_set:nn {fontspec-preparse} {Renderer=ICU}
+ \tl_set:Nn \l_fontspec_lang_name_tl {#1}
+ \fontspec_update_fontid:n {+language:#1}
+ }
+}
+\keys_define:nn {fontspec-preparse-external} { UprightFont .code:n = {
+ \fontspec_complete_fontname:Nn \l_fontspec_fontname_up_tl {#1}
+ \fontspec_update_fontid:n {up:#1}
+ }
+}
+\keys_define:nn {fontspec-preparse-external} { BoldFont .code:n = {
+ \tl_if_empty:nTF {#1}
+ {
+ \bool_set_true:N \l_fontspec_nobf_bool
+ \fontspec_update_fontid:n {nobf}
+ }
+ {
+ \bool_set_false:N \l_fontspec_nobf_bool
+ \fontspec_complete_fontname:Nn \l_fontspec_fontname_bf_tl {#1}
+ \fontspec_update_fontid:n {bf:#1}
+ }
+ }
+}
+\keys_define:nn {fontspec-preparse-external} { ItalicFont .code:n = {
+ \tl_if_empty:nTF {#1}
+ {
+ \bool_set_true:N \l_fontspec_noit_bool
+ \fontspec_update_fontid:n {noit}
+ }{
+ \bool_set_false:N \l_fontspec_noit_bool
+ \fontspec_complete_fontname:Nn \l_fontspec_fontname_it_tl {#1}
+ \fontspec_update_fontid:n {it:#1}
+ }
+ }
+}
+\keys_define:nn {fontspec-preparse-external} { BoldItalicFont .code:n = {
+ \fontspec_complete_fontname:Nn \l_fontspec_fontname_bfit_tl {#1}
+ \fontspec_update_fontid:n {bfit:#1}
+ }
+}
+\keys_define:nn {fontspec-preparse-external}
+ {
+ SlantedFont .code:n =
+ {
+ \fontspec_complete_fontname:Nn \l_fontspec_fontname_sl_tl {#1}
+ \fontspec_update_fontid:n {sl:#1}
+ }
+ }
+\keys_define:nn {fontspec-preparse-external} { BoldSlantedFont .code:n = {
+ \fontspec_complete_fontname:Nn \l_fontspec_fontname_bfsl_tl {#1}
+ \fontspec_update_fontid:n {bfsl:#1}
+ }
+}
+\keys_define:nn {fontspec} { SmallCapsFont .code:n = {
+ \tl_if_empty:nTF {#1}
+ {
+ \bool_set_true:N \l_fontspec_nosc_bool
+ \fontspec_update_fontid:n {nosc}
+ }{
+ \bool_set_true:N \l_fontspec_nosc_bool
+ \fontspec_complete_fontname:Nn \l_fontspec_fontname_sc_tl {#1}
+ \fontspec_update_fontid:n {sc:#1}
+ }
+ }
+}
+\cs_set:Npn \fontspec_complete_fontname:Nn #1#2 {
+ \tl_set:Nn #1 {#2}
+ \tl_replace_all:Nnx #1 {*} {\l_fontspec_fontname_tl}
+}
+\cs_generate_variant:Nn \tl_replace_all:Nnn {Nnx}
+\keys_define:nn {fontspec-preparse} { UprightFeatures .code:n = {
+ \def\l_fontspec_fontfeat_up_clist{, #1}
+ \fontspec_update_fontid:n {rmfeat:#1}
+ }
+}
+\keys_define:nn {fontspec-preparse} { BoldFeatures .code:n = {
+ \def\l_fontspec_fontfeat_bf_clist{, #1}
+ \fontspec_update_fontid:n {bffeat:#1}
+ }
+}
+\keys_define:nn {fontspec-preparse} { ItalicFeatures .code:n = {
+ \def\l_fontspec_fontfeat_it_clist{, #1}
+ \fontspec_update_fontid:n {itfeat:#1}
+ }
+}
+\keys_define:nn {fontspec-preparse} { BoldItalicFeatures .code:n = {
+ \def\l_fontspec_fontfeat_bfit_clist{, #1}
+ \fontspec_update_fontid:n {bfitfeat:#1}
+ }
+}
+\keys_define:nn {fontspec-preparse} { SlantedFeatures .code:n = {
+ \def\l_fontspec_fontfeat_sl_clist{, #1}
+ \fontspec_update_fontid:n {slfeat:#1}
+ }
+}
+\keys_define:nn {fontspec-preparse} { BoldSlantedFeatures .code:n = {
+ \def\l_fontspec_fontfeat_bfsl_clist{, #1}
+ \fontspec_update_fontid:n {bfslfeat:#1}
+ }
+}
+\keys_define:nn {fontspec} { SmallCapsFeatures .code:n = {
+ \bool_if:NF \l_fontspec_firsttime_bool {
+ \def\l_fontspec_fontfeat_sc_clist{, #1}
+ }
+ \fontspec_update_fontid:n {scfeat:#1}
+ }
+}
+\keys_define:nn {fontspec-preparse} { SizeFeatures .code:n = {
+ \tl_set:Nn \l_fontspec_sizefeat_clist {#1}
+ \fontspec_update_fontid:n {sizefeat:#1}
+ }
+}
+\keys_define:nn {fontspec-sizing}
+ {
+ Size .code:n =
+ {
+ \tl_set:Nn \l_fontspec_size_tl {#1}
+ }
+ }
+\keys_define:nn {fontspec-sizing}
+ {
+ Font .code:n =
+ {
+ \fontspec_complete_fontname:Nn \l_fontspec_sizedfont_tl {#1}
+ }
+ }
+\keys_define:nn {fontspec} { Scale .code:n = {
+ \prg_case_str:nnn {#1}
+ {
+ {MatchLowercase} { \fontspec_calc_scale:n {5} }
+ {MatchUppercase} { \fontspec_calc_scale:n {8} }
+ }
+ { \tl_set:Nx \l_fontspec_scale_tl {#1} }
+ \fontspec_update_fontid:n {+scale:\l_fontspec_scale_tl}
+ \tl_set:Nx \l_fontspec_scale_tl { s*[\l_fontspec_scale_tl] }
+ }
+}
+\cs_new:Nn \fontspec_calc_scale:n {
+ \group_begin:
+ \rmfamily
+ \fontspec_set_font_dimen:NnN \l_fontspec_tmpa_dim {#1} \font
+ \fontspec_set_font_dimen:NnN \l_fontspec_tmpb_dim {#1} \l_fontspec_font
+ \fp_set_from_dim:Nn \l_fontspec_tmpa_fp { \l_fontspec_tmpa_dim }
+ \fp_set_from_dim:Nn \l_fontspec_tmpb_fp { \l_fontspec_tmpb_dim }
+ \fp_div:Nn \l_fontspec_tmpa_fp { \l_fontspec_tmpb_fp }
+ \tl_gset:Nx \l_fontspec_scale_tl { \fp_use:N \l_fontspec_tmpa_fp }
+ \fontspec_info:n {set-scale}
+ \group_end:
+}
+\cs_new:Nn \fontspec_set_font_dimen:NnN
+{
+ \dim_set:Nn #1 { \fontdimen #2 #3 }
+ \dim_compare:nNnT #1 = {0pt} {
+ \settoheight #1 {
+ \str_if_eq:nnTF {#3} {\font} \rmfamily #3
+ \prg_case_int:nnn #2 {
+ {5} {x} % x-height
+ {8} {X} % cap-height
+ } {?} % "else" clause; never reached.
+ }
+ }
+}
+\keys_define:nn {fontspec} { WordSpace .code:n = {
+ \fontspec_update_fontid:n {+wordspace:#1}
+ \bool_if:NF \l_fontspec_firsttime_bool {
+ \_fontspec_parse_wordspace:w #1,,,\q_stop
+ }
+ }
+}
+\cs_set:Npn \_fontspec_parse_wordspace:w #1,#2,#3,#4 \q_stop {
+ \tl_if_empty:nTF {#4}
+ {
+ \tl_put_right:Nn \l_fontspec_postadjust_tl {
+ \fontdimen 2 \font = #1 \fontdimen 2 \font
+ \fontdimen 3 \font = #1 \fontdimen 3 \font
+ \fontdimen 4 \font = #1 \fontdimen 4 \font
+ }
+ }{
+ \tl_put_right:Nn \l_fontspec_postadjust_tl {
+ \fontdimen 2 \font = #1 \fontdimen 2 \font
+ \fontdimen 3 \font = #2 \fontdimen 3 \font
+ \fontdimen 4 \font = #3 \fontdimen 4 \font
+ }
+ }
+}
+\keys_define:nn {fontspec}
+ {
+ PunctuationSpace .code:n =
+ {
+ \fontspec_update_fontid:n {+punctspace:#1}
+ \tl_put_right:Nx \l_fontspec_postadjust_tl
+ { \fontdimen 7 \font = #1 \fontdimen 7 \font }
+ }
+ }
+\keys_define:nn {fontspec} { FontAdjustment .code:n = {
+ \fontspec_update_fontid:n {+fontadjust:\detokenize{#1}}
+ \tl_put_right:Nx \l_fontspec_postadjust_tl {#1}
+ }
+}
+\keys_define:nn {fontspec} { LetterSpace .code:n = {
+ \fontspec_update_fontid:n {+tracking:#1}
+ \fontspec_update_featstr:n{letterspace=#1}
+ }
+}
+\keys_define:nn {fontspec} { HyphenChar .code:n = {
+ \fontspec_update_fontid:n {+hyphenchar:#1}
+ \str_if_eq:nnTF {#1} {None}
+ {
+ \tl_put_right:Nn \l_fontspec_postadjust_tl
+ { \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} }
+ \font_glyph_if_exist:NnTF \l_fontspec_font {\l_fontspec_hyphenchar_tl}
+ {
+ \tl_put_right:Nn \l_fontspec_postadjust_tl
+ { \hyphenchar \font = \l_fontspec_hyphenchar_tl \scan_stop: }
+ }
+ { \fontspec_error:nx {no-glyph}{#1} }
+ }
+ }
+}
+\keys_define:nn {fontspec} { Color .code:n = {
+ \fontspec_update_fontid:n {+col:#1}
+ \cs_if_exist:cTF { \token_to_str:N \color@ #1 }
+ {
+ \convertcolorspec{named}{#1}{HTML}\l_fontspec_hexcol_tl
+ }
+ {
+ \int_compare:nTF { \tl_length:n {#1} == 6 }
+ { \tl_set:Nn \l_fontspec_hexcol_tl {#1} }
+ {
+ \int_compare:nTF { \tl_length:n {#1} == 8 }
+ { \fontspec_parse_colour:viii #1 }
+ {
+ \bool_if:NF \l_fontspec_firsttime_bool {
+ \fontspec_warning:nx {bad-colour} {#1}
+ }
+ }
+ }
+ }
+ }
+}
+\cs_set:Npn \fontspec_parse_colour:viii #1#2#3#4#5#6#7#8 {
+ \tl_set:Nn \l_fontspec_hexcol_tl {#1#2#3#4#5#6}
+ \tl_if_eq:NNF \l_fontspec_opacity_tl \g_fontspec_opacity_tl
+ {
+ \bool_if:NF \l_fontspec_firsttime_bool {
+ \fontspec_warning:nx {opa-twice-col} {#7#8}
+ }
+ }
+ \tl_set:Nn \l_fontspec_opacity_tl {#7#8}
+}
+\aliasfontfeature{Color}{Colour}
+\newcounter{fontspec_tmp_int}
+\keys_define:nn {fontspec} { Opacity .code:n = {
+ \fontspec_update_fontid:n {+opac:#1}
+ \setcounter {fontspec_tmp_int} { 255*\real{#1} }
+ \tl_if_eq:NNF \l_fontspec_opacity_tl \g_fontspec_opacity_tl
+ {
+ \bool_if:NF \l_fontspec_firsttime_bool {
+ \fontspec_warning:nx {opa-twice} {#1}
+ }
+ }
+ \tl_set:Nx \l_fontspec_opacity_tl
+ {
+ \int_compare:nT { \value{fontspec_tmp_int} <= "F } {0} % zero pad
+ \int_to_hexadecimal:n { \value{fontspec_tmp_int} }
+ }
+ }
+}
+\keys_define:nn {fontspec}
+{
+ Mapping .code:n = {
+ \fontspec_update_fontid:n {+map:#1}
+ \fontspec_update_featstr:n{mapping=#1}
+ }
+}
+\keys_define:nn {fontspec} { FeatureFile .code:n = {
+ \fontspec_update_fontid:n {+fea:#1}
+ \fontspec_update_featstr:n{featurefile=#1}
+ }
+}
+\keys_define:nn {fontspec} { Weight .code:n = {
+ \fontspec_update_fontid:n {+weight:#1}
+ \fontspec_update_featstr:n{weight=#1}
+ }
+}
+\keys_define:nn {fontspec} { Width .code:n = {
+ \fontspec_update_fontid:n {+width:#1}
+ \fontspec_update_featstr:n{width=#1}
+ }
+}
+\keys_define:nn {fontspec} { OpticalSize .code:n =
+ {
+ \bool_if:NTF \l_fontspec_icu_bool {
+ \tl_set:Nn \l_fontspec_optical_size_tl {/ S = #1}
+ \fontspec_update_fontid:n {+size:#1}
+ }{
+ \bool_if:NT \l_fontspec_mm_bool {
+ \fontspec_update_fontid:n {+size:#1}
+ \fontspec_update_featstr:n{optical size=#1}
+ }
+ }
+ \bool_if:nT { !\l_fontspec_icu_bool && !\l_fontspec_mm_bool }{
+ \bool_if:NT \l_fontspec_firsttime_bool {
+ \fontspec_warning:n {no-opticals}
+ }
+ }
+ }
+}
+\keys_define:nn {fontspec} { FakeSlant .code:n = {
+ \fontspec_update_fontid:n {+slant:#1}
+ \fontspec_update_featstr:n{slant=#1}
+ },
+ FakeSlant .default:n = {0.2}
+}
+\keys_define:nn {fontspec} { FakeStretch .code:n = {
+ \fontspec_update_fontid:n {+extend:#1}
+ \fontspec_update_featstr:n{extend=#1}
+ },
+ FakeStretch .default:n = {1.2}
+}
+\keys_define:nn {fontspec} { FakeBold .code:n = {
+ \fontspec_update_fontid:n {+embolden:#1}
+ \fontspec_update_featstr:n{embolden=#1}
+ },
+ FakeBold .default:n = {1.5}
+}
+\keys_define:nn {fontspec} { AutoFakeSlant .code:n = {
+ \bool_if:NT \l_fontspec_firsttime_bool {
+ \tl_set:Nn \l_fontspec_fake_slant_tl {#1}
+ \clist_put_right:Nn \l_fontspec_fontfeat_it_clist {,FakeSlant=#1}
+ \tl_set_eq:NN \l_fontspec_fontname_it_tl \l_fontspec_fontname_tl
+ \fontspec_update_fontid:n {fakeit:#1}
+ \tl_if_empty:NF \l_fontspec_fake_embolden_tl {
+ \tl_put_right:Nx \l_fontspec_fontfeat_bfit_clist
+ {,FakeBold=\l_fontspec_fake_embolden_tl,FakeSlant=#1}
+ \tl_set_eq:NN \l_fontspec_fontname_bfit_tl \l_fontspec_fontname_tl
+ }
+ }
+ },
+ AutoFakeSlant .default:n = {0.2}
+}
+\keys_define:nn {fontspec} { AutoFakeBold .code:n = {
+ \bool_if:NT \l_fontspec_firsttime_bool {
+ \tl_set:Nn \l_fontspec_fake_embolden_tl {#1}
+ \tl_put_right:Nn \l_fontspec_fontfeat_bf_clist {,FakeBold=#1}
+ \tl_set_eq:NN \l_fontspec_fontname_bf_tl \l_fontspec_fontname_tl
+ \fontspec_update_fontid:n {fakebf:#1}
+ \tl_if_empty:NF \l_fontspec_fake_slant_tl {
+ \tl_put_right:Nx \l_fontspec_fontfeat_bfit_clist
+ {,FakeSlant=\l_fontspec_fake_slant_tl,FakeBold=#1}
+ \tl_set_eq:NN \l_fontspec_fontname_bfit_tl \l_fontspec_fontname_tl
+ }
+ }
+ },
+ AutoFakeBold .default:n = {1.5}
+}
+\fontspec_define_font_feature:n{Ligatures}
+\fontspec_define_feature_option:nnnnn{Ligatures}{Required} {1}{0}{+rlig}
+\fontspec_define_feature_option:nnnnn{Ligatures}{NoRequired} {1}{1}{-rlig}
+\fontspec_define_feature_option:nnnnn{Ligatures}{Common} {1}{2}{+liga}
+\fontspec_define_feature_option:nnnnn{Ligatures}{NoCommon} {1}{3}{-liga}
+\fontspec_define_feature_option:nnnnn{Ligatures}{Rare} {1}{4}{+dlig}
+\fontspec_define_feature_option:nnnnn{Ligatures}{NoRare} {1}{5}{-dlig}
+\fontspec_define_feature_option:nnnnn{Ligatures}{Discretionary} {1}{4}{+dlig}
+\fontspec_define_feature_option:nnnnn{Ligatures}{NoDiscretionary}{1}{5}{-dlig}
+\fontspec_define_feature_option:nnnnn{Ligatures}{Contextual} {}{} {+clig}
+\fontspec_define_feature_option:nnnnn{Ligatures}{NoContextual} {}{} {-clig}
+\fontspec_define_feature_option:nnnnn{Ligatures}{Historic} {}{} {+hlig}
+\fontspec_define_feature_option:nnnnn{Ligatures}{NoHistoric} {}{} {-hlig}
+\fontspec_define_feature_option:nnnnn{Ligatures}{Logos} {1}{6} {}
+\fontspec_define_feature_option:nnnnn{Ligatures}{NoLogos} {1}{7} {}
+\fontspec_define_feature_option:nnnnn{Ligatures}{Rebus} {1}{8} {}
+\fontspec_define_feature_option:nnnnn{Ligatures}{NoRebus} {1}{9} {}
+\fontspec_define_feature_option:nnnnn{Ligatures}{Diphthong} {1}{10}{}
+\fontspec_define_feature_option:nnnnn{Ligatures}{NoDiphthong} {1}{11}{}
+\fontspec_define_feature_option:nnnnn{Ligatures}{Squared} {1}{12}{}
+\fontspec_define_feature_option:nnnnn{Ligatures}{NoSquared} {1}{13}{}
+\fontspec_define_feature_option:nnnnn{Ligatures}{AbbrevSquared} {1}{14}{}
+\fontspec_define_feature_option:nnnnn{Ligatures}{NoAbbrevSquared}{1}{15}{}
+\fontspec_define_feature_option:nnnnn{Ligatures}{Icelandic} {1}{32}{}
+\fontspec_define_feature_option:nnnnn{Ligatures}{NoIcelandic} {1}{33}{}
+\keys_define:nn {fontspec}
+{
+ Ligatures / TeX .code:n = {
+ \fontspec_update_fontid:n {+map:tex-text}
+ \fontspec_update_featstr:n{mapping=tex-text}
+ }
+}
+\fontspec_define_font_feature:n{Letters}
+\fontspec_define_feature_option:nnnnn{Letters}{Normal} {3}{0}{}
+\fontspec_define_feature_option:nnnnn{Letters}{Uppercase} {3}{1}{+case}
+\fontspec_define_feature_option:nnnnn{Letters}{Lowercase} {3}{2}{}
+\fontspec_define_feature_option:nnnnn{Letters}{SmallCaps} {3}{3}{+smcp}
+\fontspec_define_feature_option:nnnnn{Letters}{PetiteCaps} {} {} {+pcap}
+\fontspec_define_feature_option:nnnnn{Letters}{UppercaseSmallCaps} {} {} {+c2sc}
+\fontspec_define_feature_option:nnnnn{Letters}{UppercasePetiteCaps}{} {} {+c2pc}
+\fontspec_define_feature_option:nnnnn{Letters}{InitialCaps} {3}{4}{}
+\fontspec_define_feature_option:nnnnn{Letters}{Unicase} {} {} {+unic}
+\fontspec_define_feature_option:nnnnn{Letters}{Random} {} {} {+rand}
+\fontspec_define_font_feature:n{Numbers}
+\fontspec_define_feature_option:nnnnn{Numbers}{Monospaced} {6} {0}{+tnum}
+\fontspec_define_feature_option:nnnnn{Numbers}{Proportional} {6} {1}{+pnum}
+\fontspec_define_feature_option:nnnnn{Numbers}{Lowercase} {21}{0}{+onum}
+\fontspec_define_feature_option:nnnnn{Numbers}{OldStyle} {21}{0}{+onum}
+\fontspec_define_feature_option:nnnnn{Numbers}{Uppercase} {21}{1}{+lnum}
+\fontspec_define_feature_option:nnnnn{Numbers}{Lining} {21}{1}{+lnum}
+\fontspec_define_feature_option:nnnnn{Numbers}{SlashedZero} {14}{5}{+zero}
+\fontspec_define_feature_option:nnnnn{Numbers}{NoSlashedZero}{14}{4}{-zero}
+\luatex_if_engine:T {
+ \fontspec_define_feature_option:nnnnn{Numbers}{Arabic}{}{}{+anum}
+}
+\fontspec_define_font_feature:n {Contextuals}
+\fontspec_define_feature_option:nnnnn{Contextuals}{Swash} {} {} {+cswh}
+\fontspec_define_feature_option:nnnnn{Contextuals}{NoSwash} {} {} {-cswh}
+\fontspec_define_feature_option:nnnnn{Contextuals}{Alternate} {} {} {+calt}
+\fontspec_define_feature_option:nnnnn{Contextuals}{NoAlternate} {} {} {-calt}
+\fontspec_define_feature_option:nnnnn{Contextuals}{WordInitial} {8}{0}{+init}
+\fontspec_define_feature_option:nnnnn{Contextuals}{NoWordInitial}{8}{1}{-init}
+\fontspec_define_feature_option:nnnnn{Contextuals}{WordFinal} {8}{2}{+fina}
+\fontspec_define_feature_option:nnnnn{Contextuals}{NoWordFinal} {8}{3}{-fina}
+\fontspec_define_feature_option:nnnnn{Contextuals}{LineInitial} {8}{4}{}
+\fontspec_define_feature_option:nnnnn{Contextuals}{NoLineInitial}{8}{5}{}
+\fontspec_define_feature_option:nnnnn{Contextuals}{LineFinal} {8}{6}{+falt}
+\fontspec_define_feature_option:nnnnn{Contextuals}{NoLineFinal} {8}{7}{-falt}
+\fontspec_define_feature_option:nnnnn{Contextuals}{Inner} {8}{8}{+medi}
+\fontspec_define_feature_option:nnnnn{Contextuals}{NoInner} {8}{9}{-medi}
+\fontspec_define_font_feature:n{Diacritics}
+\fontspec_define_feature_option:nnnnn{Diacritics}{Show} {9}{0}{}
+\fontspec_define_feature_option:nnnnn{Diacritics}{Hide} {9}{1}{}
+\fontspec_define_feature_option:nnnnn{Diacritics}{Decompose} {9}{2}{}
+\fontspec_define_feature_option:nnnnn{Diacritics}{MarkToBase} {}{}{+mark}
+\fontspec_define_feature_option:nnnnn{Diacritics}{NoMarkToBase}{}{}{-mark}
+\fontspec_define_feature_option:nnnnn{Diacritics}{MarkToMark} {}{}{+mkmk}
+\fontspec_define_feature_option:nnnnn{Diacritics}{NoMarkToMark}{}{}{-mkmk}
+\fontspec_define_feature_option:nnnnn{Diacritics}{AboveBase} {}{}{+abvm}
+\fontspec_define_feature_option:nnnnn{Diacritics}{NoAboveBase} {}{}{-abvm}
+\fontspec_define_feature_option:nnnnn{Diacritics}{BelowBase} {}{}{+blwm}
+\fontspec_define_feature_option:nnnnn{Diacritics}{NoBelowBase} {}{}{-blwm}
+\fontspec_define_font_feature:n{Kerning}
+\fontspec_define_feature_option:nnnnn{Kerning}{Uppercase}{}{}{+cpsp}
+\fontspec_define_feature_option:nnnnn{Kerning}{On} {}{}{+kern}
+\fontspec_define_feature_option:nnnnn{Kerning}{Off} {}{}{-kern}
+\fontspec_define_font_feature:n{VerticalPosition}
+\fontspec_define_feature_option:nnnnn{VerticalPosition}{Normal} {10}{0}{}
+\fontspec_define_feature_option:nnnnn{VerticalPosition}{Superior} {10}{1}{+sups}
+\fontspec_define_feature_option:nnnnn{VerticalPosition}{Inferior} {10}{2}{+subs}
+\fontspec_define_feature_option:nnnnn{VerticalPosition}{Ordinal} {10}{3}{+ordn}
+\fontspec_define_feature_option:nnnnn{VerticalPosition}{Numerator} {} {} {+numr}
+\fontspec_define_feature_option:nnnnn{VerticalPosition}{Denominator}{} {} {+dnom}
+\fontspec_define_feature_option:nnnnn{VerticalPosition}{ScientificInferior}{}{}{+sinf}
+\fontspec_define_font_feature:n{Fractions}
+\fontspec_define_feature_option:nnnnn{Fractions}{On} {11}{1}{+frac}
+\fontspec_define_feature_option:nnnnn{Fractions}{Off} {11}{0}{-frac}
+\fontspec_define_feature_option:nnnnn{Fractions}{Diagonal} {11}{2}{}
+\fontspec_define_feature_option:nnnnn{Fractions}{Alternate}{} {} {+afrc}
+\fontspec_define_font_feature:n { Alternate }
+\keys_define:nn {fontspec}
+ {
+ Alternate .default:n = {0} ,
+ Alternate / unknown .code:n =
+ {
+ \fontspec_make_feature:nnx {17}{#1} { \fontspec_salt:n {#1} }
+ }
+ }
+\cs_set:Nn \fontspec_salt:n
+ { +salt = #1 }
+\fontspec_define_font_feature:n { Variant }
+\keys_define:nn {fontspec}
+ {
+ Variant .default:n = {0} ,
+ Variant / unknown .code:n =
+ {
+ \fontspec_make_feature:nnx {18}{#1} { +ss \two@digits {#1} }
+ }
+ }
+\aliasfontfeature{Variant}{StylisticSet}
+\fontspec_define_font_feature:n { CharacterVariant }
+\use:x
+ {
+ \cs_new:Npn \exp_not:N \fontspec_parse_cv:w
+ ##1 \c_colon_str ##2 \c_colon_str ##3 \exp_not:N \q_nil
+ {
+ \fontspec_make_numbered_feature:xn
+ { +cv \exp_not:N \two@digits {##1} } {##2}
+ }
+ \keys_define:nn {fontspec}
+ {
+ CharacterVariant / unknown .code:n =
+ {
+ \clist_map_inline:nn {##1}
+ {
+ \exp_not:N \fontspec_parse_cv:w
+ ####1 \c_colon_str 0 \c_colon_str \exp_not:N \q_nil
+ }
+ }
+ }
+ }
+\keys_define:nn {fontspec}
+ {
+ ScriptStyle .code:n = {
+ \fontspec_update_fontid:n {+ssty=0}
+ \fontspec_update_featstr:n{+sstyle}
+ },
+ ScriptScriptStyle .code:n = {
+ \fontspec_update_fontid:n {+ssty=1}
+ \fontspec_update_featstr:n{+ssstyle}
+ }
+ }
+\fontspec_define_font_feature:n{Style}
+\fontspec_define_feature_option:nnnnn{Style}{Alternate} {} {} {+salt}
+\fontspec_define_feature_option:nnnnn{Style}{Italic} {32}{2}{+ital}
+\fontspec_define_feature_option:nnnnn{Style}{Ruby} {28}{2}{+ruby}
+\fontspec_define_feature_option:nnnnn{Style}{Swash} {} {} {+swsh}
+\fontspec_define_feature_option:nnnnn{Style}{Historic} {} {} {+hist}
+\fontspec_define_feature_option:nnnnn{Style}{Display} {19}{1}{}
+\fontspec_define_feature_option:nnnnn{Style}{Engraved} {19}{2}{}
+\fontspec_define_feature_option:nnnnn{Style}{TitlingCaps} {19}{4}{+titl}
+\fontspec_define_feature_option:nnnnn{Style}{TallCaps} {19}{5}{}
+\fontspec_define_feature_option:nnnnn{Style}{HorizontalKana}{} {} {+hkna}
+\fontspec_define_feature_option:nnnnn{Style}{VerticalKana} {} {} {+vkna}
+\fontspec_define_numbered_feat:nnnn {Style} {MathScript} {+ssty} {0}
+\fontspec_define_numbered_feat:nnnn {Style} {MathScriptScript} {+ssty} {1}
+\fontspec_define_font_feature:n{CJKShape}
+\fontspec_define_feature_option:nnnnn{CJKShape}{Traditional}{20}{0} {+trad}
+\fontspec_define_feature_option:nnnnn{CJKShape}{Simplified} {20}{1} {+smpl}
+\fontspec_define_feature_option:nnnnn{CJKShape}{JIS1978} {20}{2} {+jp78}
+\fontspec_define_feature_option:nnnnn{CJKShape}{JIS1983} {20}{3} {+jp83}
+\fontspec_define_feature_option:nnnnn{CJKShape}{JIS1990} {20}{4} {+jp90}
+\fontspec_define_feature_option:nnnnn{CJKShape}{Expert} {20}{10}{+expt}
+\fontspec_define_feature_option:nnnnn{CJKShape}{NLC} {20}{13}{+nlck}
+\fontspec_define_font_feature:n{CharacterWidth}
+\fontspec_define_feature_option:nnnnn{CharacterWidth}{Proportional}{22}{0}{+pwid}
+\fontspec_define_feature_option:nnnnn{CharacterWidth}{Full}{22}{1}{+fwid}
+\fontspec_define_feature_option:nnnnn{CharacterWidth}{Half}{22}{2}{+hwid}
+\fontspec_define_feature_option:nnnnn{CharacterWidth}{Third}{22}{3}{+twid}
+\fontspec_define_feature_option:nnnnn{CharacterWidth}{Quarter}{22}{4}{+qwid}
+\fontspec_define_feature_option:nnnnn{CharacterWidth}{AlternateProportional}{22}{5}{+palt}
+\fontspec_define_feature_option:nnnnn{CharacterWidth}{AlternateHalf}{22}{6}{+halt}
+\fontspec_define_feature_option:nnnnn{CharacterWidth}{Default}{22}{7}{}
+\fontspec_define_feature_option:nnnnn{Annotation}{Off}{24}{0}{}
+\fontspec_define_feature_option:nnnnn{Annotation}{Box}{24}{1}{}
+\fontspec_define_feature_option:nnnnn{Annotation}{RoundedBox}{24}{2}{}
+\fontspec_define_feature_option:nnnnn{Annotation}{Circle}{24}{3}{}
+\fontspec_define_feature_option:nnnnn{Annotation}{BlackCircle}{24}{4}{}
+\fontspec_define_feature_option:nnnnn{Annotation}{Parenthesis}{24}{5}{}
+\fontspec_define_feature_option:nnnnn{Annotation}{Period}{24}{6}{}
+\fontspec_define_feature_option:nnnnn{Annotation}{RomanNumerals}{24}{7}{}
+\fontspec_define_feature_option:nnnnn{Annotation}{Diamond}{24}{8}{}
+\fontspec_define_feature_option:nnnnn{Annotation}{BlackSquare}{24}{9}{}
+\fontspec_define_feature_option:nnnnn{Annotation}{BlackRoundSquare}{24}{10}{}
+\fontspec_define_feature_option:nnnnn{Annotation}{DoubleCircle}{24}{11}{}
+\fontspec_define_font_feature:n { Annotation }
+\keys_define:nn {fontspec}
+ {
+ Annotation .default:n = {0} ,
+ Annotation / unknown .code:n =
+ {
+ \fontspec_make_feature:nnx {}{}
+ { +nalt=#1 }
+ }
+ }
+\keys_define:nn {fontspec}
+ {
+ Vertical .choice: ,
+ Vertical / RotatedGlyphs .code:n =
+ {
+ \bool_if:NTF \l_fontspec_icu_bool {
+ \fontspec_make_feature:nnn{}{}{+vrt2}
+ \fontspec_update_fontid:n {+vert}
+ \fontspec_update_featstr:n{vertical}
+ }{
+ \fontspec_update_fontid:n {+vert}
+ \fontspec_update_featstr:n{vertical}
+ }
+ }
+ }
+\newfontscript{Arabic}{arab} \newfontscript{Armenian}{armn}
+\newfontscript{Balinese}{bali} \newfontscript{Bengali}{beng}
+\newfontscript{Bopomofo}{bopo} \newfontscript{Braille}{brai}
+\newfontscript{Buginese}{bugi} \newfontscript{Buhid}{buhd}
+\newfontscript{Byzantine~Music}{byzm}
+\newfontscript{Canadian~Syllabics}{cans}
+\newfontscript{Cherokee}{cher}
+\newfontscript{CJK~Ideographic}{hani} \newfontscript{Coptic}{copt}
+\newfontscript{Cypriot~Syllabary}{cprt} \newfontscript{Cyrillic}{cyrl}
+\newfontscript{Default}{DFLT} \newfontscript{Deseret}{dsrt}
+\newfontscript{Devanagari}{deva} \newfontscript{Ethiopic}{ethi}
+\newfontscript{Georgian}{geor} \newfontscript{Glagolitic}{glag}
+\newfontscript{Gothic}{goth} \newfontscript{Greek}{grek}
+\newfontscript{Gujarati}{gujr} \newfontscript{Gurmukhi}{guru}
+\newfontscript{Hangul~Jamo}{jamo} \newfontscript{Hangul}{hang}
+\newfontscript{Hanunoo}{hano} \newfontscript{Hebrew}{hebr}
+\newfontscript{Hiragana~and~Katakana}{kana}
+\newfontscript{Javanese}{java} \newfontscript{Kannada}{knda}
+\newfontscript{Kharosthi}{khar} \newfontscript{Khmer}{khmr}
+\newfontscript{Lao}{lao~} \newfontscript{Latin}{latn}
+\newfontscript{Limbu}{limb} \newfontscript{Linear~B}{linb}
+\newfontscript{Malayalam}{mlym} \newfontscript{Math}{math}
+\newfontscript{Mongolian}{mong}
+\newfontscript{Musical~Symbols}{musc} \newfontscript{Myanmar}{mymr}
+\newfontscript{N'ko}{nko~} \newfontscript{Ogham}{ogam}
+\newfontscript{Old~Italic}{ital}
+\newfontscript{Old~Persian~Cuneiform}{xpeo}
+\newfontscript{Oriya}{orya} \newfontscript{Osmanya}{osma}
+\newfontscript{Phags-pa}{phag} \newfontscript{Phoenician}{phnx}
+\newfontscript{Runic}{runr} \newfontscript{Shavian}{shaw}
+\newfontscript{Sinhala}{sinh}
+\newfontscript{Sumero-Akkadian~Cuneiform}{xsux}
+\newfontscript{Syloti~Nagri}{sylo} \newfontscript{Syriac}{syrc}
+\newfontscript{Tagalog}{tglg} \newfontscript{Tagbanwa}{tagb}
+\newfontscript{Tai~Le}{tale} \newfontscript{Tai~Lu}{talu}
+\newfontscript{Tamil}{taml} \newfontscript{Telugu}{telu}
+\newfontscript{Thaana}{thaa} \newfontscript{Thai}{thai}
+\newfontscript{Tibetan}{tibt} \newfontscript{Tifinagh}{tfng}
+\newfontscript{Ugaritic~Cuneiform}{ugar}\newfontscript{Yi}{yi~~}
+\newfontscript{Kana}{kana}
+\newfontscript{Maths}{math}
+\newfontscript{CJK}{hani}
+\newfontlanguage{Abaza}{ABA}\newfontlanguage{Abkhazian}{ABK}
+\newfontlanguage{Adyghe}{ADY}\newfontlanguage{Afrikaans}{AFK}
+\newfontlanguage{Afar}{AFR}\newfontlanguage{Agaw}{AGW}
+\newfontlanguage{Altai}{ALT}\newfontlanguage{Amharic}{AMH}
+\newfontlanguage{Arabic}{ARA}\newfontlanguage{Aari}{ARI}
+\newfontlanguage{Arakanese}{ARK}\newfontlanguage{Assamese}{ASM}
+\newfontlanguage{Athapaskan}{ATH}\newfontlanguage{Avar}{AVR}
+\newfontlanguage{Awadhi}{AWA}\newfontlanguage{Aymara}{AYM}
+\newfontlanguage{Azeri}{AZE}\newfontlanguage{Badaga}{BAD}
+\newfontlanguage{Baghelkhandi}{BAG}\newfontlanguage{Balkar}{BAL}
+\newfontlanguage{Baule}{BAU}\newfontlanguage{Berber}{BBR}
+\newfontlanguage{Bench}{BCH}\newfontlanguage{Bible~Cree}{BCR}
+\newfontlanguage{Belarussian}{BEL}\newfontlanguage{Bemba}{BEM}
+\newfontlanguage{Bengali}{BEN}\newfontlanguage{Bulgarian}{BGR}
+\newfontlanguage{Bhili}{BHI}\newfontlanguage{Bhojpuri}{BHO}
+\newfontlanguage{Bikol}{BIK}\newfontlanguage{Bilen}{BIL}
+\newfontlanguage{Blackfoot}{BKF}\newfontlanguage{Balochi}{BLI}
+\newfontlanguage{Balante}{BLN}\newfontlanguage{Balti}{BLT}
+\newfontlanguage{Bambara}{BMB}\newfontlanguage{Bamileke}{BML}
+\newfontlanguage{Breton}{BRE}\newfontlanguage{Brahui}{BRH}
+\newfontlanguage{Braj~Bhasha}{BRI}\newfontlanguage{Burmese}{BRM}
+\newfontlanguage{Bashkir}{BSH}\newfontlanguage{Beti}{BTI}
+\newfontlanguage{Catalan}{CAT}\newfontlanguage{Cebuano}{CEB}
+\newfontlanguage{Chechen}{CHE}\newfontlanguage{Chaha~Gurage}{CHG}
+\newfontlanguage{Chattisgarhi}{CHH}\newfontlanguage{Chichewa}{CHI}
+\newfontlanguage{Chukchi}{CHK}\newfontlanguage{Chipewyan}{CHP}
+\newfontlanguage{Cherokee}{CHR}\newfontlanguage{Chuvash}{CHU}
+\newfontlanguage{Comorian}{CMR}\newfontlanguage{Coptic}{COP}
+\newfontlanguage{Cree}{CRE}\newfontlanguage{Carrier}{CRR}
+\newfontlanguage{Crimean~Tatar}{CRT}\newfontlanguage{Church~Slavonic}{CSL}
+\newfontlanguage{Czech}{CSY}\newfontlanguage{Danish}{DAN}
+\newfontlanguage{Dargwa}{DAR}\newfontlanguage{Woods~Cree}{DCR}
+\newfontlanguage{German}{DEU}
+\newfontlanguage{Dogri}{DGR}\newfontlanguage{Divehi}{DIV}
+\newfontlanguage{Djerma}{DJR}\newfontlanguage{Dangme}{DNG}
+\newfontlanguage{Dinka}{DNK}\newfontlanguage{Dungan}{DUN}
+\newfontlanguage{Dzongkha}{DZN}\newfontlanguage{Ebira}{EBI}
+\newfontlanguage{Eastern~Cree}{ECR}\newfontlanguage{Edo}{EDO}
+\newfontlanguage{Efik}{EFI}\newfontlanguage{Greek}{ELL}
+\newfontlanguage{English}{ENG}\newfontlanguage{Erzya}{ERZ}
+\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{Parsi}{FAR}
+\newfontlanguage{Persian}{FAR}
+\newfontlanguage{Finnish}{FIN}\newfontlanguage{Fijian}{FJI}
+\newfontlanguage{Flemish}{FLE}\newfontlanguage{Forest~Nenets}{FNE}
+\newfontlanguage{Fon}{FON}\newfontlanguage{Faroese}{FOS}
+\newfontlanguage{French}{FRA}\newfontlanguage{Frisian}{FRI}
+\newfontlanguage{Friulian}{FRL}\newfontlanguage{Futa}{FTA}
+\newfontlanguage{Fulani}{FUL}\newfontlanguage{Ga}{GAD}
+\newfontlanguage{Gaelic}{GAE}\newfontlanguage{Gagauz}{GAG}
+\newfontlanguage{Galician}{GAL}\newfontlanguage{Garshuni}{GAR}
+\newfontlanguage{Garhwali}{GAW}\newfontlanguage{Ge'ez}{GEZ}
+\newfontlanguage{Gilyak}{GIL}\newfontlanguage{Gumuz}{GMZ}
+\newfontlanguage{Gondi}{GON}\newfontlanguage{Greenlandic}{GRN}
+\newfontlanguage{Garo}{GRO}\newfontlanguage{Guarani}{GUA}
+\newfontlanguage{Gujarati}{GUJ}\newfontlanguage{Haitian}{HAI}
+\newfontlanguage{Halam}{HAL}\newfontlanguage{Harauti}{HAR}
+\newfontlanguage{Hausa}{HAU}\newfontlanguage{Hawaiin}{HAW}
+\newfontlanguage{Hammer-Banna}{HBN}\newfontlanguage{Hiligaynon}{HIL}
+\newfontlanguage{Hindi}{HIN}\newfontlanguage{High~Mari}{HMA}
+\newfontlanguage{Hindko}{HND}\newfontlanguage{Ho}{HO}
+\newfontlanguage{Harari}{HRI}\newfontlanguage{Croatian}{HRV}
+\newfontlanguage{Hungarian}{HUN}\newfontlanguage{Armenian}{HYE}
+\newfontlanguage{Igbo}{IBO}\newfontlanguage{Ijo}{IJO}
+\newfontlanguage{Ilokano}{ILO}\newfontlanguage{Indonesian}{IND}
+\newfontlanguage{Ingush}{ING}\newfontlanguage{Inuktitut}{INU}
+\newfontlanguage{Irish}{IRI}\newfontlanguage{Irish~Traditional}{IRT}
+\newfontlanguage{Icelandic}{ISL}\newfontlanguage{Inari~Sami}{ISM}
+\newfontlanguage{Italian}{ITA}\newfontlanguage{Hebrew}{IWR}
+\newfontlanguage{Javanese}{JAV}\newfontlanguage{Yiddish}{JII}
+\newfontlanguage{Japanese}{JAN}\newfontlanguage{Judezmo}{JUD}
+\newfontlanguage{Jula}{JUL}\newfontlanguage{Kabardian}{KAB}
+\newfontlanguage{Kachchi}{KAC}\newfontlanguage{Kalenjin}{KAL}
+\newfontlanguage{Kannada}{KAN}\newfontlanguage{Karachay}{KAR}
+\newfontlanguage{Georgian}{KAT}\newfontlanguage{Kazakh}{KAZ}
+\newfontlanguage{Kebena}{KEB}\newfontlanguage{Khutsuri~Georgian}{KGE}
+\newfontlanguage{Khakass}{KHA}\newfontlanguage{Khanty-Kazim}{KHK}
+\newfontlanguage{Khmer}{KHM}\newfontlanguage{Khanty-Shurishkar}{KHS}
+\newfontlanguage{Khanty-Vakhi}{KHV}\newfontlanguage{Khowar}{KHW}
+\newfontlanguage{Kikuyu}{KIK}\newfontlanguage{Kirghiz}{KIR}
+\newfontlanguage{Kisii}{KIS}\newfontlanguage{Kokni}{KKN}
+\newfontlanguage{Kalmyk}{KLM}\newfontlanguage{Kamba}{KMB}
+\newfontlanguage{Kumaoni}{KMN}\newfontlanguage{Komo}{KMO}
+\newfontlanguage{Komso}{KMS}\newfontlanguage{Kanuri}{KNR}
+\newfontlanguage{Kodagu}{KOD}\newfontlanguage{Korean~Old~Hangul}{KOH}
+\newfontlanguage{Konkani}{KOK}\newfontlanguage{Kikongo}{KON}
+\newfontlanguage{Komi-Permyak}{KOP}\newfontlanguage{Korean}{KOR}
+\newfontlanguage{Komi-Zyrian}{KOZ}\newfontlanguage{Kpelle}{KPL}
+\newfontlanguage{Krio}{KRI}\newfontlanguage{Karakalpak}{KRK}
+\newfontlanguage{Karelian}{KRL}\newfontlanguage{Karaim}{KRM}
+\newfontlanguage{Karen}{KRN}\newfontlanguage{Koorete}{KRT}
+\newfontlanguage{Kashmiri}{KSH}\newfontlanguage{Khasi}{KSI}
+\newfontlanguage{Kildin~Sami}{KSM}\newfontlanguage{Kui}{KUI}
+\newfontlanguage{Kulvi}{KUL}\newfontlanguage{Kumyk}{KUM}
+\newfontlanguage{Kurdish}{KUR}\newfontlanguage{Kurukh}{KUU}
+\newfontlanguage{Kuy}{KUY}\newfontlanguage{Koryak}{KYK}
+\newfontlanguage{Ladin}{LAD}\newfontlanguage{Lahuli}{LAH}
+\newfontlanguage{Lak}{LAK}\newfontlanguage{Lambani}{LAM}
+\newfontlanguage{Lao}{LAO}\newfontlanguage{Latin}{LAT}
+\newfontlanguage{Laz}{LAZ}\newfontlanguage{L-Cree}{LCR}
+\newfontlanguage{Ladakhi}{LDK}\newfontlanguage{Lezgi}{LEZ}
+\newfontlanguage{Lingala}{LIN}\newfontlanguage{Low~Mari}{LMA}
+\newfontlanguage{Limbu}{LMB}\newfontlanguage{Lomwe}{LMW}
+\newfontlanguage{Lower~Sorbian}{LSB}\newfontlanguage{Lule~Sami}{LSM}
+\newfontlanguage{Lithuanian}{LTH}\newfontlanguage{Luba}{LUB}
+\newfontlanguage{Luganda}{LUG}\newfontlanguage{Luhya}{LUH}
+\newfontlanguage{Luo}{LUO}\newfontlanguage{Latvian}{LVI}
+\newfontlanguage{Majang}{MAJ}\newfontlanguage{Makua}{MAK}
+\newfontlanguage{Malayalam~Traditional}{MAL}\newfontlanguage{Mansi}{MAN}
+\newfontlanguage{Marathi}{MAR}\newfontlanguage{Marwari}{MAW}
+\newfontlanguage{Mbundu}{MBN}\newfontlanguage{Manchu}{MCH}
+\newfontlanguage{Moose~Cree}{MCR}\newfontlanguage{Mende}{MDE}
+\newfontlanguage{Me'en}{MEN}\newfontlanguage{Mizo}{MIZ}
+\newfontlanguage{Macedonian}{MKD}\newfontlanguage{Male}{MLE}
+\newfontlanguage{Malagasy}{MLG}\newfontlanguage{Malinke}{MLN}
+\newfontlanguage{Malayalam~Reformed}{MLR}\newfontlanguage{Malay}{MLY}
+\newfontlanguage{Mandinka}{MND}\newfontlanguage{Mongolian}{MNG}
+\newfontlanguage{Manipuri}{MNI}\newfontlanguage{Maninka}{MNK}
+\newfontlanguage{Manx~Gaelic}{MNX}\newfontlanguage{Moksha}{MOK}
+\newfontlanguage{Moldavian}{MOL}\newfontlanguage{Mon}{MON}
+\newfontlanguage{Moroccan}{MOR}\newfontlanguage{Maori}{MRI}
+\newfontlanguage{Maithili}{MTH}\newfontlanguage{Maltese}{MTS}
+\newfontlanguage{Mundari}{MUN}\newfontlanguage{Naga-Assamese}{NAG}
+\newfontlanguage{Nanai}{NAN}\newfontlanguage{Naskapi}{NAS}
+\newfontlanguage{N-Cree}{NCR}\newfontlanguage{Ndebele}{NDB}
+\newfontlanguage{Ndonga}{NDG}\newfontlanguage{Nepali}{NEP}
+\newfontlanguage{Newari}{NEW}\newfontlanguage{Nagari}{NGR}
+\newfontlanguage{Norway~House~Cree}{NHC}\newfontlanguage{Nisi}{NIS}
+\newfontlanguage{Niuean}{NIU}\newfontlanguage{Nkole}{NKL}
+\newfontlanguage{N'ko}{NKO}\newfontlanguage{Dutch}{NLD}
+\newfontlanguage{Nogai}{NOG}\newfontlanguage{Norwegian}{NOR}
+\newfontlanguage{Northern~Sami}{NSM}\newfontlanguage{Northern~Tai}{NTA}
+\newfontlanguage{Esperanto}{NTO}\newfontlanguage{Nynorsk}{NYN}
+\newfontlanguage{Oji-Cree}{OCR}\newfontlanguage{Ojibway}{OJB}
+\newfontlanguage{Oriya}{ORI}\newfontlanguage{Oromo}{ORO}
+\newfontlanguage{Ossetian}{OSS}\newfontlanguage{Palestinian~Aramaic}{PAA}
+\newfontlanguage{Pali}{PAL}\newfontlanguage{Punjabi}{PAN}
+\newfontlanguage{Palpa}{PAP}\newfontlanguage{Pashto}{PAS}
+\newfontlanguage{Polytonic~Greek}{PGR}\newfontlanguage{Pilipino}{PIL}
+\newfontlanguage{Palaung}{PLG}\newfontlanguage{Polish}{PLK}
+\newfontlanguage{Provencal}{PRO}\newfontlanguage{Portuguese}{PTG}
+\newfontlanguage{Chin}{QIN}\newfontlanguage{Rajasthani}{RAJ}
+\newfontlanguage{R-Cree}{RCR}\newfontlanguage{Russian~Buriat}{RBU}
+\newfontlanguage{Riang}{RIA}\newfontlanguage{Rhaeto-Romanic}{RMS}
+\newfontlanguage{Romanian}{ROM}\newfontlanguage{Romany}{ROY}
+\newfontlanguage{Rusyn}{RSY}\newfontlanguage{Ruanda}{RUA}
+\newfontlanguage{Russian}{RUS}\newfontlanguage{Sadri}{SAD}
+\newfontlanguage{Sanskrit}{SAN}\newfontlanguage{Santali}{SAT}
+\newfontlanguage{Sayisi}{SAY}\newfontlanguage{Sekota}{SEK}
+\newfontlanguage{Selkup}{SEL}\newfontlanguage{Sango}{SGO}
+\newfontlanguage{Shan}{SHN}\newfontlanguage{Sibe}{SIB}
+\newfontlanguage{Sidamo}{SID}\newfontlanguage{Silte~Gurage}{SIG}
+\newfontlanguage{Skolt~Sami}{SKS}\newfontlanguage{Slovak}{SKY}
+\newfontlanguage{Slavey}{SLA}\newfontlanguage{Slovenian}{SLV}
+\newfontlanguage{Somali}{SML}\newfontlanguage{Samoan}{SMO}
+\newfontlanguage{Sena}{SNA}\newfontlanguage{Sindhi}{SND}
+\newfontlanguage{Sinhalese}{SNH}\newfontlanguage{Soninke}{SNK}
+\newfontlanguage{Sodo~Gurage}{SOG}\newfontlanguage{Sotho}{SOT}
+\newfontlanguage{Albanian}{SQI}\newfontlanguage{Serbian}{SRB}
+\newfontlanguage{Saraiki}{SRK}\newfontlanguage{Serer}{SRR}
+\newfontlanguage{South~Slavey}{SSL}\newfontlanguage{Southern~Sami}{SSM}
+\newfontlanguage{Suri}{SUR}\newfontlanguage{Svan}{SVA}
+\newfontlanguage{Swedish}{SVE}\newfontlanguage{Swadaya~Aramaic}{SWA}
+\newfontlanguage{Swahili}{SWK}\newfontlanguage{Swazi}{SWZ}
+\newfontlanguage{Sutu}{SXT}\newfontlanguage{Syriac}{SYR}
+\newfontlanguage{Tabasaran}{TAB}\newfontlanguage{Tajiki}{TAJ}
+\newfontlanguage{Tamil}{TAM}\newfontlanguage{Tatar}{TAT}
+\newfontlanguage{TH-Cree}{TCR}\newfontlanguage{Telugu}{TEL}
+\newfontlanguage{Tongan}{TGN}\newfontlanguage{Tigre}{TGR}
+\newfontlanguage{Tigrinya}{TGY}\newfontlanguage{Thai}{THA}
+\newfontlanguage{Tahitian}{THT}\newfontlanguage{Tibetan}{TIB}
+\newfontlanguage{Turkmen}{TKM}\newfontlanguage{Temne}{TMN}
+\newfontlanguage{Tswana}{TNA}\newfontlanguage{Tundra~Nenets}{TNE}
+\newfontlanguage{Tonga}{TNG}\newfontlanguage{Todo}{TOD}
+\newfontlanguage{Tsonga}{TSG}\newfontlanguage{Turoyo~Aramaic}{TUA}
+\newfontlanguage{Tulu}{TUL}\newfontlanguage{Tuvin}{TUV}
+\newfontlanguage{Twi}{TWI}\newfontlanguage{Udmurt}{UDM}
+\newfontlanguage{Ukrainian}{UKR}\newfontlanguage{Urdu}{URD}
+\newfontlanguage{Upper~Sorbian}{USB}\newfontlanguage{Uyghur}{UYG}
+\newfontlanguage{Uzbek}{UZB}\newfontlanguage{Venda}{VEN}
+\newfontlanguage{Vietnamese}{VIT}\newfontlanguage{Wa}{WA}
+\newfontlanguage{Wagdi}{WAG}\newfontlanguage{West-Cree}{WCR}
+\newfontlanguage{Welsh}{WEL}\newfontlanguage{Wolof}{WLF}
+\newfontlanguage{Tai~Lue}{XBD}\newfontlanguage{Xhosa}{XHS}
+\newfontlanguage{Yakut}{YAK}\newfontlanguage{Yoruba}{YBA}
+\newfontlanguage{Y-Cree}{YCR}\newfontlanguage{Yi~Classic}{YIC}
+\newfontlanguage{Yi~Modern}{YIM}\newfontlanguage{Chinese~Hong~Kong}{ZHH}
+\newfontlanguage{Chinese~Phonetic}{ZHP}
+\newfontlanguage{Chinese~Simplified}{ZHS}
+\newfontlanguage{Chinese~Traditional}{ZHT}\newfontlanguage{Zande}{ZND}
+\newfontlanguage{Zulu}{ZUL}
+\keys_define:nn {fontspec}
+ {
+ Language / Turkish .code:n =
+ {
+ \fontspec_check_lang:nTF {TRK} {
+ \int_set:Nn \l_fontspec_language_int {\l_fontspec_strnum_int}
+ \fontspec_update_fontid:n {+lang=Turkish}
+ \tl_set:Nn \l_fontspec_lang_tl {TRK}
+ }{
+ \fontspec_check_lang:nTF {TUR} {
+ \int_set:Nn \l_fontspec_language_int {\l_fontspec_strnum_int}
+ \fontspec_update_fontid:n {+lang=Turkish}
+ \tl_set:Nn \l_fontspec_lang_tl {TUR}
+ }{
+ \fontspec_warning:nx {language-not-exist} {Turkish}
+ \keys_set:nn {fontspec} {Language=Default}
+ }
+ }
+ }
+ }
+\keys_define:nn {fontspec}
+ {
+ Language / Default .code:n =
+ {
+ \fontspec_update_fontid:n {+lang=dflt}
+ \tl_set:Nn \l_fontspec_lang_tl {DFLT}
+ \int_zero:N \l_fontspec_language_int
+ }
+ }
+\keys_define:nn {fontspec}
+ {
+ RawFeature .code:n =
+ {
+ \fontspec_update_fontid:n {+Raw:#1}
+ \fontspec_update_featstr:n{#1}
+ }
+ }
+\providecommand*{\sidefault}{si}
+\DeclareRobustCommand{\sishape}{
+ \not@math@alphabet\sishape\relax
+ \fontshape\sidefault\selectfont
+}
+\DeclareTextFontCommand{\textsi}{\sishape}
+\cs_new:Nn \fontspec_blend_shape:nnn {
+ \bool_if:nTF
+ {
+ \str_if_eq_p:xx {\f@shape} {#2} &&
+ \cs_if_exist_p:c {\f@encoding/\f@family/\f@series/#3}
+ }
+ { \fontshape{#3}\selectfont }
+ { \fontshape{#1}\selectfont }
+}
+\DeclareRobustCommand \itshape {
+ \not@math@alphabet\itshape\mathit
+ \fontspec_blend_shape:nnn\itdefault\scdefault\sidefault
+}
+\DeclareRobustCommand \slshape {
+ \not@math@alphabet\slshape\relax
+ \fontspec_blend_shape:nnn\sldefault\scdefault\sidefault
+}
+\DeclareRobustCommand \scshape {
+ \not@math@alphabet\scshape\relax
+ \fontspec_blend_shape:nnn\scdefault\itdefault\sidefault
+}
+\DeclareRobustCommand \upshape {
+ \not@math@alphabet\upshape\relax
+ \fontspec_blend_shape:nnn\updefault\sidefault\scdefault
+}
+\@ifpackageloaded{euler}{
+ \bool_set_true:N \g_fontspec_package_euler_loaded_bool
+}{
+ \bool_set_false:N \g_fontspec_package_euler_loaded_bool
+}
+\cs_set:Nn \fontspec_setup_maths: {
+ \@ifpackageloaded{euler}{
+ \bool_if:NTF \g_fontspec_package_euler_loaded_bool {
+ \bool_set_true:N \g_fontspec_math_euler_bool
+ }{
+ \fontspec_error:n {euler-too-late}
+ }
+ }{}
+ \@ifpackageloaded{lucbmath}{\bool_set_true:N \g_fontspec_math_lucida_bool}{}
+ \@ifpackageloaded{lucidabr}{\bool_set_true:N \g_fontspec_math_lucida_bool}{}
+ \@ifpackageloaded{lucimatx}{\bool_set_true:N \g_fontspec_math_lucida_bool}{}
+ \DeclareSymbolFont{legacymaths}{OT1}{cmr}{m}{n}
+ \SetSymbolFont{legacymaths}{bold}{OT1}{cmr}{bx}{n}
+ \DeclareMathAccent{\acute} {\mathalpha}{legacymaths}{19}
+ \DeclareMathAccent{\grave} {\mathalpha}{legacymaths}{18}
+ \DeclareMathAccent{\ddot} {\mathalpha}{legacymaths}{127}
+ \DeclareMathAccent{\tilde} {\mathalpha}{legacymaths}{126}
+ \DeclareMathAccent{\bar} {\mathalpha}{legacymaths}{22}
+ \DeclareMathAccent{\breve} {\mathalpha}{legacymaths}{21}
+ \DeclareMathAccent{\check} {\mathalpha}{legacymaths}{20}
+ \DeclareMathAccent{\hat} {\mathalpha}{legacymaths}{94} % too bad, euler
+ \DeclareMathAccent{\dot} {\mathalpha}{legacymaths}{95}
+ \DeclareMathAccent{\mathring}{\mathalpha}{legacymaths}{23}
+ \group_begin:
+ \mathchardef\@tempa="603A \relax
+ \ifx\colon\@tempa
+ \DeclareMathSymbol{\colon}{\mathpunct}{legacymaths}{58}
+ \fi
+ \group_end:
+ \bool_if:NF \g_fontspec_math_euler_bool {
+ \DeclareMathSymbol{!}{\mathclose}{legacymaths}{33}
+ \DeclareMathSymbol{:}{\mathrel} {legacymaths}{58}
+ \DeclareMathSymbol{;}{\mathpunct}{legacymaths}{59}
+ \DeclareMathSymbol{?}{\mathclose}{legacymaths}{63}
+ \bool_if:NF \g_fontspec_math_lucida_bool {
+ \DeclareMathSymbol{0}{\mathalpha}{legacymaths}{`0}
+ \DeclareMathSymbol{1}{\mathalpha}{legacymaths}{`1}
+ \DeclareMathSymbol{2}{\mathalpha}{legacymaths}{`2}
+ \DeclareMathSymbol{3}{\mathalpha}{legacymaths}{`3}
+ \DeclareMathSymbol{4}{\mathalpha}{legacymaths}{`4}
+ \DeclareMathSymbol{5}{\mathalpha}{legacymaths}{`5}
+ \DeclareMathSymbol{6}{\mathalpha}{legacymaths}{`6}
+ \DeclareMathSymbol{7}{\mathalpha}{legacymaths}{`7}
+ \DeclareMathSymbol{8}{\mathalpha}{legacymaths}{`8}
+ \DeclareMathSymbol{9}{\mathalpha}{legacymaths}{`9}
+ \DeclareMathSymbol{\Gamma}{\mathalpha}{legacymaths}{0}
+ \DeclareMathSymbol{\Delta}{\mathalpha}{legacymaths}{1}
+ \DeclareMathSymbol{\Theta}{\mathalpha}{legacymaths}{2}
+ \DeclareMathSymbol{\Lambda}{\mathalpha}{legacymaths}{3}
+ \DeclareMathSymbol{\Xi}{\mathalpha}{legacymaths}{4}
+ \DeclareMathSymbol{\Pi}{\mathalpha}{legacymaths}{5}
+ \DeclareMathSymbol{\Sigma}{\mathalpha}{legacymaths}{6}
+ \DeclareMathSymbol{\Upsilon}{\mathalpha}{legacymaths}{7}
+ \DeclareMathSymbol{\Phi}{\mathalpha}{legacymaths}{8}
+ \DeclareMathSymbol{\Psi}{\mathalpha}{legacymaths}{9}
+ \DeclareMathSymbol{\Omega}{\mathalpha}{legacymaths}{10}
+ \DeclareMathSymbol{+}{\mathbin}{legacymaths}{43}
+ \DeclareMathSymbol{=}{\mathrel}{legacymaths}{61}
+ \DeclareMathDelimiter{(}{\mathopen} {legacymaths}{40}{largesymbols}{0}
+ \DeclareMathDelimiter{)}{\mathclose}{legacymaths}{41}{largesymbols}{1}
+ \DeclareMathDelimiter{[}{\mathopen} {legacymaths}{91}{largesymbols}{2}
+ \DeclareMathDelimiter{]}{\mathclose}{legacymaths}{93}{largesymbols}{3}
+ \DeclareMathDelimiter{/}{\mathord}{legacymaths}{47}{largesymbols}{14}
+ \DeclareMathSymbol{\mathdollar}{\mathord}{legacymaths}{36}
+ }
+ }
+ \DeclareSymbolFont{operators}\g_fontspec_encoding_tl\g_fontspec_mathrm_tl\mddefault\updefault
+ \SetSymbolFont{operators}{normal}\g_fontspec_encoding_tl\g_fontspec_mathrm_tl\mddefault\updefault
+ \SetMathAlphabet\mathrm{normal}\g_fontspec_encoding_tl\g_fontspec_mathrm_tl\mddefault\updefault
+ \SetMathAlphabet\mathit{normal}\g_fontspec_encoding_tl\g_fontspec_mathrm_tl\mddefault\itdefault
+ \SetMathAlphabet\mathbf{normal}\g_fontspec_encoding_tl\g_fontspec_mathrm_tl\bfdefault\updefault
+ \SetMathAlphabet\mathsf{normal}\g_fontspec_encoding_tl\g_fontspec_mathsf_tl\mddefault\updefault
+ \SetMathAlphabet\mathtt{normal}\g_fontspec_encoding_tl\g_fontspec_mathtt_tl\mddefault\updefault
+ \SetSymbolFont{operators}{bold}\g_fontspec_encoding_tl\g_fontspec_mathrm_tl\bfdefault\updefault
+ \tl_if_empty:NTF \g_fontspec_bfmathrm_tl {
+ \SetMathAlphabet\mathrm{bold}\g_fontspec_encoding_tl\g_fontspec_mathrm_tl\bfdefault\updefault
+ \SetMathAlphabet\mathit{bold}\g_fontspec_encoding_tl\g_fontspec_mathrm_tl\bfdefault\itdefault
+ }{
+ \SetMathAlphabet\mathrm{bold}\g_fontspec_encoding_tl\g_fontspec_bfmathrm_tl\mddefault\updefault
+ \SetMathAlphabet\mathbf{bold}\g_fontspec_encoding_tl\g_fontspec_bfmathrm_tl\bfdefault\updefault
+ \SetMathAlphabet\mathit{bold}\g_fontspec_encoding_tl\g_fontspec_bfmathrm_tl\mddefault\itdefault
+ }
+ \SetMathAlphabet\mathsf{bold}\g_fontspec_encoding_tl\g_fontspec_mathsf_tl\bfdefault\updefault
+ \SetMathAlphabet\mathtt{bold}\g_fontspec_encoding_tl\g_fontspec_mathtt_tl\bfdefault\updefault
+}
+\cs_new:Nn \fontspec_maybe_setup_maths: {
+ \@ifpackageloaded{anttor}{
+ \ifx\define@antt@mathversions a\bool_set_false:N \g_fontspec_math_bool\fi}{}
+ \@ifpackageloaded{arev}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{eulervm}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{mathdesign}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{concmath}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{cmbright}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{mathesf}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{gfsartemisia}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{gfsneohellenic}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{iwona}{
+ \ifx\define@iwona@mathversions a\bool_set_false:N \g_fontspec_math_bool\fi}{}
+ \@ifpackageloaded{kpfonts}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{kmath}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{kurier}{
+ \ifx\define@kurier@mathversions a\bool_set_false:N \g_fontspec_math_bool\fi}{}
+ \@ifpackageloaded{fouriernc}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{fourier}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{lmodern}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{mathpazo}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{mathptmx}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{MinionPro}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{unicode-math}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \@ifpackageloaded{breqn}{\bool_set_false:N \g_fontspec_math_bool}{}
+ \bool_if:NT \g_fontspec_math_bool {
+ \fontspec_info:n {setup-math}
+ \fontspec_setup_maths:
+ }
+}
+\AtBeginDocument{\fontspec_maybe_setup_maths:}
+\bool_if:NT \g_fontspec_cfg_bool {
+ \InputIfFileExists{fontspec.cfg}
+ {}
+ {\typeout{No~ fontspec.cfg~ file~ found;~ no~ configuration~ loaded.}}
+}
+\tl_set:Nn \zf@enc { \g_fontspec_encoding_tl }
+\tl_set:Nn \zf@family { \l_fontspec_family_tl }
+\tl_set:Nn \zf@basefont { \l_fontspec_font }
+\cs_set_eq:NN \zf@fontspec \fontspec_select:nn
+\ExplSyntaxOff
+%%
+%% Copyright 2004--2011 Will Robertson <wspr81@gmail.com>
+%% Copyright 2009--2010 Khaled Hosny <khaledhosny@eglug.org>
+%%
+%% Distributable under the LaTeX Project Public License,
+%% version 1.3c or higher (your choice). The latest version of
+%% this license is at: http://www.latex-project.org/lppl.txt
+%%
+%% This work is "author-maintained" by Will Robertson.
+%%
+%% This work consists of this file fontspec.dtx
+%% and the derived files fontspec.sty,
+%% fontspec.lua,
+%% fontspec.cfg,
+%% fontspec-xetex.tex,
+%% fontspec-luatex.tex,
+%% and fontspec.pdf.
+%%
+%%
+%% End of file `fontspec-xetex.sty'.
diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec.lua b/Master/texmf-dist/tex/latex/fontspec/fontspec.lua
index a6b5528391a..869bc5879dd 100644
--- a/Master/texmf-dist/tex/latex/fontspec/fontspec.lua
+++ b/Master/texmf-dist/tex/latex/fontspec/fontspec.lua
@@ -36,14 +36,14 @@ function fontspec.sprint (...) tex.sprint(luatexbase.catcodetables['latex-packag
local function check_script(id, script)
local s = string.lower(script)
if id and id > 0 then
- local otfdata = fonts.ids[id].shared.otfdata
+ local otfdata = fonts.identifiers[id].shared.otfdata
if otfdata then
local features = otfdata.luatex.features
for i,_ in pairs(features) do
for j,_ in pairs(features[i]) do
if features[i][j][s] then
fontspec.log("script '%s' exists in font '%s'",
- script, fonts.ids[id].fullname)
+ script, fonts.identifiers[id].fullname)
return true
end
end
@@ -55,14 +55,14 @@ local function check_language(id, language, script)
local s = string.lower(script)
local l = string.lower(language)
if id and id > 0 then
- local otfdata = fonts.ids[id].shared.otfdata
+ local otfdata = fonts.identifiers[id].shared.otfdata
if otfdata then
local features = otfdata.luatex.features
for i,_ in pairs(features) do
for j,_ in pairs(features[i]) do
if features[i][j][s] and features[i][j][s][l] then
fontspec.log("language '%s' for script '%s' exists in font '%s'",
- language, script, fonts.ids[id].fullname)
+ language, script, fonts.identifiers[id].fullname)
return true
end
end
@@ -75,14 +75,14 @@ local function check_feature(id, feature, language, script)
local l = string.lower(language)
local f = string.lower(feature:gsub("^[+-]", ""))
if id and id > 0 then
- local otfdata = fonts.ids[id].shared.otfdata
+ local otfdata = fonts.identifiers[id].shared.otfdata
if otfdata then
local features = otfdata.luatex.features
for i,_ in pairs(features) do
if features[i][f] and features[i][f][s] then
if features[i][f][s][l] == true then
fontspec.log("feature '%s' for language '%s' and script '%s' exists in font '%s'",
- feature, language, script, fonts.ids[id].fullname)
+ feature, language, script, fonts.identifiers[id].fullname)
return true
end
end
@@ -120,7 +120,7 @@ function fontspec.check_ot_feat(fnt, feat, lang, script)
end
end
function fontspec.mathfontdimen(fnt, str)
- local mathdimens = fonts.ids[font.id(fnt)].MathConstants
+ local mathdimens = fonts.identifiers[font.id(fnt)].MathConstants
if mathdimens then
local m = mathdimens[str]
if m then
@@ -133,6 +133,24 @@ function fontspec.mathfontdimen(fnt, str)
fontspec.sprint("0pt")
end
end
+local function set_capheight(fontdata)
+ local capheight
+ local units = fontdata.units
+ local size = fontdata.size
+ local otfdata = fontdata.shared.otfdata
+
+ if otfdata.pfminfo.os2_capheight > 0 then
+ capheight = otfdata.pfminfo.os2_capheight / units * size
+ else
+ if fontdata.characters[string.byte("X")] then
+ capheight = fontdata.characters[string.byte("X")].height
+ else
+ capheight = otfdata.metadata.ascent / units * size
+ end
+ end
+ fontdata.parameters[8] = capheight
+end
+luatexbase.add_to_callback("luaotfload.patch_font", set_capheight, "fontspec.set_capheight")
--
-- Copyright 2004--2011 Will Robertson <wspr81@gmail.com>
-- Copyright 2009--2010 Khaled Hosny <khaledhosny@eglug.org>
diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec.sty b/Master/texmf-dist/tex/latex/fontspec/fontspec.sty
index 9586ccfcf51..14c282e8727 100644
--- a/Master/texmf-dist/tex/latex/fontspec/fontspec.sty
+++ b/Master/texmf-dist/tex/latex/fontspec/fontspec.sty
@@ -14,11 +14,11 @@
%%
%%
\ProvidesPackage{fontspec}
- [2011/02/26 v2.1f Advanced font selection for XeLaTeX/LuaLaTeX]
+ [2011/09/13 v2.2 Advanced font selection for XeLaTeX/LuaLaTeX]
-\RequirePackage{expl3,xparse}
-\input binhex.tex % before expl syntax!
+\RequirePackage{expl3}[2011/09/05]
+\RequirePackage{xparse}
\ExplSyntaxOn
\msg_new:nnn {fontspec} {cannot-use-pdftex}
{
@@ -36,17 +36,6 @@
\msg_fatal:nn {fontspec} {cannot-use-pdftex}
}
}
-\xetex_if_engine:TF
- { \cs_new_eq:NN \xetex_or_luatex:nn \use_i:nn }
- { \luatex_if_engine:T
- { \cs_new_eq:NN \xetex_or_luatex:nn \use_ii:nn }
- }
-\xetex_if_engine:TF
- { \cs_new:Npn \xetex_or_luatex:nnn #1#2#3 {#1{#2}} }
- {
- \luatex_if_engine:T
- { \cs_new:Npn \xetex_or_luatex:nnn #1#2#3 {#1{#3}} }
- }
\bool_new:N \l_fontspec_firsttime_bool
\bool_new:N \l_fontspec_nobf_bool
\bool_new:N \l_fontspec_noit_bool
@@ -64,31 +53,18 @@
\int_new:N \l_fontspec_script_int
\int_new:N \l_fontspec_language_int
\int_new:N \l_fontspec_strnum_int
-\cs_set:Npn \use:x #1 { \edef\@tempa{#1}\@tempa }
-
-\cs_if_exist:NF \str_if_eq:xxTF {
- \cs_set_eq:NN \str_if_eq_p:xx \tl_if_eq_p:xx
- \cs_set_eq:NN \str_if_eq:xxTF \tl_if_eq:xxTF
- \cs_set_eq:NN \str_if_eq:xxT \tl_if_eq:xxT
- \cs_set_eq:NN \str_if_eq:xxF \tl_if_eq:xxF
- \cs_set_eq:NN \str_if_eq_p:nn \tl_if_eq_p:nn
- \cs_set_eq:NN \str_if_eq:nnTF \tl_if_eq:nnTF
- \cs_set_eq:NN \str_if_eq:nnT \tl_if_eq:nnT
- \cs_set_eq:NN \str_if_eq:nnF \tl_if_eq:nnF
-}
+\fp_new:N \l_fontspec_tmpa_fp
+\fp_new:N \l_fontspec_tmpb_fp
+\dim_new:N \l_fontspec_tmpa_dim
+\dim_new:N \l_fontspec_tmpb_dim
+\dim_new:N \l_fontspec_tmpc_dim
+\tl_set:Nx \c_colon_str { \tl_to_str:N : }
\cs_set:Npn \use_v:nnnnn #1#2#3#4#5 {#5}
\cs_set:Npn \use_iv:nnnnn #1#2#3#4#5 {#4}
\cs_generate_variant:Nn \str_if_eq:nnTF {nv}
\cs_generate_variant:Nn \int_set:Nn {Nv}
\cs_generate_variant:Nn \tl_gset:Nn {cV}
-\cs_new:Npn \fontspec_setkeys:xx #1#2
- {
- \use:x { \exp_not:N \setkeys*[zf]{#1}{#2} }
- }
-\cs_new:Npn \fontspec_setkeys:xxx #1#2#3
- {
- \use:x { \exp_not:N \setkeys*[zf@#1]{#2}{#3} }
- }
+\cs_generate_variant:Nn \keys_set:nn {nx}
\cs_new:Npn \fontspec_error:n { \msg_error:nn {fontspec} }
\cs_new:Npn \fontspec_error:nx { \msg_error:nnx {fontspec} }
\cs_new:Npn \fontspec_warning:n { \msg_warning:nn {fontspec} }
@@ -123,22 +99,14 @@
{
'\l_fontspec_fontname_tl'~ does~ not~ contain~ glyph~ #1.
}
-\msg_new:nnnn {fontspec} {unknown-options}
-{
- The~ following~ font~ options~ are~ not~ recognised:\\
- \space\space\space\space #1
-}
-{
- There~ is~ probably~ a~ typo~ in~ the~ font~ feature~ selection.
-}
\msg_new:nnnn {fontspec} {euler-too-late}
{
The~ euler~ package~ must~ be~ loaded~ BEFORE~ fontspec.
}
{
- fontspec~ only~ overwrites~ euler's~ attempt~ to\\
- define~ the~ maths~ text~ fonts~ if~ fontspec~ is\\
- loaded~ after~ euler.~ Type~ <return>~ to~ proceed\\
+ fontspec~ only~ overwrites~ euler's~ attempt~ to~
+ define~ the~ maths~ text~ fonts~ if~ fontspec~ is~
+ loaded~ after~ euler.~ Type~ <return>~ to~ proceed~
with~ incorrect~ \string\mathit,~ \string\mathbf,~ etc.
}
\msg_new:nnnn {fontspec} {no-xcolor}
@@ -146,7 +114,7 @@
Cannot~ load~ named~ colours~ without~ the~ xcolor~ package.
}
{
- Sorry,~ I~ can't~ do~ anything~ to~ help.~ Instead~ of~ loading\\
+ Sorry,~ I~ can't~ do~ anything~ to~ help.~ Instead~ of~ loading~
the~ color~ package,~ use~ xcolor~ instead.~ It's~ better.
}
\msg_new:nnnn {fontspec} {unknown-color-model}
@@ -154,12 +122,12 @@
Error~ loading~ colour~ `#1';~ unknown~ colour~ model.
}
{
- Sorry,~ I~ can't~ do~ anything~ to~ help.~ Please~ report~ this~ error\\
+ Sorry,~ I~ can't~ do~ anything~ to~ help.~ Please~ report~ this~ error~
to~ my~ developer~ with~ a~ minimal~ example~ that~ causes~ the~ problem.
}
\msg_new:nnn {fontspec} {addfontfeatures-ignored}
{
- \string\addfontfeature (s)~ ignored;\\
+ \string\addfontfeature (s)~ ignored;~
it~ cannot~ be~ used~ with~ a~ font~ that~ wasn't~ selected~ by~ fontspec.
}
\msg_new:nnn {fontspec} {feature-option-overwrite}
@@ -177,24 +145,24 @@
}
\msg_new:nnn {fontspec} {aat-feature-not-exist}
{
- '\XKV@tfam=\XKV@tkey'~ feature~ not~ supported\\
+ '\l_keys_key_tl=\l_keys_value_tl'~ feature~ not~ supported~
for~ AAT~ font~ '\l_fontspec_fontname_tl'.
}
\msg_new:nnn {fontspec} {aat-feature-not-exist-in-font}
{
- AAT~ feature~ '\XKV@tfam=\XKV@tkey'~ (#1)~ not~ available\\
+ AAT~ feature~ '\l_keys_key_tl=\l_keys_value_tl'~ (#1)~ not~ available~
in~ font~ '\l_fontspec_fontname_tl'.
}
\msg_new:nnn {fontspec} {icu-feature-not-exist}
{
- '\XKV@tfam=\XKV@tkey'~ feature~ not~ supported\\
+ '\l_keys_key_tl=\l_keys_value_tl'~ feature~ not~ supported~
for~ ICU~ font~ '\l_fontspec_fontname_tl'
}
\msg_new:nnn {fontspec} {icu-feature-not-exist-in-font}
{
- OpenType~ feature~ '\XKV@tfam=\XKV@tkey'~ (#1)~ not~ available\\
- for~ font~ '\l_fontspec_fontname_tl', \\
- with~ script~ '\l_fontspec_script_name_tl',~ and~ language~ '\l_fontspec_lang_name_tl'.
+ OpenType~ feature~ '\l_keys_key_tl=\l_keys_value_tl'~ (#1)~ not~ available~
+ for~ font~ '\l_fontspec_fontname_tl'~
+ with~ script~ '\l_fontspec_script_name_tl'~ and~ language~ '\l_fontspec_lang_name_tl'.
}
\msg_new:nnn {fontspec} {no-opticals}
{
@@ -202,7 +170,7 @@
}
\msg_new:nnn {fontspec} {language-not-exist}
{
- Language~ '#1'~ not~ available\\
+ Language~ '#1'~ not~ available~
for~ font~ '\l_fontspec_fontname_tl'~
with~ script~ '\l_fontspec_script_name_tl'.\\
'Default'~ language~ used~ instead.
@@ -230,26 +198,11 @@
}
\msg_new:nnn {fontspec} {defining-font}
{
- Defining~ font~ family~'\zf@family'~ for~ font~ '#2'~ with~ options~ [\g_fontspec_default_fontopts_tl #1].
-}
-\msg_new:nnn {fontspec} {defining-raw}
-{
- Defining~ shape~
- '\prg_case_str:nnn {#1} {
- {\mddefault/\updefault} {normal}
- {\mddefault/\scdefault} {small~ caps}
- {\bfdefault/\updefault} {bold}
- {\bfdefault/\scdefault} {bold~ small~ caps}
- {\mddefault/\itdefault} {italic}
- {\mddefault/\sidefault} {italic~ small~ caps}
- {\bfdefault/\itdefault} {bold~ italic}
- {\bfdefault/\sidefault} {bold~ italic~ small~ caps}
- } {#1}'~
- with~ NFSS~ spec.: \\
- \l_fontspec_nfss_tl
- \tl_if_empty:NF \l_fontspec_postadjust_tl {
- \\ and~ font~ adjustment~ code: \\ \l_fontspec_postadjust_tl
- }
+ Font~ family~'\l_fontspec_family_tl'~ created~ for~ font~ '#2'~
+ with~ options~ [\g_fontspec_default_fontopts_tl #1].\\
+ \\
+ This~ font~ family~ consists~ of~ the~ following~ shapes:
+ \l_fontspec_defined_shapes_tl
}
\msg_new:nnn {fontspec} {no-font-shape}
{
@@ -302,1947 +255,9 @@
}
\ExecuteOptions{config,math}
\ProcessOptions*
-\RequirePackage{calc}
-\RequirePackage{xkeyval}[2005/05/07]
\RequirePackage{fontspec-patches}
-\xetex_or_luatex:nnn {\tl_set:Nn \zf@enc} {EU1} {EU2}
-\tl_set:Nn \rmdefault {lmr}
-\tl_set:Nn \sfdefault {lmss}
-\tl_set:Nn \ttdefault {lmtt}
-\RequirePackage[\zf@enc]{fontenc}
-\tl_set_eq:NN \UTFencname \zf@enc % for xunicode
-\tl_set_eq:NN \cyrillicencoding \zf@enc
-\tl_set_eq:NN \latinencoding \zf@enc
-\g@addto@macro \document {
- \tl_set_eq:NN \cyrillicencoding \zf@enc
- \tl_set_eq:NN \latinencoding \zf@enc
-}
-\xetex_or_luatex:nn
-{
- \RequirePackage{xunicode}
-}
-{
- \cs_set_eq:NN \fontspec_tmp: \XeTeXpicfile
- \cs_set:Npn \XeTeXpicfile {}
- \RequirePackage{xunicode}
- \cs_set_eq:NN \XeTeXpicfile \fontspec_tmp:
-}
-\DeclareDocumentCommand \fontspec { O{} m } {
- \fontencoding {\zf@enc}
- \fontspec_set_family:Nnn \f@family {#1}{#2}
- \selectfont
- \ignorespaces
-}
-\DeclareDocumentCommand \setmainfont { O{} m } {
- \fontspec_set_family:Nnn \rmdefault {#1}{#2}
- \normalfont
-}
-\DeclareDocumentCommand \setsansfont { O{} m } {
- \fontspec_set_family:Nnn \sfdefault {#1}{#2}
- \normalfont
-}
-\DeclareDocumentCommand \setmonofont { O{} m } {
- \fontspec_set_family:Nnn \ttdefault {#1}{#2}
- \normalfont
-}
-\cs_set_eq:NN \setromanfont \setmainfont
-\DeclareDocumentCommand \setmathrm { O{} m } {
- \fontspec_set_family:Nnn \g_fontspec_mathrm_tl {#1}{#2}
-}
-\DeclareDocumentCommand \setboldmathrm { O{} m } {
- \fontspec_set_family:Nnn \g_fontspec_bfmathrm_tl {#1}{#2}
-}
-\DeclareDocumentCommand \setmathsf { O{} m } {
- \fontspec_set_family:Nnn \g_fontspec_mathsf_tl {#1}{#2}
-}
-\DeclareDocumentCommand \setmathtt { O{} m } {
- \fontspec_set_family:Nnn \g_fontspec_mathtt_tl {#1}{#2}
-}
-\@onlypreamble\setmathrm
-\@onlypreamble\setboldmathrm
-\@onlypreamble\setmathsf
-\@onlypreamble\setmathtt
-\def\g_fontspec_mathrm_tl{\rmdefault}
-\def\g_fontspec_mathsf_tl{\sfdefault}
-\def\g_fontspec_mathtt_tl{\ttdefault}
-\tl_clear:N \g_fontspec_bfmathrm_tl
-\DeclareDocumentCommand \newfontfamily { m O{} m } {
- \fontspec_select:nn{#2}{#3}
- \use:x {
- \exp_not:N \DeclareRobustCommand \exp_not:N #1 {
- \exp_not:N \fontencoding {\zf@enc}
- \exp_not:N \fontfamily {\zf@family} \exp_not:N \selectfont
- }
- }
-}
-\DeclareDocumentCommand \newfontface { m O{} m } {
- \newfontfamily #1 [ BoldFont={},ItalicFont={},SmallCapsFont={},#2 ] {#3}
-}
-\DeclareDocumentCommand \defaultfontfeatures {m} {
- \tl_set:Nn \g_fontspec_default_fontopts_tl {#1,}
-}
-\tl_clear:N \g_fontspec_default_fontopts_tl
-\DeclareDocumentCommand \addfontfeatures {m} {
- \ifcsname zf@family@fontdef\f@family\endcsname
- \group_begin:
- \tl_clear:N \g_fontspec_default_fontopts_tl
- \use:x {
- \exp_not:N\fontspec_select:nn
- {\csname zf@family@options\f@family\endcsname,#1}
- {\csname zf@family@fontname\f@family\endcsname}
- }
- \group_end:
- \fontfamily\zf@family\selectfont
- \else
- \fontspec_warning:n {addfontfeatures-ignored}
- \fi
- \ignorespaces
-}
-\cs_set_eq:NN \addfontfeature \addfontfeatures
-\DeclareDocumentCommand \newfontfeature {mm} {
- \define@key[zf]{options}{#1}[]{
- \fontspec_update_fontid:n {+zf-#1}
- \fontspec_update_featstr:n {#2}
- }
-}
-\DeclareDocumentCommand \newAATfeature {mmmm} {
- \unless\ifcsname zf@options@#1\endcsname
- \fontspec_define_font_feature:n{#1}
- \fi
- \key@ifundefined[zf]{#1}{#2}{}{
- \fontspec_warning:nxx {feature-option-overwrite}{#1}{#2}
- }
- \fontspec_define_feature_option:nnnnn{#1}{#2}{#3}{#4}{}
-}
-\DeclareDocumentCommand \newICUfeature {mmm} {
- \unless\ifcsname zf@options@#1\endcsname
- \fontspec_define_font_feature:n{#1}
- \fi
- \key@ifundefined[zf]{#1}{#2}{}{
- \fontspec_warning:nxx {feature-option-overwrite}{#1}{#2}
- }
- \fontspec_define_feature_option:nnnnn{#1}{#2}{}{}{#3}
-}
-\cs_set_eq:NN \newopentypefeature \newICUfeature
-\DeclareDocumentCommand \aliasfontfeature {mm} {\multi@alias@key{#1}{#2}}
-\DeclareDocumentCommand \aliasfontfeatureoption {mmm} {
- \keyval@alias@key[zf@feat]{#1}{#2}{#3}
-}
-\DeclareDocumentCommand \newfontscript {mm}
-{
- \fontspec_new_script:nn {#1} {#2}
- \fontspec_new_script:nn {#2} {#2}
-}
-\cs_new:Npn \fontspec_new_script:nn #1#2
-{
- \define@key[zf@feat]{Script}{#1}[]{
- \fontspec_check_script:nTF {#2} {
- \fontspec_update_fontid:n {+script=#1}
- \tl_set:Nn \l_fontspec_script_tl {#2}
- \int_set:Nn \l_fontspec_script_int {\l_fontspec_strnum_int}
- }{
- \fontspec_check_script:nTF {latn} {
- \fontspec_warning:nx {script-not-exist-latn} {#1}
- \setkeys[zf@feat]{Script}{Latin}
- }{
- \fontspec_warning:nx {script-not-exist} {#1}
- }
- }
- }
-}
-\DeclareDocumentCommand \newfontlanguage {mm}
-{
- \fontspec_new_lang:nn {#1} {#2}
- \fontspec_new_lang:nn {#2} {#2}
-}
-\cs_new:Npn \fontspec_new_lang:nn #1#2
-{
- \define@key[zf@feat]{Lang}{#1}[]{
- \fontspec_check_lang:nTF {#2} {
- \fontspec_update_fontid:n {+lang=#1}
- \tl_set:Nn \l_fontspec_lang_tl {#2}
- \int_set:Nn \l_fontspec_language_int {\l_fontspec_strnum_int}
- }{
- \fontspec_warning:nx {language-not-exist} {#1}
- \setkeys[zf@feat]{Lang}{Default}
- }
- }
-}
-\DeclareDocumentCommand \DeclareFontsExtensions {m}
-{
- \tl_set:Nx \l_fontspec_extensions_clist { \zap@space #1~\@empty }
-}
-\DeclareFontsExtensions{.otf,.ttf,.OTF,.TTF,.ttc,.TTC,.dfont}
-\prg_new_conditional:Nnn \fontspec_if_fontspec_font: {TF,T,F} {
- \cs_if_exist:cTF {g_fontspec_ \f@family _prop} {
- \prg_return_true:
- }{
- \prg_return_false:
- }
-}
-\prg_new_conditional:Nnn \fontspec_if_aat_feature:nn {TF,T,F} {
- \fontspec_if_fontspec_font:TF {
- \fontspec_font_set:Nnn \zf@basefont {\use:c{zf@family@fontdef\f@family}} {\f@size pt}
- \bool_if:NTF \l_fontspec_atsui_bool {
- \fontspec_make_AAT_feature_string:nnTF {#1}{#2}
- \prg_return_true: \prg_return_false:
- }{
- \prg_return_false:
- }
- }{
- \prg_return_false:
- }
-}
-\prg_new_conditional:Nnn \fontspec_if_opentype: {TF,T,F} {
- \fontspec_if_fontspec_font:TF {
- \fontspec_font_set:Nnn \zf@basefont {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt}
- \fontspec_set_font_type:
- \bool_if:NTF \l_fontspec_icu_bool \prg_return_true: \prg_return_false:
- }{
- \prg_return_false:
- }
-}
-\prg_new_conditional:Nnn \fontspec_if_feature:n {TF,T,F} {
- \fontspec_if_fontspec_font:TF {
- \fontspec_font_set:Nnn \zf@basefont {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt}
- \fontspec_set_font_type:
- \bool_if:NTF \l_fontspec_icu_bool {
- \int_set:Nv \l_fontspec_script_int {g_fontspec_script_num_(\f@family)_tl}
- \int_set:Nv \l_fontspec_language_int {g_fontspec_lang_num_(\f@family)_tl}
- \tl_set:Nv \l_fontspec_script_tl {g_fontspec_script_(\f@family)_tl}
- \tl_set:Nv \l_fontspec_lang_tl {g_fontspec_lang_(\f@family)_tl}
- \fontspec_check_ot_feat:nTF {#1} {\prg_return_true:} {\prg_return_false:}
- }{
- \prg_return_false:
- }
- }{
- \prg_return_false:
- }
-}
-\prg_new_conditional:Nnn \fontspec_if_feature:nnn {TF,T,F} {
- \fontspec_if_fontspec_font:TF {
- \fontspec_font_set:Nnn \zf@basefont {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt}
- \fontspec_set_font_type:
- \bool_if:NTF \l_fontspec_icu_bool {
- \fontspec_iv_str_to_num:Nn \l_fontspec_script_int {#1}
- \fontspec_iv_str_to_num:Nn \l_fontspec_language_int {#2}
- \fontspec_check_ot_feat:nTF {#3} \prg_return_true: \prg_return_false:
- }{
- \prg_return_false:
- }
- }{
- \prg_return_false:
- }
-}
-\prg_new_conditional:Nnn \fontspec_if_script:n {TF,T,F} {
- \fontspec_if_fontspec_font:TF {
- \fontspec_font_set:Nnn \zf@basefont {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt}
- \fontspec_set_font_type:
- \bool_if:NTF \l_fontspec_icu_bool {
- \fontspec_check_script:nTF {#1} \prg_return_true: \prg_return_false:
- }{
- \prg_return_false:
- }
- }{
- \prg_return_false:
- }
-}
-\prg_new_conditional:Nnn \fontspec_if_language:n {TF,T,F} {
- \fontspec_if_fontspec_font:TF {
- \fontspec_font_set:Nnn \zf@basefont {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt}
- \fontspec_set_font_type:
- \bool_if:NTF \l_fontspec_icu_bool {
- \tl_set:Nv \l_fontspec_script_tl {g_fontspec_script_(\f@family)_tl}
- \int_set:Nv \l_fontspec_script_int {g_fontspec_script_num_(\f@family)_tl}
- \fontspec_check_lang:nTF {#1} \prg_return_true: \prg_return_false:
- }{
- \prg_return_false:
- }
- }{
- \prg_return_false:
- }
-}
-\prg_new_conditional:Nnn \fontspec_if_language:nn {TF,T,F} {
- \fontspec_if_fontspec_font:TF {
- \fontspec_font_set:Nnn \zf@basefont {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt}
- \fontspec_set_font_type:
- \bool_if:NTF \l_fontspec_icu_bool {
- \tl_set:Nn \l_fontspec_script_tl {#1}
- \fontspec_iv_str_to_num:Nn \l_fontspec_script_int {#1}
- \fontspec_check_lang:nTF {#2} \prg_return_true: \prg_return_false:
- }{
- \prg_return_false:
- }
- }{
- \prg_return_false:
- }
-}
-\prg_new_conditional:Nnn \fontspec_if_current_script:n {TF,T,F} {
- \fontspec_if_fontspec_font:TF {
- \fontspec_font_set:Nnn \zf@basefont {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt}
- \fontspec_set_font_type:
- \bool_if:NTF \l_fontspec_icu_bool {
- \str_if_eq:nvTF {#1} {g_fontspec_script_(\f@family)_tl}
- {\prg_return_true:} {\prg_return_false:}
- }{
- \prg_return_false:
- }
- }{
- \prg_return_false:
- }
-}
-\prg_new_conditional:Nnn \fontspec_if_current_language:n {TF,T,F} {
- \fontspec_if_fontspec_font:TF {
- \fontspec_font_set:Nnn \zf@basefont {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt}
- \fontspec_set_font_type:
- \bool_if:NTF \l_fontspec_icu_bool {
- \str_if_eq:nvTF {#1} {g_fontspec_lang_(\f@family)_tl}
- {\prg_return_true:} {\prg_return_false:}
- }{
- \prg_return_false:
- }
- }{
- \prg_return_false:
- }
-}
-\cs_new:Npn \fontspec_set_family:Nnn #1#2#3 {
- \fontspec_select:nn {#2}{#3}
- \tl_set_eq:NN #1 \zf@family
-}
-\xetex_or_luatex:nnn { \cs_set:Npn \fontspec_fontwrap:n #1 } { "#1" } { {#1} }
-\cs_set:Npn \fontspec_fontwrap:n #1 { "#1" }
-\cs_if_free:NT \font_set_eq:NN {
- \cs_set_eq:NN \font_set_eq:NN \tex_let:D
- \cs_set:Npn \font_set:Nnn #1#2#3 {
- \font #1 = #2 ~at~ #3\scan_stop:
- }
- \cs_set:Npn \font_gset:Nnn #1#2#3 {
- \global \font #1 = #2 ~at~ #3 \scan_stop:
- }
- \xetex_or_luatex:nnn {\cs_set:Npn \font_suppress_not_found_error:}
- {\suppressfontnotfounderror=1}
- {\luatexsuppressfontnotfounderror=1}
- \prg_set_conditional:Nnn \font_if_null:N {p,TF,T,F} {
- \ifx #1 \nullfont
- \prg_return_true:
- \else
- \prg_return_false:
- \fi
- }
-}
-\cs_new:Nn \fontspec_font_set:Nnn {
- \font_set:Nnn #1 {\fontspec_fontwrap:n {#2}} {#3}
-}
-\cs_new:Nn \fontspec_font_gset:Nnn {
- \font_gset:Nnn #1 {\fontspec_fontwrap:n {#2}} {#3}
-}
-\prg_new_conditional:Nnn \font_glyph_if_exist:Nn {p,TF,T,F} {
- \etex_iffontchar:D #1 #2 \scan_stop:
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
-}
-\cs_set:Npn \fontspec_select:nn #1#2 {
- \group_begin:
- \font_suppress_not_found_error:
- \fontspec_init:
- \tl_set:Nx \l_fontspec_fontname_tl {#2}
- \luatex_if_engine:T {
- \tl_replace_all_in:Nnn \l_fontspec_fontname_tl {~} {}
- }
- \tl_set_eq:NN \l_fontspec_fontid_tl \l_fontspec_fontname_tl
- \tl_set_eq:NN \l_fontspec_fontname_up_tl \l_fontspec_fontname_tl
- \fontspec_preparse_features:nn {#1}{#2}
- \fontspec_font_set:Nnn \zf@basefont {\fontspec_fullname:n {\l_fontspec_fontname_up_tl}} {\f@size pt}
- \font_if_null:NT \zf@basefont { \fontspec_error:nx {font-not-found} {\l_fontspec_fontname_up_tl} }
- \fontspec_set_font_type:
- \fontspec_font_gset:Nnn \zf@basefont {\fontspec_fullname:n {\l_fontspec_fontname_up_tl}} {\f@size pt}
- \zf@basefont % this is necessary for LuaLaTeX to check the scripts properly
- \fontspec_set_scriptlang:
- \fontspec_get_features:n {}
- \bool_set_false:N \l_fontspec_firsttime_bool
- \fontspec_save_family:nT {#2} {
- \fontspec_info:nxx {defining-font} {#1} {#2}
- \fontspec_save_fontinfo:nn {#1} {#2}
- \DeclareFontFamily{\zf@enc}{\zf@family}{}
- \fontspec_set_upright:
- \fontspec_set_bold:
- \fontspec_set_italic:
- \fontspec_set_slanted:
- \fontspec_set_bold_italic:
- \fontspec_set_bold_slanted:
- }
- \group_end:
-}
-\cs_set_eq:NN \zf@fontspec \fontspec_select:nn
-\cs_new:Npn \fontspec_preparse_features:nn #1#2 {
- \fontspec_if_detect_external:nT {#2}
- { \setkeys[zf]{preparse-external}{ExternalLocation} }
- \fontspec_setkeys:xx {preparse-external} {\g_fontspec_default_fontopts_tl #1}
- \tl_set_eq:NN \l_fontspec_fontname_tl \l_fontspec_fontname_up_tl
- \fontspec_setkeys:xx {preparse} {\XKV@rm}
- \clist_set_eq:NN \l_fontspec_fontfeat_clist \XKV@rm
-}
-\prg_new_conditional:Nnn \fontspec_if_detect_external:n {T}
- {
- \clist_map_inline:Nn \l_fontspec_extensions_clist
- {
- \bool_set_false:N \l_tmpa_bool
- \tl_if_in:nnT {#1 <= end_of_string} {##1 <= end_of_string}
- { \bool_set_true:N \l_tmpa_bool \clist_map_break: }
- }
- \bool_if:NTF \l_tmpa_bool \prg_return_true: \prg_return_false:
- }
-\cs_set:Npn \fontspec_fullname:n #1 {
- \fontspec_namewrap:n { #1 \l_fontspec_extension_tl }
- \l_fontspec_renderer_tl
- \l_fontspec_optical_size_tl
-}
-%% Now we have a unique (in fact, too unique!) string that contains
-\prg_new_conditional:Nnn \fontspec_save_family:n {T} {
- \cs_if_exist:cF {g_fontspec_UID_\l_fontspec_fontid_tl}
- {
- \cs_if_exist:cTF {g_fontspec_family_#1_int} {
- \int_gincr:c {g_fontspec_family_#1_int}
- }{
- \int_new:c {g_fontspec_family_#1_int}
- }
- \edef\@tempa{#1~}
- \tl_gset:cx {g_fontspec_UID_\l_fontspec_fontid_tl} {
- \expandafter\zap@space\@tempa\@empty
- ( \int_use:c {g_fontspec_family_#1_int} )
- }
- }
- \tl_gset:Nv \zf@family {g_fontspec_UID_\l_fontspec_fontid_tl}
- \cs_if_exist:cTF {g_fontspec_ \zf@family _prop}
- \prg_return_false: \prg_return_true:
-}
-\cs_new:Npn \fontspec_set_scriptlang: {
- \bool_if:NT \l_fontspec_firsttime_bool {
- \tl_if_empty:NTF \l_fontspec_script_name_tl {
- \fontspec_check_script:nTF {latn}
- {
- \tl_set:Nn \l_fontspec_script_name_tl {Latin}
- \tl_if_empty:NT \l_fontspec_lang_name_tl {
- \tl_set:Nn \l_fontspec_lang_name_tl {Default}
- }
- \fontspec_setkeys:xxx {feat} {Script} {\l_fontspec_script_name_tl}
- \fontspec_setkeys:xxx {feat} {Lang} {\l_fontspec_lang_name_tl}
- }
- {
- \fontspec_info:n {no-scripts}
- }
- }
- {
- \tl_if_empty:NT \l_fontspec_lang_name_tl {
- \tl_set:Nn \l_fontspec_lang_name_tl {Default}
- }
- \fontspec_setkeys:xxx {feat} {Script} {\l_fontspec_script_name_tl}
- \fontspec_setkeys:xxx {feat} {Lang} {\l_fontspec_lang_name_tl}
- }
- }
-}
-\cs_generate_variant:Nn \prop_gput:Nnn {cnV}
-\cs_generate_variant:Nn \prop_gput:Nnn {cnx}
-\cs_new:Npn \fontspec_save_fontinfo:nn #1#2 {
-
- \prop_new:c {g_fontspec_ \zf@family _prop}
- \prop_gput:cnx {g_fontspec_ \zf@family _prop} {fontname} {#2}
- \prop_gput:cnx {g_fontspec_ \zf@family _prop} {options} {\g_fontspec_default_fontopts_tl #1}
- \prop_gput:cnx {g_fontspec_ \zf@family _prop} {fontdef} {
- \fontspec_fullname:n {\l_fontspec_fontname_tl} :
- \l_fontspec_pre_feat_sclist \l_fontspec_rawfeatures_sclist
- }
- \prop_gput:cnV {g_fontspec_ \zf@family _prop} {script-num} \l_fontspec_script_int
- \prop_gput:cnV {g_fontspec_ \zf@family _prop} {lang-num} \l_fontspec_language_int
- \prop_gput:cnV {g_fontspec_ \zf@family _prop} {script-tag} \l_fontspec_script_tl
- \prop_gput:cnV {g_fontspec_ \zf@family _prop} {lang-tag} \l_fontspec_lang_tl
-
- \tl_gset:cx {zf@family@fontname\zf@family} {#2}
- \tl_gset:cx {zf@family@options\zf@family} {\g_fontspec_default_fontopts_tl #1}
- \tl_gset:cx {zf@family@fontdef\zf@family} {
- \fontspec_fullname:n {\l_fontspec_fontname_tl} :
- \l_fontspec_pre_feat_sclist \l_fontspec_rawfeatures_sclist
- }
- \tl_gset:cV {g_fontspec_script_num_(\zf@family)_tl} \l_fontspec_script_int
- \tl_gset:cV {g_fontspec_lang_num_(\zf@family)_tl} \l_fontspec_language_int
- \tl_gset_eq:cN {g_fontspec_script_(\zf@family)_tl} \l_fontspec_script_tl
- \tl_gset_eq:cN {g_fontspec_lang_(\zf@family)_tl} \l_fontspec_lang_tl
-}
-\cs_new:Npn \fontspec_set_upright: {
- \fontspec_make_font_shapes:nnnn \l_fontspec_fontname_tl
- \mddefault \updefault \l_fontspec_fontfeat_up_clist
-}
-\cs_new:Npn \fontspec_set_bold: {
- \bool_if:NF \l_fontspec_nobf_bool {
- \tl_if_empty:NTF \l_fontspec_fontname_bf_tl {
- \fontspec_make_auto_font_shapes:nnnnn \l_fontspec_fontname_tl {/B}
- \bfdefault \updefault \l_fontspec_fontfeat_bf_clist
- }{
- \fontspec_make_font_shapes:nnnn \l_fontspec_fontname_bf_tl
- \bfdefault \updefault \l_fontspec_fontfeat_bf_clist
- }
- }
-}
-\cs_new:Npn \fontspec_set_italic: {
- \bool_if:NF \l_fontspec_noit_bool {
- \tl_if_empty:NTF \l_fontspec_fontname_it_tl
- { \fontspec_make_auto_font_shapes:nnnnn \l_fontspec_fontname_tl {/I} }
- { \fontspec_make_font_shapes:nnnn \l_fontspec_fontname_it_tl }
- \mddefault \itdefault \l_fontspec_fontfeat_it_clist
- }
-}
-\cs_new:Npn \fontspec_set_slanted: {
- \tl_if_empty:NF \l_fontspec_fontname_sl_tl {
- \fontspec_make_font_shapes:nnnn
- \l_fontspec_fontname_sl_tl \mddefault \sldefault \l_fontspec_fontfeat_sl_clist
- }
-}
-\cs_new:Npn \fontspec_set_bold_italic: {
- \bool_if:nF {\l_fontspec_nobf_bool || \l_fontspec_nobf_bool} {
- \tl_if_empty:NTF \l_fontspec_fontname_bfit_tl
- {
- \tl_if_empty:NTF \l_fontspec_fontname_bf_tl
- {
- \tl_if_empty:NTF \l_fontspec_fontname_it_tl
- {
- \fontspec_make_auto_font_shapes:nnnnn \l_fontspec_fontname_tl {/BI}
- }
- {
- \fontspec_make_auto_font_shapes:nnnnn \l_fontspec_fontname_it_tl {/B}
- }
- }
- {
- \fontspec_make_auto_font_shapes:nnnnn \l_fontspec_fontname_bf_tl {/I}
- }
- }
- {
- \fontspec_make_font_shapes:nnnn \l_fontspec_fontname_bfit_tl
- }
- \bfdefault \itdefault \l_fontspec_fontfeat_bfit_clist
- }
-}
-\cs_new:Npn \fontspec_set_bold_slanted: {
- \tl_if_empty:NTF \l_fontspec_fontname_bfsl_tl {
- \tl_if_empty:NF \l_fontspec_fontname_sl_tl {
- \fontspec_make_auto_font_shapes:nnnnn \l_fontspec_fontname_sl_tl {/B}
- \bfdefault \sldefault \l_fontspec_fontfeat_bfsl_clist
- }
- }{
- \fontspec_make_font_shapes:nnnn \l_fontspec_fontname_bfsl_tl
- \bfdefault \sldefault \l_fontspec_fontfeat_bfsl_clist
- }
-}
-\xetex_or_luatex:nnn { \cs_new:Npn \fontspec_set_font_type: }
- {
- \bool_set_false:N \l_fontspec_tfm_bool
- \bool_set_false:N \l_fontspec_atsui_bool
- \bool_set_false:N \l_fontspec_icu_bool
- \bool_set_false:N \l_fontspec_mm_bool
- \bool_set_false:N \l_fontspec_graphite_bool
- \ifcase\XeTeXfonttype\zf@basefont
- \bool_set_true:N \l_fontspec_tfm_bool
- \or
- \bool_set_true:N \l_fontspec_atsui_bool
- \ifnum\XeTeXcountvariations\zf@basefont > \c_zero
- \bool_set_true:N \l_fontspec_mm_bool
- \fi
- \or
- \bool_set_true:N \l_fontspec_icu_bool
- \fi
- \tl_if_empty:NT \l_fontspec_renderer_tl {
- \bool_if:NTF \l_fontspec_atsui_bool {
- \tl_set:Nn \l_fontspec_renderer_tl {/AAT}
- }{
- \bool_if:NT \l_fontspec_icu_bool {
- \tl_set:Nn \l_fontspec_renderer_tl {/ICU}
- }
- }
- }
- }
- {
- \bool_set_true:N \l_fontspec_icu_bool
- }
-\cs_new:Nn \fontspec_make_auto_font_shapes:nnnnn {
- \fontspec_font_set:Nnn \l_tmpa_font {\fontspec_fullname:n {#1}} {\f@size pt}
- \fontspec_font_set:Nnn \l_tmpb_font {\fontspec_fullname:n {#1#2}} {\f@size pt}
- \str_if_eq:xxTF { \fontname \l_tmpa_font } { \fontname \l_tmpb_font }
- { \fontspec_info:nx {no-font-shape} {#1#2} }
- {
- \fontspec_make_font_shapes:nnnn {#1#2}{#3}{#4}{#5}
- }
-}
-\cs_new:Nn \fontspec_make_font_shapes:nnnn {
- \group_begin:
- \tl_set:Nx \l_fontspec_fontname_tl {#1}
- \fontspec_font_set:Nnn \zf@basefont {\fontspec_fullname:n {#1}} {\f@size pt}
- \font_if_null:NT \zf@basefont { \fontspec_error:nx {font-not-found} {#1} }
- \fontspec_declare_shape:nnnn {}{#2}{#3}{#4}
- \tl_if_empty:NTF \l_fontspec_fontname_sc_tl {
- \bool_if:NF \l_fontspec_nosc_bool {
- \fontspec_make_smallcaps:T {
- \fontspec_declare_shape:nnnn {\l_fontspec_sc_featstr_sclist} {#2}
- { \tl_if_eq:NNTF #3 \itdefault \sidefault \scdefault }
- { #4 \l_fontspec_fontfeat_sc_clist }
- }
- }
- }{
- \tl_set:Nx \l_fontspec_fontname_tl {\l_fontspec_fontname_sc_tl}
- \fontspec_declare_shape:nnnn {}{#2}
- { \tl_if_eq:NNTF #3 \itdefault \sidefault \scdefault }
- { #4 \l_fontspec_fontfeat_sc_clist }
- }
- \group_end:
-}
-\cs_new:Npn \fontspec_declare_shape:nnnn #1#2#3#4 {
- \clist_if_empty:NTF \l_fontspec_sizefeat_clist
- {
- \fontspec_get_features:n {#4}
- \tl_set:Nx \l_fontspec_nfss_tl {
- <-> \l_fontspec_scale_tl
- \fontspec_fontwrap:n {
- \fontspec_fullname:n {\l_fontspec_fontname_tl} :
- \l_fontspec_pre_feat_sclist \l_fontspec_rawfeatures_sclist #1
- }
- }
- }
- {
- \tl_clear:N \l_fontspec_nfss_tl
- \clist_map_inline:Nn \l_fontspec_sizefeat_clist {
-
- \tl_clear:N \l_fontspec_size_tl
- \tl_set_eq:NN \l_fontspec_sizedfont_tl \l_fontspec_fontname_tl
-
- \fontspec_setkeys:xx {sizing} { \expandafter \use:n ##1 }
- \tl_if_empty:NT \l_fontspec_size_tl { \fontspec_error:n {no-size-info} }
- \fontspec_get_features:n{ #4 , \XKV@rm }
-
- \tl_put_right:Nx \l_fontspec_nfss_tl {
- <\l_fontspec_size_tl> \l_fontspec_scale_tl
- \fontspec_fontwrap:n {
- \fontspec_fullname:n { \l_fontspec_sizedfont_tl }
- : \l_fontspec_pre_feat_sclist \l_fontspec_rawfeatures_sclist #1
- }
- }
-
- }
- }
- \fontspec_info:nx {defining-raw} {#2/#3}
- \use:x{
- \exp_not:N\DeclareFontShape{\zf@enc}{\zf@family}{#2}{#3}
- {\l_fontspec_nfss_tl}{\l_fontspec_postadjust_tl}
- }
- \bool_if:nT {
- \str_if_eq_p:xx {#3} {\itdefault} &&
- !(\str_if_eq_p:xx {\itdefault} {\sldefault})
- }
- {
- \use:x {
- \exp_not:N \DeclareFontShape {\zf@enc}{\zf@family}{#2}{\sldefault}
- {<->ssub*\zf@family/#2/\itdefault}{\l_fontspec_postadjust_tl}
- }
- }
-}
-\xetex_or_luatex:nnn { \tl_set:Nn \l_fontspec_pre_feat_sclist }
- {
- \bool_if:NT \l_fontspec_icu_bool {
- \tl_if_empty:NF \l_fontspec_script_tl
- {
- script = \l_fontspec_script_tl ;
- language = \l_fontspec_lang_tl ;
- }
- }
- }
- {
- mode = \l_fontspec_mode_tl ;
- \tl_if_empty:NF \l_fontspec_script_tl
- {
- script = \l_fontspec_script_tl ;
- language = \l_fontspec_lang_tl ;
- }
- }
-\cs_new:Nn \fontspec_update_fontid:n {
- \bool_if:NT \l_fontspec_firsttime_bool {
- \tl_gput_right:Nx \l_fontspec_fontid_tl {#1}
- }
-}
-\cs_set:Npn \fontspec_get_features:n #1 {
- \sclist_clear:N \l_fontspec_rawfeatures_sclist
- \tl_clear:N \l_fontspec_scale_tl
- \tl_set_eq:NN \l_fontspec_opacity_tl \g_fontspec_opacity_tl
- \tl_set_eq:NN \l_fontspec_hexcol_tl \g_fontspec_hexcol_tl
- \tl_clear:N \l_fontspec_postadjust_tl
- \fontspec_setkeys:xx {options} {\l_fontspec_fontfeat_clist #1}
- \bool_if:NT \l_fontspec_firsttime_bool {
- \tl_if_empty:NF \XKV@rm {
- \fontspec_error:nx {unknown-options} { \exp_not:V \XKV@rm }
- }
- }
- \str_if_eq:xxF { \l_fontspec_hexcol_tl \l_fontspec_opacity_tl }
- { \g_fontspec_hexcol_tl \g_fontspec_opacity_tl }
- {
- \fontspec_update_featstr:n{color=\l_fontspec_hexcol_tl\l_fontspec_opacity_tl}
- }
-}
-\tl_clear:N \l_fontspec_fontname_bf_tl
-\tl_clear:N \l_fontspec_fontname_it_tl
-\tl_clear:N \l_fontspec_fake_slant_tl
-\tl_clear:N \l_fontspec_fake_embolden_tl
-\tl_clear:N \l_fontspec_fontname_bfit_tl
-\tl_clear:N \l_fontspec_fontname_sl_tl
-\tl_clear:N \l_fontspec_fontname_bfsl_tl
-\tl_clear:N \l_fontspec_fontname_sc_tl
-\tl_clear:N \l_fontspec_fontfeat_up_clist
-\tl_clear:N \l_fontspec_fontfeat_bf_clist
-\tl_clear:N \l_fontspec_fontfeat_it_clist
-\tl_clear:N \l_fontspec_fontfeat_bfit_clist
-\tl_clear:N \l_fontspec_fontfeat_sl_clist
-\tl_clear:N \l_fontspec_fontfeat_bfsl_clist
-\tl_clear:N \l_fontspec_fontfeat_sc_clist
-\tl_clear:N \l_fontspec_script_name_tl
-\tl_clear:N \l_fontspec_script_tl
-\tl_clear:N \l_fontspec_lang_name_tl
-\tl_clear:N \l_fontspec_lang_tl
-\clist_clear:N \l_fontspec_sizefeat_clist
-\tl_new:Nn \g_fontspec_hexcol_tl {000000}
-\tl_new:Nn \g_fontspec_opacity_tl {FF~}
-\newcommand*\fontspec_init:{
- \bool_set_false:N \l_fontspec_icu_bool
- \bool_set_true:N \l_fontspec_firsttime_bool
- \xetex_or_luatex:nnn { \cs_set:Npn \fontspec_namewrap:n ##1 }
- { ##1 }
- { name:##1 }
- \tl_clear:N \l_fontspec_optical_size_tl
- \tl_clear:N \l_fontspec_renderer_tl
- \luatex_if_engine:T {
- \tl_set:Nn \l_fontspec_mode_tl {node}
- \luatexprehyphenchar =`\- % fixme
- \luatexposthyphenchar = 0 % fixme
- \luatexpreexhyphenchar = 0 % fixme
- \luatexpostexhyphenchar= 0 % fixme
- }
-}
-\cs_set:Nn \fontspec_make_ot_smallcaps:T {
- \tl_clear:N \l_fontspec_sc_featstr_sclist
- \fontspec_check_ot_feat:nT {+smcp} {
- \tl_set:Nx \l_fontspec_sc_featstr_sclist {+smcp;}
- #1
- }
-}
-\xetex_or_luatex:nn
-{
- \cs_set:Nn \fontspec_make_smallcaps:T {
- \bool_if:NTF \l_fontspec_icu_bool {
- \fontspec_make_ot_smallcaps:T {#1}
- }{
- \bool_if:NT \l_fontspec_atsui_bool {
- \tl_clear:N \l_fontspec_sc_featstr_sclist
- \fontspec_make_AAT_feature_string:nnT {3}{3} {
- \tl_set:Nx \l_fontspec_sc_featstr_sclist
- {\l_fontspec_feature_string_tl;}
- #1
- }
- }
- }
- }
-}
-{
- \cs_set_eq:NN \fontspec_make_smallcaps:T \fontspec_make_ot_smallcaps:T
-}
-\cs_set_eq:NN \sclist_clear:N \tl_clear:N
-\cs_new:Npn \sclist_gput_right:Nn #1#2 {
- \tl_gput_right:Nn #1 {#2;}
-}
-\cs_generate_variant:Nn \sclist_gput_right:Nn {Nx}
-\cs_new:Nn \fontspec_update_featstr:n {
- \bool_if:NF \l_fontspec_firsttime_bool {
- \sclist_gput_right:Nx \l_fontspec_rawfeatures_sclist {#1}
- }
-}
-\cs_new:Npn \fontspec_make_feature:nnn #1#2#3 {
- \xetex_or_luatex:nn
- {
- \bool_if:NTF \l_fontspec_icu_bool {
- \fontspec_make_ICU_feature:n {#3}
- }{
- \bool_if:NT \l_fontspec_atsui_bool {
- \fontspec_make_AAT_feature:nn {#1}{#2}
- }
- }
- }
- {
- \fontspec_make_ICU_feature:n {#3}
- }
-}
-\cs_generate_variant:Nn \fontspec_make_feature:nnn {nnx}
-\cs_new:Npn \fontspec_make_AAT_feature:nn #1#2 {
- \tl_if_empty:nTF {#1}
- { \fontspec_warning:n {aat-feature-not-exist} }
- {
- \fontspec_make_AAT_feature_string:nnTF {#1}{#2}
- {
- \fontspec_update_fontid:n {+#1,#2}
- \fontspec_update_featstr:n {\l_fontspec_feature_string_tl}
- }
- { \fontspec_warning:nx {aat-feature-not-exist-in-font} {#1,#2} }
- }
-}
-\cs_new:Npn \fontspec_make_ICU_feature:n #1 {
- \tl_if_empty:nTF {#1}
- { \fontspec_warning:n {icu-feature-not-exist} }
- {
- \fontspec_check_ot_feat:nTF {#1}
- {
- \fontspec_update_fontid:n {#1}
- \fontspec_update_featstr:n{#1}
- }
- { \fontspec_warning:nx {icu-feature-not-exist-in-font} {#1} }
- }
-}
-\cs_new:Nn \fontspec_define_font_feature:n {
- \define@key[zf]{options}{#1}{{\setkeys[zf@feat]{#1}{##1}}}
-}
-\cs_new:Nn \fontspec_define_feature_option:nnnnn {
- \define@key[zf@feat]{#1}{#2}[]{\fontspec_make_feature:nnn{#3}{#4}{#5}}
-}
-\newcommand*\keyval@alias@key[4][KV]{
- \cs_set_eq:cc{#1@#2@#4}{#1@#2@#3}
- \cs_set_eq:cc{#1@#2@#4@default}{#1@#2@#3@default}
-}
-\newcommand*\multi@alias@key[2]{
- \key@ifundefined[zf]{options}{#1}
- {
- \key@ifundefined[zf]{preparse}{#1}
- {
- \key@ifundefined[zf]{preparse-external}{#1}
- { \fontspec_warning:nx {rename-feature-not-exist} {#1} }
- { \keyval@alias@key[zf]{preparse-external}{#1}{#2} }
- }
- { \keyval@alias@key[zf]{preparse}{#1}{#2} }
- }
- { \keyval@alias@key[zf]{options}{#1}{#2} }
-}
-\prg_new_conditional:Nnn \fontspec_make_AAT_feature_string:nn {TF,T,F} {
- \tl_set:Nx \l_tmpa_tl { \XeTeXfeaturename \zf@basefont #1 }
- \tl_if_empty:NTF \l_tmpa_tl
- { \prg_return_false: }
- {
- \int_compare:nTF { \XeTeXisexclusivefeature\zf@basefont #1 > 0 }
- {
- \tl_set:Nx \l_tmpb_tl {\XeTeXselectorname\zf@basefont #1\space #2}
- }{
- \int_if_even:nTF {#2}
- {
- \tl_set:Nx \l_tmpb_tl {\XeTeXselectorname\zf@basefont #1\space #2}
- }{
- \tl_set:Nx \l_tmpb_tl {
- \XeTeXselectorname\zf@basefont #1\space \numexpr#2-1\relax
- }
- \tl_if_empty:NF \l_tmpb_tl { \tl_put_left:Nn \l_tmpb_tl {!} }
- }
- }
- \tl_if_empty:NTF \l_tmpb_tl
- { \prg_return_false: }
- {
- \tl_set:Nx \l_fontspec_feature_string_tl { \l_tmpa_tl = \l_tmpb_tl }
- \prg_return_true:
- }
- }
-}
-\cs_set:Npn \fontspec_iv_str_to_num:Nn #1#2 {
- \fontspec_iv_str_to_num:w #1 \q_nil #2 \@empty \@empty \q_nil
-}
-\cs_set:Npn \fontspec_iv_str_to_num:w #1 \q_nil #2#3#4#5#6 \q_nil {
- \int_set:Nn #1 {
- `#2 * "1000000
- + `#3 * "10000
- + \ifx \@empty #4 32 \else `#4 \fi * "100
- + \ifx \@empty #5 32 \else `#5 \fi
- }
-}
-\cs_generate_variant:Nn \fontspec_iv_str_to_num:Nn {No}
-\cs_set:Npn \fontspec_v_str_to_num:Nn #1#2 {
- \bool_if:nTF
- {
- \tl_if_head_eq_charcode_p:nN {#2} {+} ||
- \tl_if_head_eq_charcode_p:nN {#2} {-}
- }
- { \fontspec_iv_str_to_num:No #1 { \use_none:n #2 } }
- { \fontspec_iv_str_to_num:Nn #1 {#2} }
-}
-\xetex_or_luatex:nnn {\prg_new_conditional:Nnn \fontspec_check_script:n {TF}}
- {
- \fontspec_iv_str_to_num:Nn \l_fontspec_strnum_int {#1}
- \int_set:Nn \l_tmpb_int { \XeTeXOTcountscripts\zf@basefont }
- \int_zero:N \l_tmpa_int
- \@tempswafalse
- \bool_until_do:nn { \int_compare_p:nNn \l_tmpa_int = \l_tmpb_int }
- {
- \ifnum \XeTeXOTscripttag\zf@basefont \l_tmpa_int = \l_fontspec_strnum_int
- \@tempswatrue
- \int_set:Nn \l_tmpa_int {\l_tmpb_int}
- \else
- \int_incr:N \l_tmpa_int
- \fi
- }
- \if@tempswa \prg_return_true: \else: \prg_return_false: \fi:
- }
- {
- \directlua{fontspec.check_ot_script("zf@basefont", "#1")}
- \if@tempswa \prg_return_true: \else: \prg_return_false: \fi:
- }
-\xetex_or_luatex:nnn {\prg_new_conditional:Nnn \fontspec_check_lang:n {TF}}
- {
- \fontspec_iv_str_to_num:Nn \l_fontspec_strnum_int {#1}
- \int_set:Nn \l_tmpb_int {
- \XeTeXOTcountlanguages \zf@basefont \l_fontspec_script_int
- }
- \int_zero:N \l_tmpa_int
- \@tempswafalse
- \bool_until_do:nn { \int_compare_p:nNn \l_tmpa_int = \l_tmpb_int }
- {
- \ifnum\XeTeXOTlanguagetag\zf@basefont\l_fontspec_script_int \l_tmpa_int =\l_fontspec_strnum_int
- \@tempswatrue
- \int_set:Nn \l_tmpa_int {\l_tmpb_int}
- \else
- \int_incr:N \l_tmpa_int
- \fi
- }
- \if@tempswa \prg_return_true: \else: \prg_return_false: \fi:
- }
- {
- \directlua{
- fontspec.check_ot_lang( "zf@basefont", "#1", "\l_fontspec_script_tl" )
- }
- \if@tempswa \prg_return_true: \else: \prg_return_false: \fi:
- }
-\xetex_or_luatex:nnn
- { \prg_new_conditional:Nnn \fontspec_check_ot_feat:n {TF,T} }
- {
- \int_set:Nn \l_tmpb_int {
- \XeTeXOTcountfeatures \zf@basefont
- \l_fontspec_script_int
- \l_fontspec_language_int
- }
- \fontspec_v_str_to_num:Nn \l_fontspec_strnum_int {#1}
- \int_zero:N \l_tmpa_int
- \@tempswafalse
- \bool_until_do:nn { \int_compare_p:nNn \l_tmpa_int = \l_tmpb_int }
- {
- \ifnum\XeTeXOTfeaturetag\zf@basefont\l_fontspec_script_int\l_fontspec_language_int
- \l_tmpa_int =\l_fontspec_strnum_int
- \@tempswatrue
- \int_set:Nn \l_tmpa_int {\l_tmpb_int}
- \else
- \int_incr:N \l_tmpa_int
- \fi
- }
- \if@tempswa \prg_return_true: \else: \prg_return_false: \fi:
- }
- {
- \directlua{
- fontspec.check_ot_feat(
- "zf@basefont", "#1",
- "\l_fontspec_lang_tl", "\l_fontspec_script_tl"
- )
- }
- \if@tempswa \prg_return_true: \else: \prg_return_false: \fi:
- }
-\bool_new:N \l_fontspec_external_bool
-\define@key[zf]{preparse-external}{ExternalLocation}[]{
- \bool_set_true:N \l_fontspec_nobf_bool
- \bool_set_true:N \l_fontspec_noit_bool
- \bool_set_true:N \l_fontspec_external_bool
- \xetex_or_luatex:nnn { \cs_gset:Npn \fontspec_namewrap:n ##1 }
- { [ #1 ##1 ] }
- { file: #1 ##1 }
- \xetex_if_engine:T { \setkeys[zf]{preparse}{Renderer=ICU} }
-}
-\aliasfontfeature{ExternalLocation}{Path}
-\define@key[zf]{preparse-external}{Extension}{
- \tl_set:Nn \l_fontspec_extension_tl {#1}
- \bool_if:NF \l_fontspec_external_bool {
- \setkeys*[zf]{preparse-external}{ExternalLocation}
- }
-}
-\tl_clear:N \l_fontspec_extension_tl
-\define@choicekey[zf]{preparse}{Renderer}[\l_tmpa_tl\l_tmpa_num]
- {AAT,ICU,Graphite,Full,Basic}{
- \fontspec_update_fontid:n {+rend:#1}
- \int_compare:nTF {\l_tmpa_num < 3} {
- \xetex_or_luatex:nn
- {
- \tl_set:Nv \l_fontspec_renderer_tl {g_fontspec_renderer_tag_\l_tmpa_tl}
- }
- {
- \fontspec_warning:nx {only-xetex-feature} {Renderer=AAT/ICU/Graphite}
- }
- }{
- \xetex_or_luatex:nn
- { \fontspec_warning:nx {only-luatex-feature} {Renderer=Full/Basic} }
- { \tl_set:Nv \l_fontspec_mode_tl {g_fontspec_mode_tag_\l_tmpa_tl} }
- }
-}
-\tl_set:cn {g_fontspec_renderer_tag_AAT} {/AAT}
-\tl_set:cn {g_fontspec_renderer_tag_ICU} {/ICU}
-\tl_set:cn {g_fontspec_renderer_tag_Graphite} {/GR}
-\tl_set:cn {g_fontspec_mode_tag_Full} {node}
-\tl_set:cn {g_fontspec_mode_tag_Basic} {base}
-\define@key[zf]{preparse}{Script}{
- \xetex_if_engine:T { \setkeys[zf]{preparse}{Renderer=ICU} }
- \tl_set:Nn \l_fontspec_script_name_tl {#1}
- \fontspec_update_fontid:n {+script:#1}
-}
-\define@key[zf]{preparse}{Language}{
- \xetex_if_engine:T { \setkeys[zf]{preparse}{Renderer=ICU} }
- \tl_set:Nn \l_fontspec_lang_name_tl {#1}
- \fontspec_update_fontid:n {+language:#1}
-}
-\define@key[zf]{preparse-external}{UprightFont}{
- \fontspec_complete_fontname:Nn \l_fontspec_fontname_up_tl {#1}
- \fontspec_update_fontid:n {up:#1}
-}
-\define@key[zf]{preparse-external}{BoldFont}{
- \tl_if_empty:nTF {#1}
- {
- \bool_set_true:N \l_fontspec_nobf_bool
- \fontspec_update_fontid:n {nobf}
- }
- {
- \bool_set_false:N \l_fontspec_nobf_bool
- \fontspec_complete_fontname:Nn \l_fontspec_fontname_bf_tl {#1}
- \fontspec_update_fontid:n {bf:#1}
- }
-}
-\define@key[zf]{preparse-external}{ItalicFont}{
- \tl_if_empty:nTF {#1}
- {
- \bool_set_true:N \l_fontspec_noit_bool
- \fontspec_update_fontid:n {noit}
- }{
- \bool_set_false:N \l_fontspec_noit_bool
- \fontspec_complete_fontname:Nn \l_fontspec_fontname_it_tl {#1}
- \fontspec_update_fontid:n {it:#1}
- }
-}
-\define@key[zf]{preparse-external}{BoldItalicFont}{
- \fontspec_complete_fontname:Nn \l_fontspec_fontname_bfit_tl {#1}
- \fontspec_update_fontid:n {bfit:#1}
-}
-\define@key[zf]{preparse-external}{SlantedFont}{
- \fontspec_complete_fontname:Nn \l_fontspec_fontname_sl_tl {#1}
- \fontspec_update_fontid:n {sl:#1}
-}
-\define@key[zf]{preparse-external}{BoldSlantedFont}{
- \fontspec_complete_fontname:Nn \l_fontspec_fontname_bfsl_tl {#1}
- \fontspec_update_fontid:n {bfsl:#1}
-}
-\define@key[zf]{options}{SmallCapsFont}{
- \tl_if_empty:nTF {#1}
- {
- \bool_set_true:N \l_fontspec_nosc_bool
- \fontspec_update_fontid:n {nosc}
- }{
- \bool_set_true:N \l_fontspec_nosc_bool
- \fontspec_complete_fontname:Nn \l_fontspec_fontname_sc_tl {#1}
- \fontspec_update_fontid:n {sc:\zap@space #1~\@empty}
- }
-}
-\cs_set:Npn \fontspec_complete_fontname:Nn #1#2 {
- \tl_set:Nn #1 {#2}
- \tl_replace_all_in:Nnx #1 {*} {\l_fontspec_fontname_tl}
- \luatex_if_engine:T {
- \tl_replace_all_in:Nnn #1 {~} {}
- }
-}
-\cs_generate_variant:Nn \tl_replace_all_in:Nnn {Nnx}
-\define@key[zf]{preparse}{UprightFeatures}{
- \def\l_fontspec_fontfeat_up_clist{, #1}
- \fontspec_update_fontid:n {rmfeat:#1}
-}
-\define@key[zf]{preparse}{BoldFeatures}{
- \def\l_fontspec_fontfeat_bf_clist{, #1}
- \fontspec_update_fontid:n {bffeat:#1}
-}
-\define@key[zf]{preparse}{ItalicFeatures}{
- \def\l_fontspec_fontfeat_it_clist{, #1}
- \fontspec_update_fontid:n {itfeat:#1}
-}
-\define@key[zf]{preparse}{BoldItalicFeatures}{
- \def\l_fontspec_fontfeat_bfit_clist{, #1}
- \fontspec_update_fontid:n {bfitfeat:#1}
-}
-\define@key[zf]{preparse}{SlantedFeatures}{
- \def\l_fontspec_fontfeat_sl_clist{, #1}
- \fontspec_update_fontid:n {slfeat:#1}
-}
-\define@key[zf]{preparse}{BoldSlantedFeatures}{
- \def\l_fontspec_fontfeat_bfsl_clist{, #1}
- \fontspec_update_fontid:n {bfslfeat:#1}
-}
-\define@key[zf]{options}{SmallCapsFeatures}{
- \bool_if:NF \l_fontspec_firsttime_bool {
- \def\l_fontspec_fontfeat_sc_clist{, #1}
- }
- \fontspec_update_fontid:n {scfeat:\zap@space #1~\@empty}
-}
-\define@key[zf]{preparse}{SizeFeatures}{
- \tl_set:Nn \l_fontspec_sizefeat_clist {#1}
- \fontspec_update_fontid:n {sizefeat:\zap@space #1~\@empty}
-}
-\define@key[zf]{sizing}{Size}{ \tl_set:Nn \l_fontspec_size_tl {#1} }
-\define@key[zf]{sizing}{Font}{
- \fontspec_complete_fontname:Nn \l_fontspec_sizedfont_tl {#1}
-}
-\define@key[zf]{options}{Scale}{
- \prg_case_str:nnn {#1}
- {
- {MatchLowercase} { \fontspec_calc_scale:n {5} }
- {MatchUppercase} { \fontspec_calc_scale:n {8} }
- }
- { \tl_set:Nx \l_fontspec_scale_tl {#1} }
- \fontspec_update_fontid:n {+scale:\l_fontspec_scale_tl}
- \tl_set:Nx \l_fontspec_scale_tl { s*[\l_fontspec_scale_tl] }
-}
-\cs_new:Npn \fontspec_calc_scale:n #1 {
- \group_begin:
- \rmfamily
- \fontspec_set_font_dimen:NnN \@tempdima {#1} \font
- \fontspec_set_font_dimen:NnN \@tempdimb {#1} \zf@basefont
- \dim_set:Nn \@tempdimc { 1pt*\@tempdima/\@tempdimb }
- \tl_gset:Nx \l_fontspec_scale_tl {\strip@pt\@tempdimc}
- \fontspec_info:n {set-scale}
- \group_end:
-}
-\cs_new:Npn \fontspec_set_font_dimen:NnN #1#2#3
-{
- \dim_set:Nn #1 { \fontdimen #2 #3 }
- \dim_compare:nNnT #1 = {0pt} {
- \settoheight #1 {
- \str_if_eq:nnTF {#3} {\font} \rmfamily #3
- \prg_case_int:nnn #2 {
- {5} {x} % x-height
- {8} {X} % cap-height
- } {?} % "else" clause; never reached.
- }
- }
-}
-\define@key[zf]{options}{WordSpace}{
- \fontspec_update_fontid:n {+wordspace:#1}
- \bool_if:NF \l_fontspec_firsttime_bool {
- \_fontspec_parse_wordspace:w #1,,,\q_stop
- }
-}
-\cs_set:Npn \_fontspec_parse_wordspace:w #1,#2,#3,#4 \q_stop {
- \tl_if_empty:nTF {#4}
- {
- \dim_set:Nn \@tempdima {#1\fontdimen2\zf@basefont}
- \dim_set:Nn \@tempdimb {\@tempdima}
- \dim_set:Nn \@tempdimc {\@tempdima}
- }{
- \dim_set:Nn \@tempdima {#1\fontdimen2\zf@basefont}
- \dim_set:Nn \@tempdimb {#2\fontdimen3\zf@basefont}
- \dim_set:Nn \@tempdimc {#3\fontdimen4\zf@basefont}
- }
- \tl_put_right:Nx \l_fontspec_postadjust_tl {
- \fontdimen2\font\the\@tempdima
- \fontdimen3\font\the\@tempdimb
- \fontdimen4\font\the\@tempdimc
- }
-}
-\define@key[zf]{options}{PunctuationSpace}{
- \fontspec_update_fontid:n {+punctspace:#1}
- \setlength\@tempdima{#1\fontdimen7\zf@basefont}
- \tl_put_right:Nx \l_fontspec_postadjust_tl {\fontdimen7\font\the\@tempdima}
-}
-\define@key[zf]{options}{FontAdjustment}{
- \fontspec_update_fontid:n {+fontadjust:\detokenize{#1}}
- \tl_put_right:Nx \l_fontspec_postadjust_tl {#1}
-}
-\define@key[zf]{options}{LetterSpace}{
- \fontspec_update_fontid:n {+tracking:#1}
- \fontspec_update_featstr:n{letterspace=#1}
-}
-\define@key[zf]{options}{HyphenChar}{
- \fontspec_update_fontid:n {+hyphenchar:#1}
- \str_if_eq:nnTF {#1} {None}
- {
- \tl_put_right:Nn \l_fontspec_postadjust_tl { \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} }
- \font_glyph_if_exist:NnTF \zf@basefont {\l_fontspec_hyphenchar_tl}
- {
- \xetex_or_luatex:nnn { \tl_put_right:Nn \l_fontspec_postadjust_tl }
- { \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} }
- }
-}
-\define@key[zf]{options}{Color}{
- \fontspec_update_fontid:n {+col:#1}
- \cs_if_exist:cTF {\token_to_str:N\color@#1}
- {
- \convertcolorspec{named}{#1}{HTML}\l_fontspec_hexcol_tl
- }
- {
- \int_compare:nTF { \tl_elt_count:n {#1} == 6 }
- { \tl_set:Nn \l_fontspec_hexcol_tl {#1} }
- {
- \int_compare:nTF { \tl_elt_count:n {#1} == 8 }
- { \fontspec_parse_colour:viii #1 }
- {
- \bool_if:NF \l_fontspec_firsttime_bool {
- \fontspec_warning:nx {bad-colour} {#1}
- }
- }
- }
- }
-}
-\cs_set:Npn \fontspec_parse_colour:viii #1#2#3#4#5#6#7#8 {
- \tl_set:Nn \l_fontspec_hexcol_tl {#1#2#3#4#5#6}
- \tl_if_eq:NNF \l_fontspec_opacity_tl \g_fontspec_opacity_tl
- {
- \bool_if:NF \l_fontspec_firsttime_bool {
- \fontspec_warning:nx {opa-twice-col} {#7#8}
- }
- }
- \tl_set:Nn \l_fontspec_opacity_tl {#7#8}
-}
-\keyval@alias@key[zf]{options}{Color}{Colour}
-\newcounter{fontspec_tmp_int}
-\define@key[zf]{options}{Opacity}{
- \fontspec_update_fontid:n {+opac:#1}
- \setcounter {fontspec_tmp_int} { 255*\real{#1} }
- \tl_if_eq:NNF \l_fontspec_opacity_tl \g_fontspec_opacity_tl
- {
- \bool_if:NF \l_fontspec_firsttime_bool {
- \fontspec_warning:nx {opa-twice} {#1}
- }
- }
- \tl_set:Nx \l_fontspec_opacity_tl
- { \nhex2 { \value{fontspec_tmp_int} } }
-}
-\xetex_or_luatex:nnn {
- \define@key[zf]{options}{Mapping}
-}{
- \fontspec_update_fontid:n {+map:#1}
- \fontspec_update_featstr:n{mapping=#1}
-}{
- \str_if_eq:nnTF {#1} {tex-text} {
- \fontspec_warning:n {no-mapping-ligtex}
- \msg_redirect_name:nnn {fontspec} {no-mapping-ligtex} {none}
- \setkeys[zf]{options}{ Ligatures=TeX }
- }{
- \fontspec_warning:n {no-mapping}
- }
-}
-\define@key[zf]{options}{FeatureFile}{
- \fontspec_update_fontid:n {+fea:#1}
- \fontspec_update_featstr:n{featurefile=#1}
-}
-\define@key[zf]{options}{Weight}{
- \fontspec_update_fontid:n {+weight:#1}
- \fontspec_update_featstr:n{weight=#1}
-}
-\define@key[zf]{options}{Width}{
- \fontspec_update_fontid:n {+width:#1}
- \fontspec_update_featstr:n{width=#1}
-}
-\define@key[zf]{options}{OpticalSize}{
- \xetex_or_luatex:nn {
- \bool_if:NTF \l_fontspec_icu_bool {
- \tl_set:Nn \l_fontspec_optical_size_tl {/ S = #1}
- \fontspec_update_fontid:n {+size:#1}
- }{
- \bool_if:NT \l_fontspec_mm_bool {
- \fontspec_update_fontid:n {+size:#1}
- \fontspec_update_featstr:n{optical size=#1}
- }
- }
- \bool_if:nT { !\l_fontspec_icu_bool && !\l_fontspec_mm_bool }{
- \bool_if:NT \l_fontspec_firsttime_bool {
- \fontspec_warning:n {no-opticals}
- }
- }
- }{
- \tl_set:Nn \l_fontspec_optical_size_tl {/ S = #1}
- \fontspec_update_fontid:n {+size:#1}
- }
-}
-\define@key[zf]{options}{FakeSlant}[0.2]{
- \fontspec_update_fontid:n {+slant:#1}
- \fontspec_update_featstr:n{slant=#1}
-}
-\define@key[zf]{options}{FakeStretch}[1.2]{
- \fontspec_update_fontid:n {+extend:#1}
- \fontspec_update_featstr:n{extend=#1}
-}
-\define@key[zf]{options}{FakeBold}[1.5]{
- \fontspec_update_fontid:n {+embolden:#1}
- \fontspec_update_featstr:n{embolden=#1}
-}
-\define@key[zf]{options}{AutoFakeSlant}[0.2]{
- \bool_if:NT \l_fontspec_firsttime_bool {
- \tl_set:Nn \l_fontspec_fake_slant_tl {#1}
- \clist_put_right:Nn \l_fontspec_fontfeat_it_clist {,FakeSlant=#1}
- \tl_set_eq:NN \l_fontspec_fontname_it_tl \l_fontspec_fontname_tl
- \fontspec_update_fontid:n {fakeit:#1}
- \tl_if_empty:NF \l_fontspec_fake_embolden_tl {
- \tl_put_right:Nx \l_fontspec_fontfeat_bfit_clist
- {,FakeBold=\l_fontspec_fake_embolden_tl,FakeSlant=#1}
- \tl_set_eq:NN \l_fontspec_fontname_bfit_tl \l_fontspec_fontname_tl
- }
- }
-}
-\define@key[zf]{options}{AutoFakeBold}[1.5]{
- \bool_if:NT \l_fontspec_firsttime_bool {
- \tl_set:Nn \l_fontspec_fake_embolden_tl {#1}
- \tl_put_right:Nn \l_fontspec_fontfeat_bf_clist {,FakeBold=#1}
- \tl_set_eq:NN \l_fontspec_fontname_bf_tl \l_fontspec_fontname_tl
- \fontspec_update_fontid:n {fakebf:#1}
- \tl_if_empty:NF \l_fontspec_fake_slant_tl {
- \tl_put_right:Nx \l_fontspec_fontfeat_bfit_clist
- {,FakeSlant=\l_fontspec_fake_slant_tl,FakeBold=#1}
- \tl_set_eq:NN \l_fontspec_fontname_bfit_tl \l_fontspec_fontname_tl
- }
- }
-}
-\fontspec_define_font_feature:n{Ligatures}
-\fontspec_define_feature_option:nnnnn{Ligatures}{Required} {1}{0}{+rlig}
-\fontspec_define_feature_option:nnnnn{Ligatures}{NoRequired} {1}{1}{-rlig}
-\fontspec_define_feature_option:nnnnn{Ligatures}{Common} {1}{2}{+liga}
-\fontspec_define_feature_option:nnnnn{Ligatures}{NoCommon} {1}{3}{-liga}
-\fontspec_define_feature_option:nnnnn{Ligatures}{Rare} {1}{4}{+dlig}
-\fontspec_define_feature_option:nnnnn{Ligatures}{NoRare} {1}{5}{-dlig}
-\fontspec_define_feature_option:nnnnn{Ligatures}{Discretionary} {1}{4}{+dlig}
-\fontspec_define_feature_option:nnnnn{Ligatures}{NoDiscretionary}{1}{5}{-dlig}
-\fontspec_define_feature_option:nnnnn{Ligatures}{Contextual} {}{} {+clig}
-\fontspec_define_feature_option:nnnnn{Ligatures}{NoContextual} {}{} {-clig}
-\fontspec_define_feature_option:nnnnn{Ligatures}{Historic} {}{} {+hlig}
-\fontspec_define_feature_option:nnnnn{Ligatures}{NoHistoric} {}{} {-hlig}
-\fontspec_define_feature_option:nnnnn{Ligatures}{Logos} {1}{6} {}
-\fontspec_define_feature_option:nnnnn{Ligatures}{NoLogos} {1}{7} {}
-\fontspec_define_feature_option:nnnnn{Ligatures}{Rebus} {1}{8} {}
-\fontspec_define_feature_option:nnnnn{Ligatures}{NoRebus} {1}{9} {}
-\fontspec_define_feature_option:nnnnn{Ligatures}{Diphthong} {1}{10}{}
-\fontspec_define_feature_option:nnnnn{Ligatures}{NoDiphthong} {1}{11}{}
-\fontspec_define_feature_option:nnnnn{Ligatures}{Squared} {1}{12}{}
-\fontspec_define_feature_option:nnnnn{Ligatures}{NoSquared} {1}{13}{}
-\fontspec_define_feature_option:nnnnn{Ligatures}{AbbrevSquared} {1}{14}{}
-\fontspec_define_feature_option:nnnnn{Ligatures}{NoAbbrevSquared}{1}{15}{}
-\fontspec_define_feature_option:nnnnn{Ligatures}{Icelandic} {1}{32}{}
-\fontspec_define_feature_option:nnnnn{Ligatures}{NoIcelandic} {1}{33}{}
-\define@key[zf@feat]{Ligatures}{TeX}[]{
- \xetex_or_luatex:nn {
- \fontspec_update_fontid:n {+map:tex-text}
- \fontspec_update_featstr:n{mapping=tex-text}
- }{
- \fontspec_update_fontid:n {+tlig+trep}
- \fontspec_update_featstr:n{+tlig;+trep}
- }
-}
-\fontspec_define_font_feature:n{Letters}
-\fontspec_define_feature_option:nnnnn{Letters}{Normal} {3}{0}{}
-\fontspec_define_feature_option:nnnnn{Letters}{Uppercase} {3}{1}{+case}
-\fontspec_define_feature_option:nnnnn{Letters}{Lowercase} {3}{2}{}
-\fontspec_define_feature_option:nnnnn{Letters}{SmallCaps} {3}{3}{+smcp}
-\fontspec_define_feature_option:nnnnn{Letters}{PetiteCaps} {} {} {+pcap}
-\fontspec_define_feature_option:nnnnn{Letters}{UppercaseSmallCaps} {} {} {+c2sc}
-\fontspec_define_feature_option:nnnnn{Letters}{UppercasePetiteCaps}{} {} {+c2pc}
-\fontspec_define_feature_option:nnnnn{Letters}{InitialCaps} {3}{4}{}
-\fontspec_define_feature_option:nnnnn{Letters}{Unicase} {} {} {+unic}
-\fontspec_define_feature_option:nnnnn{Letters}{Random} {} {} {+rand}
-\fontspec_define_font_feature:n{Numbers}
-\fontspec_define_feature_option:nnnnn{Numbers}{Monospaced} {6} {0}{+tnum}
-\fontspec_define_feature_option:nnnnn{Numbers}{Proportional} {6} {1}{+pnum}
-\fontspec_define_feature_option:nnnnn{Numbers}{Lowercase} {21}{0}{+onum}
-\fontspec_define_feature_option:nnnnn{Numbers}{OldStyle} {21}{0}{+onum}
-\fontspec_define_feature_option:nnnnn{Numbers}{Uppercase} {21}{1}{+lnum}
-\fontspec_define_feature_option:nnnnn{Numbers}{Lining} {21}{1}{+lnum}
-\fontspec_define_feature_option:nnnnn{Numbers}{SlashedZero} {14}{5}{+zero}
-\fontspec_define_feature_option:nnnnn{Numbers}{NoSlashedZero}{14}{4}{-zero}
-\luatex_if_engine:T {
- \fontspec_define_feature_option:nnnnn{Numbers}{Arabic}{}{}{+anum}
-}
-\fontspec_define_font_feature:n {Contextuals}
-\fontspec_define_feature_option:nnnnn{Contextuals}{Swash} {} {} {+cswh}
-\fontspec_define_feature_option:nnnnn{Contextuals}{NoSwash} {} {} {-cswh}
-\fontspec_define_feature_option:nnnnn{Contextuals}{Alternate} {} {} {+calt}
-\fontspec_define_feature_option:nnnnn{Contextuals}{NoAlternate} {} {} {-calt}
-\fontspec_define_feature_option:nnnnn{Contextuals}{WordInitial} {8}{0}{+init}
-\fontspec_define_feature_option:nnnnn{Contextuals}{NoWordInitial}{8}{1}{-init}
-\fontspec_define_feature_option:nnnnn{Contextuals}{WordFinal} {8}{2}{+fina}
-\fontspec_define_feature_option:nnnnn{Contextuals}{NoWordFinal} {8}{3}{-fina}
-\fontspec_define_feature_option:nnnnn{Contextuals}{LineInitial} {8}{4}{}
-\fontspec_define_feature_option:nnnnn{Contextuals}{NoLineInitial}{8}{5}{}
-\fontspec_define_feature_option:nnnnn{Contextuals}{LineFinal} {8}{6}{+falt}
-\fontspec_define_feature_option:nnnnn{Contextuals}{NoLineFinal} {8}{7}{-falt}
-\fontspec_define_feature_option:nnnnn{Contextuals}{Inner} {8}{8}{+medi}
-\fontspec_define_feature_option:nnnnn{Contextuals}{NoInner} {8}{9}{-medi}
-\fontspec_define_font_feature:n{Diacritics}
-\fontspec_define_feature_option:nnnnn{Diacritics}{Show} {9}{0}{}
-\fontspec_define_feature_option:nnnnn{Diacritics}{Hide} {9}{1}{}
-\fontspec_define_feature_option:nnnnn{Diacritics}{Decompose} {9}{2}{}
-\fontspec_define_feature_option:nnnnn{Diacritics}{MarkToBase} {}{}{+mark}
-\fontspec_define_feature_option:nnnnn{Diacritics}{NoMarkToBase}{}{}{-mark}
-\fontspec_define_feature_option:nnnnn{Diacritics}{MarkToMark} {}{}{+mkmk}
-\fontspec_define_feature_option:nnnnn{Diacritics}{NoMarkToMark}{}{}{-mkmk}
-\fontspec_define_feature_option:nnnnn{Diacritics}{AboveBase} {}{}{+abvm}
-\fontspec_define_feature_option:nnnnn{Diacritics}{NoAboveBase} {}{}{-abvm}
-\fontspec_define_feature_option:nnnnn{Diacritics}{BelowBase} {}{}{+blwm}
-\fontspec_define_feature_option:nnnnn{Diacritics}{NoBelowBase} {}{}{-blwm}
-\fontspec_define_font_feature:n{Kerning}
-\fontspec_define_feature_option:nnnnn{Kerning}{Uppercase}{}{}{+cpsp}
-\fontspec_define_feature_option:nnnnn{Kerning}{On} {}{}{+kern}
-\fontspec_define_feature_option:nnnnn{Kerning}{Off} {}{}{-kern}
-\fontspec_define_font_feature:n{VerticalPosition}
-\fontspec_define_feature_option:nnnnn{VerticalPosition}{Normal} {10}{0}{}
-\fontspec_define_feature_option:nnnnn{VerticalPosition}{Superior} {10}{1}{+sups}
-\fontspec_define_feature_option:nnnnn{VerticalPosition}{Inferior} {10}{2}{+subs}
-\fontspec_define_feature_option:nnnnn{VerticalPosition}{Ordinal} {10}{3}{+ordn}
-\fontspec_define_feature_option:nnnnn{VerticalPosition}{Numerator} {} {} {+numr}
-\fontspec_define_feature_option:nnnnn{VerticalPosition}{Denominator}{} {} {+dnom}
-\fontspec_define_feature_option:nnnnn{VerticalPosition}{ScientificInferior}{}{}{+sinf}
-\fontspec_define_font_feature:n{Fractions}
-\fontspec_define_feature_option:nnnnn{Fractions}{On} {11}{1}{+frac}
-\fontspec_define_feature_option:nnnnn{Fractions}{Off} {11}{0}{-frac}
-\fontspec_define_feature_option:nnnnn{Fractions}{Diagonal} {11}{2}{}
-\fontspec_define_feature_option:nnnnn{Fractions}{Alternate}{} {} {+afrc}
-\define@key[zf]{options}{Alternate}[0]{
- \clist_set_eq:NN \l_fontspec_tmpa_clist \XKV@rm
- \setkeys*[zf@feat]{Alternate}{#1}
- \tl_if_empty:NF \XKV@rm {
- \def\XKV@tfam{Alternate}
- \fontspec_make_feature:nnx {17}{#1} { \fontspec_salt:n {#1} }
- }
- \clist_set_eq:NN \XKV@rm \l_fontspec_tmpa_clist
-}
-\xetex_or_luatex:nnn { \cs_set:Npn \fontspec_salt:n #1 }
- {+salt=#1} { +salt= \int_eval:n {#1+1} }
-\define@key[zf]{options}{Variant}{
- \clist_set_eq:NN \l_fontspec_tmpa_clist \XKV@rm
- \setkeys*[zf@feat]{Variant}{#1}
- \tl_if_empty:NF \XKV@rm {
- \def\XKV@tfam{Variant}
- \fontspec_make_feature:nnx {18}{#1} { +ss \two@digits {#1} }
- }
- \clist_set_eq:NN \XKV@rm \l_fontspec_tmpa_clist
-}
-\aliasfontfeature{Variant}{StylisticSet}
-\define@key[zf]{options}{CharacterVariant}{
- \clist_set_eq:NN \l_fontspec_tmpa_clist \XKV@rm
- \setkeys*[zf@feat]{CharacterVariant}{#1}
- \tl_if_empty:NF \XKV@rm {
- \def\XKV@tfam{CharacterVariant}
- \fontspec_make_feature:nnx {}{} { +cv \two@digits {#1} }
- }
- \clist_set_eq:NN \XKV@rm \l_fontspec_tmpa_clist
-}
-\xetex_or_luatex:nnn {\define@key[zf]{options}{ScriptStyle}[]}
-{
- \fontspec_update_fontid:n {+ssty=0}
- \fontspec_update_featstr:n{+ssty=0}
-}
-{
- \fontspec_update_fontid:n {+ssty=1}
- \fontspec_update_featstr:n{+ssty=1}
-}
-\xetex_or_luatex:nnn {\define@key[zf]{options}{ScriptScriptStyle}[]}
-{
- \fontspec_update_fontid:n {+ssty=1}
- \fontspec_update_featstr:n{+ssty=1}
-}
-{
- \fontspec_update_fontid:n {+ssty=2}
- \fontspec_update_featstr:n{+ssty=2}
-}
-\fontspec_define_font_feature:n{Style}
-\fontspec_define_feature_option:nnnnn{Style}{Alternate} {} {} {+salt}
-\fontspec_define_feature_option:nnnnn{Style}{Italic} {32}{2}{+ital}
-\fontspec_define_feature_option:nnnnn{Style}{Ruby} {28}{2}{+ruby}
-\fontspec_define_feature_option:nnnnn{Style}{Swash} {} {} {+swsh}
-\fontspec_define_feature_option:nnnnn{Style}{Historic} {} {} {+hist}
-\fontspec_define_feature_option:nnnnn{Style}{Display} {19}{1}{}
-\fontspec_define_feature_option:nnnnn{Style}{Engraved} {19}{2}{}
-\fontspec_define_feature_option:nnnnn{Style}{TitlingCaps} {19}{4}{+titl}
-\fontspec_define_feature_option:nnnnn{Style}{TallCaps} {19}{5}{}
-\fontspec_define_feature_option:nnnnn{Style}{HorizontalKana}{} {} {+hkna}
-\fontspec_define_feature_option:nnnnn{Style}{VerticalKana} {} {} {+vkna}
-\fontspec_define_font_feature:n{CJKShape}
-\fontspec_define_feature_option:nnnnn{CJKShape}{Traditional}{20}{0} {+trad}
-\fontspec_define_feature_option:nnnnn{CJKShape}{Simplified} {20}{1} {+smpl}
-\fontspec_define_feature_option:nnnnn{CJKShape}{JIS1978} {20}{2} {+jp78}
-\fontspec_define_feature_option:nnnnn{CJKShape}{JIS1983} {20}{3} {+jp83}
-\fontspec_define_feature_option:nnnnn{CJKShape}{JIS1990} {20}{4} {+jp90}
-\fontspec_define_feature_option:nnnnn{CJKShape}{Expert} {20}{10}{+expt}
-\fontspec_define_feature_option:nnnnn{CJKShape}{NLC} {20}{13}{+nlck}
-\fontspec_define_font_feature:n{CharacterWidth}
-\fontspec_define_feature_option:nnnnn{CharacterWidth}{Proportional}{22}{0}{+pwid}
-\fontspec_define_feature_option:nnnnn{CharacterWidth}{Full}{22}{1}{+fwid}
-\fontspec_define_feature_option:nnnnn{CharacterWidth}{Half}{22}{2}{+hwid}
-\fontspec_define_feature_option:nnnnn{CharacterWidth}{Third}{22}{3}{+twid}
-\fontspec_define_feature_option:nnnnn{CharacterWidth}{Quarter}{22}{4}{+qwid}
-\fontspec_define_feature_option:nnnnn{CharacterWidth}{AlternateProportional}{22}{5}{+palt}
-\fontspec_define_feature_option:nnnnn{CharacterWidth}{AlternateHalf}{22}{6}{+halt}
-\fontspec_define_feature_option:nnnnn{CharacterWidth}{Default}{22}{7}{}
-\fontspec_define_feature_option:nnnnn{Annotation}{Off}{24}{0}{}
-\fontspec_define_feature_option:nnnnn{Annotation}{Box}{24}{1}{}
-\fontspec_define_feature_option:nnnnn{Annotation}{RoundedBox}{24}{2}{}
-\fontspec_define_feature_option:nnnnn{Annotation}{Circle}{24}{3}{}
-\fontspec_define_feature_option:nnnnn{Annotation}{BlackCircle}{24}{4}{}
-\fontspec_define_feature_option:nnnnn{Annotation}{Parenthesis}{24}{5}{}
-\fontspec_define_feature_option:nnnnn{Annotation}{Period}{24}{6}{}
-\fontspec_define_feature_option:nnnnn{Annotation}{RomanNumerals}{24}{7}{}
-\fontspec_define_feature_option:nnnnn{Annotation}{Diamond}{24}{8}{}
-\fontspec_define_feature_option:nnnnn{Annotation}{BlackSquare}{24}{9}{}
-\fontspec_define_feature_option:nnnnn{Annotation}{BlackRoundSquare}{24}{10}{}
-\fontspec_define_feature_option:nnnnn{Annotation}{DoubleCircle}{24}{11}{}
-\define@key[zf]{options}{Annotation}[0]{
- \clist_set_eq:NN \l_fontspec_tmpa_clist \XKV@rm
- \setkeys*[zf@feat]{Annotation}{#1}
- \tl_if_empty:NF \XKV@rm {
- \def\XKV@tfam{Alternate}
- \fontspec_make_feature:nnx {}{} { \fontspec_nalt:n {#1} }
- }
- \clist_set_eq:NN \XKV@rm \l_fontspec_tmpa_clist
-}
-\xetex_or_luatex:nnn { \cs_set:Npn \fontspec_nalt:n #1 }
- {+nalt=#1} { +nalt= \int_eval:n {#1+1} }
-\fontspec_define_font_feature:n{Vertical}
-\define@key[zf@feat]{Vertical}{RotatedGlyphs}[]{
- \bool_if:NTF \l_fontspec_icu_bool {
- \fontspec_make_feature:nnn{}{}{+vrt2}
- \fontspec_update_fontid:n {+vert}
- \fontspec_update_featstr:n{vertical}
- }{
- \fontspec_update_fontid:n {+vert}
- \fontspec_update_featstr:n{vertical}
- }
-}
-\newfontscript{Arabic}{arab} \newfontscript{Armenian}{armn}
-\newfontscript{Balinese}{bali} \newfontscript{Bengali}{beng}
-\newfontscript{Bopomofo}{bopo} \newfontscript{Braille}{brai}
-\newfontscript{Buginese}{bugi} \newfontscript{Buhid}{buhd}
-\newfontscript{Byzantine~Music}{byzm} \newfontscript{Canadian~Syllabics}{cans}
-\newfontscript{Cherokee}{cher}
-\newfontscript{CJK~Ideographic}{hani} \newfontscript{Coptic}{copt}
-\newfontscript{Cypriot~Syllabary}{cprt} \newfontscript{Cyrillic}{cyrl}
-\newfontscript{Default}{DFLT} \newfontscript{Deseret}{dsrt}
-\newfontscript{Devanagari}{deva} \newfontscript{Ethiopic}{ethi}
-\newfontscript{Georgian}{geor} \newfontscript{Glagolitic}{glag}
-\newfontscript{Gothic}{goth} \newfontscript{Greek}{grek}
-\newfontscript{Gujarati}{gujr} \newfontscript{Gurmukhi}{guru}
-\newfontscript{Hangul~Jamo}{jamo} \newfontscript{Hangul}{hang}
-\newfontscript{Hanunoo}{hano} \newfontscript{Hebrew}{hebr}
-\newfontscript{Hiragana~and~Katakana}{kana}
-\newfontscript{Javanese}{java} \newfontscript{Kannada}{knda}
-\newfontscript{Kharosthi}{khar} \newfontscript{Khmer}{khmr}
-\newfontscript{Lao}{lao~} \newfontscript{Latin}{latn}
-\newfontscript{Limbu}{limb} \newfontscript{Linear~B}{linb}
-\newfontscript{Malayalam}{mlym} \newfontscript{Math}{math}
-\newfontscript{Mongolian}{mong}
-\newfontscript{Musical~Symbols}{musc} \newfontscript{Myanmar}{mymr}
-\newfontscript{N'ko}{nko~} \newfontscript{Ogham}{ogam}
-\newfontscript{Old~Italic}{ital}
-\newfontscript{Old~Persian~Cuneiform}{xpeo}
-\newfontscript{Oriya}{orya} \newfontscript{Osmanya}{osma}
-\newfontscript{Phags-pa}{phag} \newfontscript{Phoenician}{phnx}
-\newfontscript{Runic}{runr} \newfontscript{Shavian}{shaw}
-\newfontscript{Sinhala}{sinh}
-\newfontscript{Sumero-Akkadian~Cuneiform}{xsux}
-\newfontscript{Syloti~Nagri}{sylo} \newfontscript{Syriac}{syrc}
-\newfontscript{Tagalog}{tglg} \newfontscript{Tagbanwa}{tagb}
-\newfontscript{Tai~Le}{tale} \newfontscript{Tai~Lu}{talu}
-\newfontscript{Tamil}{taml} \newfontscript{Telugu}{telu}
-\newfontscript{Thaana}{thaa} \newfontscript{Thai}{thai}
-\newfontscript{Tibetan}{tibt} \newfontscript{Tifinagh}{tfng}
-\newfontscript{Ugaritic~Cuneiform}{ugar}\newfontscript{Yi}{yi~~}
-\newfontscript{Kana}{kana}
-\newfontscript{Maths}{math}
-\newfontscript{CJK}{hani}
-\newfontlanguage{Abaza}{ABA}\newfontlanguage{Abkhazian}{ABK}
-\newfontlanguage{Adyghe}{ADY}\newfontlanguage{Afrikaans}{AFK}
-\newfontlanguage{Afar}{AFR}\newfontlanguage{Agaw}{AGW}
-\newfontlanguage{Altai}{ALT}\newfontlanguage{Amharic}{AMH}
-\newfontlanguage{Arabic}{ARA}\newfontlanguage{Aari}{ARI}
-\newfontlanguage{Arakanese}{ARK}\newfontlanguage{Assamese}{ASM}
-\newfontlanguage{Athapaskan}{ATH}\newfontlanguage{Avar}{AVR}
-\newfontlanguage{Awadhi}{AWA}\newfontlanguage{Aymara}{AYM}
-\newfontlanguage{Azeri}{AZE}\newfontlanguage{Badaga}{BAD}
-\newfontlanguage{Baghelkhandi}{BAG}\newfontlanguage{Balkar}{BAL}
-\newfontlanguage{Baule}{BAU}\newfontlanguage{Berber}{BBR}
-\newfontlanguage{Bench}{BCH}\newfontlanguage{Bible~Cree}{BCR}
-\newfontlanguage{Belarussian}{BEL}\newfontlanguage{Bemba}{BEM}
-\newfontlanguage{Bengali}{BEN}\newfontlanguage{Bulgarian}{BGR}
-\newfontlanguage{Bhili}{BHI}\newfontlanguage{Bhojpuri}{BHO}
-\newfontlanguage{Bikol}{BIK}\newfontlanguage{Bilen}{BIL}
-\newfontlanguage{Blackfoot}{BKF}\newfontlanguage{Balochi}{BLI}
-\newfontlanguage{Balante}{BLN}\newfontlanguage{Balti}{BLT}
-\newfontlanguage{Bambara}{BMB}\newfontlanguage{Bamileke}{BML}
-\newfontlanguage{Breton}{BRE}\newfontlanguage{Brahui}{BRH}
-\newfontlanguage{Braj~Bhasha}{BRI}\newfontlanguage{Burmese}{BRM}
-\newfontlanguage{Bashkir}{BSH}\newfontlanguage{Beti}{BTI}
-\newfontlanguage{Catalan}{CAT}\newfontlanguage{Cebuano}{CEB}
-\newfontlanguage{Chechen}{CHE}\newfontlanguage{Chaha~Gurage}{CHG}
-\newfontlanguage{Chattisgarhi}{CHH}\newfontlanguage{Chichewa}{CHI}
-\newfontlanguage{Chukchi}{CHK}\newfontlanguage{Chipewyan}{CHP}
-\newfontlanguage{Cherokee}{CHR}\newfontlanguage{Chuvash}{CHU}
-\newfontlanguage{Comorian}{CMR}\newfontlanguage{Coptic}{COP}
-\newfontlanguage{Cree}{CRE}\newfontlanguage{Carrier}{CRR}
-\newfontlanguage{Crimean~Tatar}{CRT}\newfontlanguage{Church~Slavonic}{CSL}
-\newfontlanguage{Czech}{CSY}\newfontlanguage{Danish}{DAN}
-\newfontlanguage{Dargwa}{DAR}\newfontlanguage{Woods~Cree}{DCR}
-\newfontlanguage{German}{DEU}
-\newfontlanguage{Dogri}{DGR}\newfontlanguage{Divehi}{DIV}
-\newfontlanguage{Djerma}{DJR}\newfontlanguage{Dangme}{DNG}
-\newfontlanguage{Dinka}{DNK}\newfontlanguage{Dungan}{DUN}
-\newfontlanguage{Dzongkha}{DZN}\newfontlanguage{Ebira}{EBI}
-\newfontlanguage{Eastern~Cree}{ECR}\newfontlanguage{Edo}{EDO}
-\newfontlanguage{Efik}{EFI}\newfontlanguage{Greek}{ELL}
-\newfontlanguage{English}{ENG}\newfontlanguage{Erzya}{ERZ}
-\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{Parsi}{FAR}
-\newfontlanguage{Persian}{FAR}
-\newfontlanguage{Finnish}{FIN}\newfontlanguage{Fijian}{FJI}
-\newfontlanguage{Flemish}{FLE}\newfontlanguage{Forest~Nenets}{FNE}
-\newfontlanguage{Fon}{FON}\newfontlanguage{Faroese}{FOS}
-\newfontlanguage{French}{FRA}\newfontlanguage{Frisian}{FRI}
-\newfontlanguage{Friulian}{FRL}\newfontlanguage{Futa}{FTA}
-\newfontlanguage{Fulani}{FUL}\newfontlanguage{Ga}{GAD}
-\newfontlanguage{Gaelic}{GAE}\newfontlanguage{Gagauz}{GAG}
-\newfontlanguage{Galician}{GAL}\newfontlanguage{Garshuni}{GAR}
-\newfontlanguage{Garhwali}{GAW}\newfontlanguage{Ge'ez}{GEZ}
-\newfontlanguage{Gilyak}{GIL}\newfontlanguage{Gumuz}{GMZ}
-\newfontlanguage{Gondi}{GON}\newfontlanguage{Greenlandic}{GRN}
-\newfontlanguage{Garo}{GRO}\newfontlanguage{Guarani}{GUA}
-\newfontlanguage{Gujarati}{GUJ}\newfontlanguage{Haitian}{HAI}
-\newfontlanguage{Halam}{HAL}\newfontlanguage{Harauti}{HAR}
-\newfontlanguage{Hausa}{HAU}\newfontlanguage{Hawaiin}{HAW}
-\newfontlanguage{Hammer-Banna}{HBN}\newfontlanguage{Hiligaynon}{HIL}
-\newfontlanguage{Hindi}{HIN}\newfontlanguage{High~Mari}{HMA}
-\newfontlanguage{Hindko}{HND}\newfontlanguage{Ho}{HO}
-\newfontlanguage{Harari}{HRI}\newfontlanguage{Croatian}{HRV}
-\newfontlanguage{Hungarian}{HUN}\newfontlanguage{Armenian}{HYE}
-\newfontlanguage{Igbo}{IBO}\newfontlanguage{Ijo}{IJO}
-\newfontlanguage{Ilokano}{ILO}\newfontlanguage{Indonesian}{IND}
-\newfontlanguage{Ingush}{ING}\newfontlanguage{Inuktitut}{INU}
-\newfontlanguage{Irish}{IRI}\newfontlanguage{Irish~Traditional}{IRT}
-\newfontlanguage{Icelandic}{ISL}\newfontlanguage{Inari~Sami}{ISM}
-\newfontlanguage{Italian}{ITA}\newfontlanguage{Hebrew}{IWR}
-\newfontlanguage{Javanese}{JAV}\newfontlanguage{Yiddish}{JII}
-\newfontlanguage{Japanese}{JAN}\newfontlanguage{Judezmo}{JUD}
-\newfontlanguage{Jula}{JUL}\newfontlanguage{Kabardian}{KAB}
-\newfontlanguage{Kachchi}{KAC}\newfontlanguage{Kalenjin}{KAL}
-\newfontlanguage{Kannada}{KAN}\newfontlanguage{Karachay}{KAR}
-\newfontlanguage{Georgian}{KAT}\newfontlanguage{Kazakh}{KAZ}
-\newfontlanguage{Kebena}{KEB}\newfontlanguage{Khutsuri~Georgian}{KGE}
-\newfontlanguage{Khakass}{KHA}\newfontlanguage{Khanty-Kazim}{KHK}
-\newfontlanguage{Khmer}{KHM}\newfontlanguage{Khanty-Shurishkar}{KHS}
-\newfontlanguage{Khanty-Vakhi}{KHV}\newfontlanguage{Khowar}{KHW}
-\newfontlanguage{Kikuyu}{KIK}\newfontlanguage{Kirghiz}{KIR}
-\newfontlanguage{Kisii}{KIS}\newfontlanguage{Kokni}{KKN}
-\newfontlanguage{Kalmyk}{KLM}\newfontlanguage{Kamba}{KMB}
-\newfontlanguage{Kumaoni}{KMN}\newfontlanguage{Komo}{KMO}
-\newfontlanguage{Komso}{KMS}\newfontlanguage{Kanuri}{KNR}
-\newfontlanguage{Kodagu}{KOD}\newfontlanguage{Korean~Old~Hangul}{KOH}
-\newfontlanguage{Konkani}{KOK}\newfontlanguage{Kikongo}{KON}
-\newfontlanguage{Komi-Permyak}{KOP}\newfontlanguage{Korean}{KOR}
-\newfontlanguage{Komi-Zyrian}{KOZ}\newfontlanguage{Kpelle}{KPL}
-\newfontlanguage{Krio}{KRI}\newfontlanguage{Karakalpak}{KRK}
-\newfontlanguage{Karelian}{KRL}\newfontlanguage{Karaim}{KRM}
-\newfontlanguage{Karen}{KRN}\newfontlanguage{Koorete}{KRT}
-\newfontlanguage{Kashmiri}{KSH}\newfontlanguage{Khasi}{KSI}
-\newfontlanguage{Kildin~Sami}{KSM}\newfontlanguage{Kui}{KUI}
-\newfontlanguage{Kulvi}{KUL}\newfontlanguage{Kumyk}{KUM}
-\newfontlanguage{Kurdish}{KUR}\newfontlanguage{Kurukh}{KUU}
-\newfontlanguage{Kuy}{KUY}\newfontlanguage{Koryak}{KYK}
-\newfontlanguage{Ladin}{LAD}\newfontlanguage{Lahuli}{LAH}
-\newfontlanguage{Lak}{LAK}\newfontlanguage{Lambani}{LAM}
-\newfontlanguage{Lao}{LAO}\newfontlanguage{Latin}{LAT}
-\newfontlanguage{Laz}{LAZ}\newfontlanguage{L-Cree}{LCR}
-\newfontlanguage{Ladakhi}{LDK}\newfontlanguage{Lezgi}{LEZ}
-\newfontlanguage{Lingala}{LIN}\newfontlanguage{Low~Mari}{LMA}
-\newfontlanguage{Limbu}{LMB}\newfontlanguage{Lomwe}{LMW}
-\newfontlanguage{Lower~Sorbian}{LSB}\newfontlanguage{Lule~Sami}{LSM}
-\newfontlanguage{Lithuanian}{LTH}\newfontlanguage{Luba}{LUB}
-\newfontlanguage{Luganda}{LUG}\newfontlanguage{Luhya}{LUH}
-\newfontlanguage{Luo}{LUO}\newfontlanguage{Latvian}{LVI}
-\newfontlanguage{Majang}{MAJ}\newfontlanguage{Makua}{MAK}
-\newfontlanguage{Malayalam~Traditional}{MAL}\newfontlanguage{Mansi}{MAN}
-\newfontlanguage{Marathi}{MAR}\newfontlanguage{Marwari}{MAW}
-\newfontlanguage{Mbundu}{MBN}\newfontlanguage{Manchu}{MCH}
-\newfontlanguage{Moose~Cree}{MCR}\newfontlanguage{Mende}{MDE}
-\newfontlanguage{Me'en}{MEN}\newfontlanguage{Mizo}{MIZ}
-\newfontlanguage{Macedonian}{MKD}\newfontlanguage{Male}{MLE}
-\newfontlanguage{Malagasy}{MLG}\newfontlanguage{Malinke}{MLN}
-\newfontlanguage{Malayalam~Reformed}{MLR}\newfontlanguage{Malay}{MLY}
-\newfontlanguage{Mandinka}{MND}\newfontlanguage{Mongolian}{MNG}
-\newfontlanguage{Manipuri}{MNI}\newfontlanguage{Maninka}{MNK}
-\newfontlanguage{Manx~Gaelic}{MNX}\newfontlanguage{Moksha}{MOK}
-\newfontlanguage{Moldavian}{MOL}\newfontlanguage{Mon}{MON}
-\newfontlanguage{Moroccan}{MOR}\newfontlanguage{Maori}{MRI}
-\newfontlanguage{Maithili}{MTH}\newfontlanguage{Maltese}{MTS}
-\newfontlanguage{Mundari}{MUN}\newfontlanguage{Naga-Assamese}{NAG}
-\newfontlanguage{Nanai}{NAN}\newfontlanguage{Naskapi}{NAS}
-\newfontlanguage{N-Cree}{NCR}\newfontlanguage{Ndebele}{NDB}
-\newfontlanguage{Ndonga}{NDG}\newfontlanguage{Nepali}{NEP}
-\newfontlanguage{Newari}{NEW}\newfontlanguage{Nagari}{NGR}
-\newfontlanguage{Norway~House~Cree}{NHC}\newfontlanguage{Nisi}{NIS}
-\newfontlanguage{Niuean}{NIU}\newfontlanguage{Nkole}{NKL}
-\newfontlanguage{N'ko}{NKO}\newfontlanguage{Dutch}{NLD}
-\newfontlanguage{Nogai}{NOG}\newfontlanguage{Norwegian}{NOR}
-\newfontlanguage{Northern~Sami}{NSM}\newfontlanguage{Northern~Tai}{NTA}
-\newfontlanguage{Esperanto}{NTO}\newfontlanguage{Nynorsk}{NYN}
-\newfontlanguage{Oji-Cree}{OCR}\newfontlanguage{Ojibway}{OJB}
-\newfontlanguage{Oriya}{ORI}\newfontlanguage{Oromo}{ORO}
-\newfontlanguage{Ossetian}{OSS}\newfontlanguage{Palestinian~Aramaic}{PAA}
-\newfontlanguage{Pali}{PAL}\newfontlanguage{Punjabi}{PAN}
-\newfontlanguage{Palpa}{PAP}\newfontlanguage{Pashto}{PAS}
-\newfontlanguage{Polytonic~Greek}{PGR}\newfontlanguage{Pilipino}{PIL}
-\newfontlanguage{Palaung}{PLG}\newfontlanguage{Polish}{PLK}
-\newfontlanguage{Provencal}{PRO}\newfontlanguage{Portuguese}{PTG}
-\newfontlanguage{Chin}{QIN}\newfontlanguage{Rajasthani}{RAJ}
-\newfontlanguage{R-Cree}{RCR}\newfontlanguage{Russian~Buriat}{RBU}
-\newfontlanguage{Riang}{RIA}\newfontlanguage{Rhaeto-Romanic}{RMS}
-\newfontlanguage{Romanian}{ROM}\newfontlanguage{Romany}{ROY}
-\newfontlanguage{Rusyn}{RSY}\newfontlanguage{Ruanda}{RUA}
-\newfontlanguage{Russian}{RUS}\newfontlanguage{Sadri}{SAD}
-\newfontlanguage{Sanskrit}{SAN}\newfontlanguage{Santali}{SAT}
-\newfontlanguage{Sayisi}{SAY}\newfontlanguage{Sekota}{SEK}
-\newfontlanguage{Selkup}{SEL}\newfontlanguage{Sango}{SGO}
-\newfontlanguage{Shan}{SHN}\newfontlanguage{Sibe}{SIB}
-\newfontlanguage{Sidamo}{SID}\newfontlanguage{Silte~Gurage}{SIG}
-\newfontlanguage{Skolt~Sami}{SKS}\newfontlanguage{Slovak}{SKY}
-\newfontlanguage{Slavey}{SLA}\newfontlanguage{Slovenian}{SLV}
-\newfontlanguage{Somali}{SML}\newfontlanguage{Samoan}{SMO}
-\newfontlanguage{Sena}{SNA}\newfontlanguage{Sindhi}{SND}
-\newfontlanguage{Sinhalese}{SNH}\newfontlanguage{Soninke}{SNK}
-\newfontlanguage{Sodo~Gurage}{SOG}\newfontlanguage{Sotho}{SOT}
-\newfontlanguage{Albanian}{SQI}\newfontlanguage{Serbian}{SRB}
-\newfontlanguage{Saraiki}{SRK}\newfontlanguage{Serer}{SRR}
-\newfontlanguage{South~Slavey}{SSL}\newfontlanguage{Southern~Sami}{SSM}
-\newfontlanguage{Suri}{SUR}\newfontlanguage{Svan}{SVA}
-\newfontlanguage{Swedish}{SVE}\newfontlanguage{Swadaya~Aramaic}{SWA}
-\newfontlanguage{Swahili}{SWK}\newfontlanguage{Swazi}{SWZ}
-\newfontlanguage{Sutu}{SXT}\newfontlanguage{Syriac}{SYR}
-\newfontlanguage{Tabasaran}{TAB}\newfontlanguage{Tajiki}{TAJ}
-\newfontlanguage{Tamil}{TAM}\newfontlanguage{Tatar}{TAT}
-\newfontlanguage{TH-Cree}{TCR}\newfontlanguage{Telugu}{TEL}
-\newfontlanguage{Tongan}{TGN}\newfontlanguage{Tigre}{TGR}
-\newfontlanguage{Tigrinya}{TGY}\newfontlanguage{Thai}{THA}
-\newfontlanguage{Tahitian}{THT}\newfontlanguage{Tibetan}{TIB}
-\newfontlanguage{Turkmen}{TKM}\newfontlanguage{Temne}{TMN}
-\newfontlanguage{Tswana}{TNA}\newfontlanguage{Tundra~Nenets}{TNE}
-\newfontlanguage{Tonga}{TNG}\newfontlanguage{Todo}{TOD}
-\newfontlanguage{Tsonga}{TSG}\newfontlanguage{Turoyo~Aramaic}{TUA}
-\newfontlanguage{Tulu}{TUL}\newfontlanguage{Tuvin}{TUV}
-\newfontlanguage{Twi}{TWI}\newfontlanguage{Udmurt}{UDM}
-\newfontlanguage{Ukrainian}{UKR}\newfontlanguage{Urdu}{URD}
-\newfontlanguage{Upper~Sorbian}{USB}\newfontlanguage{Uyghur}{UYG}
-\newfontlanguage{Uzbek}{UZB}\newfontlanguage{Venda}{VEN}
-\newfontlanguage{Vietnamese}{VIT}\newfontlanguage{Wa}{WA}
-\newfontlanguage{Wagdi}{WAG}\newfontlanguage{West-Cree}{WCR}
-\newfontlanguage{Welsh}{WEL}\newfontlanguage{Wolof}{WLF}
-\newfontlanguage{Tai~Lue}{XBD}\newfontlanguage{Xhosa}{XHS}
-\newfontlanguage{Yakut}{YAK}\newfontlanguage{Yoruba}{YBA}
-\newfontlanguage{Y-Cree}{YCR}\newfontlanguage{Yi~Classic}{YIC}
-\newfontlanguage{Yi~Modern}{YIM}\newfontlanguage{Chinese~Hong~Kong}{ZHH}
-\newfontlanguage{Chinese~Phonetic}{ZHP}\newfontlanguage{Chinese~Simplified}{ZHS}
-\newfontlanguage{Chinese~Traditional}{ZHT}\newfontlanguage{Zande}{ZND}
-\newfontlanguage{Zulu}{ZUL}
-\define@key[zf@feat]{Lang}{Turkish}[]{
- \fontspec_check_lang:nTF {TRK} {
- \int_set:Nn \l_fontspec_language_int {\l_fontspec_strnum_int}
- \fontspec_update_fontid:n {+lang=Turkish}
- \tl_set:Nn \l_fontspec_lang_tl {TRK}
- }{
- \fontspec_check_lang:nTF {TUR} {
- \int_set:Nn \l_fontspec_language_int {\l_fontspec_strnum_int}
- \fontspec_update_fontid:n {+lang=Turkish}
- \tl_set:Nn \l_fontspec_lang_tl {TUR}
- }{
- \fontspec_warning:nx {language-not-exist} {#1}
- \setkeys[zf@feat]{Lang}{Default}
- }
- }
-}
-\define@key[zf@feat]{Lang}{Default}[]{
- \fontspec_update_fontid:n {+lang=dflt}
- \tl_set:Nn \l_fontspec_lang_tl {DFLT}
- \int_zero:N \l_fontspec_language_int
-}
-\define@key[zf]{options}{RawFeature}{
- \fontspec_update_fontid:n {+Raw:#1}
- \fontspec_update_featstr:n{#1}
-}
-\providecommand*{\sidefault}{si}
-\DeclareRobustCommand{\sishape}{
- \not@math@alphabet\sishape\relax
- \fontshape\sidefault\selectfont
-}
-\DeclareTextFontCommand{\textsi}{\sishape}
-\cs_new:Nn \fontspec_blend_shape:nnn {
- \bool_if:nTF
- {
- \str_if_eq_p:xx {\f@shape} {#2} &&
- \cs_if_exist_p:c {\f@encoding/\f@family/\f@series/#3}
- }
- { \fontshape{#3}\selectfont }
- { \fontshape{#1}\selectfont }
-}
-\DeclareRobustCommand \itshape {
- \not@math@alphabet\itshape\mathit
- \fontspec_blend_shape:nnn\itdefault\scdefault\sidefault
-}
-\DeclareRobustCommand \slshape {
- \not@math@alphabet\slshape\relax
- \fontspec_blend_shape:nnn\sldefault\scdefault\sidefault
-}
-\DeclareRobustCommand \scshape {
- \not@math@alphabet\scshape\relax
- \fontspec_blend_shape:nnn\scdefault\itdefault\sidefault
-}
-\DeclareRobustCommand \upshape {
- \not@math@alphabet\upshape\relax
- \fontspec_blend_shape:nnn\updefault\sidefault\scdefault
-}
-\@ifpackageloaded{euler}{
- \bool_set_true:N \g_fontspec_package_euler_loaded_bool
-}{
- \bool_set_false:N \g_fontspec_package_euler_loaded_bool
-}
-\cs_set:Nn \fontspec_setup_maths: {
- \@ifpackageloaded{euler}{
- \bool_if:NTF \g_fontspec_package_euler_loaded_bool {
- \bool_set_true:N \g_fontspec_math_euler_bool
- }{
- \fontspec_error:n {euler-too-late}
- }
- }{}
- \@ifpackageloaded{lucbmath}{\bool_set_true:N \g_fontspec_math_lucida_bool}{}
- \@ifpackageloaded{lucidabr}{\bool_set_true:N \g_fontspec_math_lucida_bool}{}
- \@ifpackageloaded{lucimatx}{\bool_set_true:N \g_fontspec_math_lucida_bool}{}
- \DeclareSymbolFont{legacymaths}{OT1}{cmr}{m}{n}
- \SetSymbolFont{legacymaths}{bold}{OT1}{cmr}{bx}{n}
- \DeclareMathAccent{\acute} {\mathalpha}{legacymaths}{19}
- \DeclareMathAccent{\grave} {\mathalpha}{legacymaths}{18}
- \DeclareMathAccent{\ddot} {\mathalpha}{legacymaths}{127}
- \DeclareMathAccent{\tilde} {\mathalpha}{legacymaths}{126}
- \DeclareMathAccent{\bar} {\mathalpha}{legacymaths}{22}
- \DeclareMathAccent{\breve} {\mathalpha}{legacymaths}{21}
- \DeclareMathAccent{\check} {\mathalpha}{legacymaths}{20}
- \DeclareMathAccent{\hat} {\mathalpha}{legacymaths}{94} % too bad, euler
- \DeclareMathAccent{\dot} {\mathalpha}{legacymaths}{95}
- \DeclareMathAccent{\mathring}{\mathalpha}{legacymaths}{23}
- \group_begin:
- \mathchardef\@tempa="603A \relax
- \ifx\colon\@tempa
- \DeclareMathSymbol{\colon}{\mathpunct}{legacymaths}{58}
- \fi
- \group_end:
- \bool_if:NF \g_fontspec_math_euler_bool {
- \DeclareMathSymbol{!}{\mathclose}{legacymaths}{33}
- \DeclareMathSymbol{:}{\mathrel} {legacymaths}{58}
- \DeclareMathSymbol{;}{\mathpunct}{legacymaths}{59}
- \DeclareMathSymbol{?}{\mathclose}{legacymaths}{63}
- \bool_if:NF \g_fontspec_math_lucida_bool {
- \DeclareMathSymbol{0}{\mathalpha}{legacymaths}{`0}
- \DeclareMathSymbol{1}{\mathalpha}{legacymaths}{`1}
- \DeclareMathSymbol{2}{\mathalpha}{legacymaths}{`2}
- \DeclareMathSymbol{3}{\mathalpha}{legacymaths}{`3}
- \DeclareMathSymbol{4}{\mathalpha}{legacymaths}{`4}
- \DeclareMathSymbol{5}{\mathalpha}{legacymaths}{`5}
- \DeclareMathSymbol{6}{\mathalpha}{legacymaths}{`6}
- \DeclareMathSymbol{7}{\mathalpha}{legacymaths}{`7}
- \DeclareMathSymbol{8}{\mathalpha}{legacymaths}{`8}
- \DeclareMathSymbol{9}{\mathalpha}{legacymaths}{`9}
- \DeclareMathSymbol{\Gamma}{\mathalpha}{legacymaths}{0}
- \DeclareMathSymbol{\Delta}{\mathalpha}{legacymaths}{1}
- \DeclareMathSymbol{\Theta}{\mathalpha}{legacymaths}{2}
- \DeclareMathSymbol{\Lambda}{\mathalpha}{legacymaths}{3}
- \DeclareMathSymbol{\Xi}{\mathalpha}{legacymaths}{4}
- \DeclareMathSymbol{\Pi}{\mathalpha}{legacymaths}{5}
- \DeclareMathSymbol{\Sigma}{\mathalpha}{legacymaths}{6}
- \DeclareMathSymbol{\Upsilon}{\mathalpha}{legacymaths}{7}
- \DeclareMathSymbol{\Phi}{\mathalpha}{legacymaths}{8}
- \DeclareMathSymbol{\Psi}{\mathalpha}{legacymaths}{9}
- \DeclareMathSymbol{\Omega}{\mathalpha}{legacymaths}{10}
- \DeclareMathSymbol{+}{\mathbin}{legacymaths}{43}
- \DeclareMathSymbol{=}{\mathrel}{legacymaths}{61}
- \DeclareMathDelimiter{(}{\mathopen} {legacymaths}{40}{largesymbols}{0}
- \DeclareMathDelimiter{)}{\mathclose}{legacymaths}{41}{largesymbols}{1}
- \DeclareMathDelimiter{[}{\mathopen} {legacymaths}{91}{largesymbols}{2}
- \DeclareMathDelimiter{]}{\mathclose}{legacymaths}{93}{largesymbols}{3}
- \DeclareMathDelimiter{/}{\mathord}{legacymaths}{47}{largesymbols}{14}
- \DeclareMathSymbol{\mathdollar}{\mathord}{legacymaths}{36}
- }
- }
- \DeclareSymbolFont{operators}\zf@enc\g_fontspec_mathrm_tl\mddefault\updefault
- \SetSymbolFont{operators}{normal}\zf@enc\g_fontspec_mathrm_tl\mddefault\updefault
- \SetMathAlphabet\mathrm{normal}\zf@enc\g_fontspec_mathrm_tl\mddefault\updefault
- \SetMathAlphabet\mathit{normal}\zf@enc\g_fontspec_mathrm_tl\mddefault\itdefault
- \SetMathAlphabet\mathbf{normal}\zf@enc\g_fontspec_mathrm_tl\bfdefault\updefault
- \SetMathAlphabet\mathsf{normal}\zf@enc\g_fontspec_mathsf_tl\mddefault\updefault
- \SetMathAlphabet\mathtt{normal}\zf@enc\g_fontspec_mathtt_tl\mddefault\updefault
- \SetSymbolFont{operators}{bold}\zf@enc\g_fontspec_mathrm_tl\bfdefault\updefault
- \tl_if_empty:NTF \g_fontspec_bfmathrm_tl {
- \SetMathAlphabet\mathrm{bold}\zf@enc\g_fontspec_mathrm_tl\bfdefault\updefault
- \SetMathAlphabet\mathit{bold}\zf@enc\g_fontspec_mathrm_tl\bfdefault\itdefault
- }{
- \SetMathAlphabet\mathrm{bold}\zf@enc\g_fontspec_bfmathrm_tl\mddefault\updefault
- \SetMathAlphabet\mathbf{bold}\zf@enc\g_fontspec_bfmathrm_tl\bfdefault\updefault
- \SetMathAlphabet\mathit{bold}\zf@enc\g_fontspec_bfmathrm_tl\mddefault\itdefault
- }
- \SetMathAlphabet\mathsf{bold}\zf@enc\g_fontspec_mathsf_tl\bfdefault\updefault
- \SetMathAlphabet\mathtt{bold}\zf@enc\g_fontspec_mathtt_tl\bfdefault\updefault
-}
-\cs_new:Nn \fontspec_maybe_setup_maths: {
- \@ifpackageloaded{anttor}{
- \ifx\define@antt@mathversions a\bool_set_false:N \g_fontspec_math_bool\fi}{}
- \@ifpackageloaded{arev}{\bool_set_false:N \g_fontspec_math_bool}{}
- \@ifpackageloaded{eulervm}{\bool_set_false:N \g_fontspec_math_bool}{}
- \@ifpackageloaded{mathdesign}{\bool_set_false:N \g_fontspec_math_bool}{}
- \@ifpackageloaded{concmath}{\bool_set_false:N \g_fontspec_math_bool}{}
- \@ifpackageloaded{cmbright}{\bool_set_false:N \g_fontspec_math_bool}{}
- \@ifpackageloaded{mathesf}{\bool_set_false:N \g_fontspec_math_bool}{}
- \@ifpackageloaded{gfsartemisia}{\bool_set_false:N \g_fontspec_math_bool}{}
- \@ifpackageloaded{gfsneohellenic}{\bool_set_false:N \g_fontspec_math_bool}{}
- \@ifpackageloaded{iwona}{
- \ifx\define@iwona@mathversions a\bool_set_false:N \g_fontspec_math_bool\fi}{}
- \@ifpackageloaded{kpfonts}{\bool_set_false:N \g_fontspec_math_bool}{}
- \@ifpackageloaded{kmath}{\bool_set_false:N \g_fontspec_math_bool}{}
- \@ifpackageloaded{kurier}{
- \ifx\define@kurier@mathversions a\bool_set_false:N \g_fontspec_math_bool\fi}{}
- \@ifpackageloaded{fouriernc}{\bool_set_false:N \g_fontspec_math_bool}{}
- \@ifpackageloaded{fourier}{\bool_set_false:N \g_fontspec_math_bool}{}
- \@ifpackageloaded{mathpazo}{\bool_set_false:N \g_fontspec_math_bool}{}
- \@ifpackageloaded{mathptmx}{\bool_set_false:N \g_fontspec_math_bool}{}
- \@ifpackageloaded{MinionPro}{\bool_set_false:N \g_fontspec_math_bool}{}
- \@ifpackageloaded{unicode-math}{\bool_set_false:N \g_fontspec_math_bool}{}
- \@ifpackageloaded{breqn}{\bool_set_false:N \g_fontspec_math_bool}{}
- \bool_if:NT \g_fontspec_math_bool {
- \fontspec_info:n {setup-math}
- \fontspec_setup_maths:
- }
-}
-\AtBeginDocument{\fontspec_maybe_setup_maths:}
-\bool_if:NT \g_fontspec_cfg_bool {
- \InputIfFileExists{fontspec.cfg}
- {}
- {\typeout{No~ fontspec.cfg~ file~ found;~ no~ configuration~ loaded.}}
-}
+\luatex_if_engine:T { \usepackage{fontspec-luatex} \endinput }
+\xetex_if_engine:T { \usepackage{fontspec-xetex} \endinput }
%%
%% Copyright 2004--2011 Will Robertson <wspr81@gmail.com>
%% Copyright 2009--2010 Khaled Hosny <khaledhosny@eglug.org>