diff options
author | Karl Berry <karl@freefriends.org> | 2011-02-26 23:47:28 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-02-26 23:47:28 +0000 |
commit | f07534a834462ff702e6d3a52dbd795f4f7262ad (patch) | |
tree | 80f1ba95ba5652c9a76c4a2e7851395649a5c6f1 | |
parent | ddb39646bb545ff15c6a16a71e32ad697cddf11a (diff) |
fontspec (26feb11)
git-svn-id: svn://tug.org/texlive/trunk@21527 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/fontspec/README | 8 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/fontspec/fontspec-testsuite.pdf | bin | 172095 -> 172238 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/fontspec/fontspec.pdf | bin | 2757565 -> 2759630 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/fontspec/fontspec.dtx | 157 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/fontspec/fontspec-patches.sty | 6 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/fontspec/fontspec.lua | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/fontspec/fontspec.sty | 106 |
7 files changed, 190 insertions, 91 deletions
diff --git a/Master/texmf-dist/doc/latex/fontspec/README b/Master/texmf-dist/doc/latex/fontspec/README index 63c18e41c85..3d5f070338d 100644 --- a/Master/texmf-dist/doc/latex/fontspec/README +++ b/Master/texmf-dist/doc/latex/fontspec/README @@ -88,6 +88,14 @@ Features can be renamed and feature options can be renamed with Change history -------------- +- v2.1f (2011/02/26) + + * Finally add a real error message when a font cannot be found! + * Add "Letters=Random" feature. + * Fix bug in which "Unknown feature `'..." warnings + were shown in the log file. + * Some small documentation improvements. + - v2.1e (2010/11/17) * Internal changes for luatexbase v0.3. diff --git a/Master/texmf-dist/doc/latex/fontspec/fontspec-testsuite.pdf b/Master/texmf-dist/doc/latex/fontspec/fontspec-testsuite.pdf Binary files differindex fe5e91b24e2..7bc955273b6 100644 --- a/Master/texmf-dist/doc/latex/fontspec/fontspec-testsuite.pdf +++ b/Master/texmf-dist/doc/latex/fontspec/fontspec-testsuite.pdf diff --git a/Master/texmf-dist/doc/latex/fontspec/fontspec.pdf b/Master/texmf-dist/doc/latex/fontspec/fontspec.pdf Binary files differindex aa30a7cf428..5b7392d96b5 100644 --- a/Master/texmf-dist/doc/latex/fontspec/fontspec.pdf +++ b/Master/texmf-dist/doc/latex/fontspec/fontspec.pdf diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec.dtx index 8f57befd73b..e020f651bed 100644 --- a/Master/texmf-dist/source/latex/fontspec/fontspec.dtx +++ b/Master/texmf-dist/source/latex/fontspec/fontspec.dtx @@ -9,7 +9,7 @@ _________________________________________ The fontspec package for XeLaTeX/LuaLaTeX - (C) 2004--2010 Will Robertson and Khaled Hosny + (C) 2004--2011 Will Robertson and Khaled Hosny License information appended. @@ -17,7 +17,7 @@ \endpreamble \postamble -Copyright 2004--2010 Will Robertson <wspr81@gmail.com> +Copyright 2004--2011 Will Robertson <wspr81@gmail.com> Copyright 2009--2010 Khaled Hosny <khaledhosny@eglug.org> Distributable under the LaTeX Project Public License, @@ -62,7 +62,7 @@ This work consists of this file fontspec.dtx %<fontspec>\ProvidesPackage{fontspec} %<patches>\ProvidesPackage{fontspec-patches} %<*fontspec|patches> - [2010/11/17 v2.1e Advanced font selection for XeLaTeX/LuaLaTeX] + [2011/02/26 v2.1f Advanced font selection for XeLaTeX/LuaLaTeX] %</fontspec|patches> % %<*driver> @@ -1226,7 +1226,8 @@ This work consists of this file fontspec.dtx % % \subsection{Contextuals} % This feature refers to substitutions of glyphs that vary `contextually' by their relative position in a word or string of characters; -% features such as contextual swashes are accessed here. +% features such as contextual swashes are accessed via the options shown in \ref{feat:Contextuals}. +% See \exref{swash} for an, er, example. % % \begin{features}{Contextuals} % \otf{Swash}{cswh} @@ -1460,6 +1461,10 @@ This work consists of this file fontspec.dtx % % \subsection{Kerning}\label{sec:kerning} % Specifies how inter-glyph spacing should behave. +% Well-made fonts include information for how differing +% amounts of space should be inserted between separate character pairs. +% This kerning space is inserted automatically but in rare +% circumstances you may wish to turn it off. % % \begin{features}{Kerning} % \otf{Uppercase}{cpsp} @@ -1467,7 +1472,12 @@ This work consists of this file fontspec.dtx % \end{features} % % As briefly mentioned previously at the end of \vref{sec:letters}, -% the \opt{Uppercase} option will add a small amount of tracking between uppercase letters, seen in \exref{kernup}, which uses the Romande fonts\note{\url{http://arkandis.tuxfamily.org/adffonts.html}} (thanks to Clea F. Rees for the suggestion). +% the \opt{Uppercase} option will add a small amount of tracking between +% uppercase letters, seen in \exref{kernup}, which uses the Romande +% fonts\note{\url{http://arkandis.tuxfamily.org/adffonts.html}} +% (thanks to Clea F. Rees for the suggestion). +% The \opt{Uppercase} option acts separately to the regular kerning +% controlled by the \opt{On}/\opt{Off} options. % % \begin{Xexample}[firstline=2]{kernup}{Adding extra kerning for uppercase letters. (The difference is usually very small.)} % \large @@ -1637,12 +1647,15 @@ This work consists of this file fontspec.dtx % % \subsubsection{\feat{Script} and \feat{Language} examples} % -% In the following examples, the Code2000 font\note{\url{http://www.code2000.net/}} -% is used to typeset the input with and without the OpenType Script -% applied. The text is only rendered correctly in the second case; +% In the examples shown in \exref{script-lang}, +% the Code2000 font\note{\url{http://www.code2000.net/}} +% is used to typeset various input texts with and without the OpenType Script +% applied for various alphabets. +% The text is only rendered correctly in the second case; % many examples of incorrect diacritic spacing as % well as a lack of contextual ligatures and rearrangement can be -% seen. Thanks to \name{Jonathan Kew}, \name{Yves Codet} and +% seen. +% Thanks to \name{Jonathan Kew}, \name{Yves Codet} and % \name{Gildas Hamel} for their contributions towards these examples. % % \begin{Xexample}[firstline=14,lastline=23]{script-lang}{An example of various Scripts and Languages.} @@ -2469,16 +2482,20 @@ This work consists of this file fontspec.dtx % \pkg{luaotfload} which loads \pkg{luatexbase} and \pkg{lualibs} too. % % \begin{macrocode} -\msg_new:nnn {fontspec} {not-pdftex} +\msg_new:nnn {fontspec} {cannot-use-pdftex} { - Requires~ XeTeX~ or~ LuaTeX~ to~ function! + The~ fontspec~ package~ requires~ either~ XeTeX~ or~ LuaTeX~ to~ function. + \\\\ + You~ must~ change~ your~ typesetting~ engine~ to,~ + e.g.,~ "xelatex"~ or~ "lualatex"\\ + instead~ of~ plain~ "latex"~ or~ "pdflatex". } \xetex_if_engine:F { \luatex_if_engine:TF { \RequirePackage{luaotfload} \RequireLuaModule{fontspec} }{ - \msg_fatal:nn {fontspec} {not-pdftex} + \msg_fatal:nn {fontspec} {cannot-use-pdftex} } } % \end{macrocode} @@ -2601,6 +2618,15 @@ This work consists of this file fontspec.dtx Size~ information~ must~ be~ supplied.\\ For~ example,~ SizeFeatures={Size={8-12},...}. } +\msg_new:nnnn {fontspec} {font-not-found} +{ + The~ font~ "#1"~ cannot~ be~ found. +} +{ + A~font~might~not~be~found~for~many~reasons.\\ + Check~the~spelling,~where~the~font~is~installed~etc.~etc.\\\\ + When~in~doubt,~ask~someone~for~help! +} \msg_new:nnnn {fontspec} {rename-feature-not-exist} { The~ feature~ #1~ doesn't~ appear~ to~ be~ defined. @@ -3235,7 +3261,7 @@ This work consists of this file fontspec.dtx % \begin{macrocode} \prg_new_conditional:Nnn \fontspec_if_aat_feature:nn {TF,T,F} { \fontspec_if_fontspec_font:TF { - \font_set:Nnn \zf@basefont {\use:c{zf@family@fontdef\f@family}} {\f@size pt} + \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: @@ -3256,7 +3282,7 @@ This work consists of this file fontspec.dtx % \begin{macrocode} \prg_new_conditional:Nnn \fontspec_if_opentype: {TF,T,F} { \fontspec_if_fontspec_font:TF { - \font_set:Nnn \zf@basefont {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt} + \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: }{ @@ -3274,7 +3300,7 @@ This work consists of this file fontspec.dtx % \begin{macrocode} \prg_new_conditional:Nnn \fontspec_if_feature:n {TF,T,F} { \fontspec_if_fontspec_font:TF { - \font_set:Nnn \zf@basefont {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt} + \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} @@ -3299,7 +3325,7 @@ This work consists of this file fontspec.dtx % \begin{macrocode} \prg_new_conditional:Nnn \fontspec_if_feature:nnn {TF,T,F} { \fontspec_if_fontspec_font:TF { - \font_set:Nnn \zf@basefont {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt} + \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} @@ -3323,7 +3349,7 @@ This work consists of this file fontspec.dtx % \begin{macrocode} \prg_new_conditional:Nnn \fontspec_if_script:n {TF,T,F} { \fontspec_if_fontspec_font:TF { - \font_set:Nnn \zf@basefont {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt} + \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: @@ -3345,7 +3371,7 @@ This work consists of this file fontspec.dtx % \begin{macrocode} \prg_new_conditional:Nnn \fontspec_if_language:n {TF,T,F} { \fontspec_if_fontspec_font:TF { - \font_set:Nnn \zf@basefont {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt} + \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} @@ -3369,7 +3395,7 @@ This work consists of this file fontspec.dtx % \begin{macrocode} \prg_new_conditional:Nnn \fontspec_if_language:nn {TF,T,F} { \fontspec_if_fontspec_font:TF { - \font_set:Nnn \zf@basefont {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt} + \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} @@ -3392,7 +3418,7 @@ This work consists of this file fontspec.dtx % \begin{macrocode} \prg_new_conditional:Nnn \fontspec_if_current_script:n {TF,T,F} { \fontspec_if_fontspec_font:TF { - \font_set:Nnn \zf@basefont {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt} + \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} @@ -3413,7 +3439,7 @@ This work consists of this file fontspec.dtx % \begin{macrocode} \prg_new_conditional:Nnn \fontspec_if_current_language:n {TF,T,F} { \fontspec_if_fontspec_font:TF { - \font_set:Nnn \zf@basefont {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt} + \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} @@ -3455,9 +3481,6 @@ This work consists of this file fontspec.dtx % % \subsection{expl3 interface for font loading} % -% Using |\font\1={xyz}| notation doesn't work at present with LuaLaTeX, -% although it should be the correct way to do things. Continue to use -% |\font\1="xyz"| for now for both engines. % \begin{macrocode} \xetex_or_luatex:nnn { \cs_set:Npn \fontspec_fontwrap:n #1 } { "#1" } { {#1} } \cs_set:Npn \fontspec_fontwrap:n #1 { "#1" } @@ -3465,14 +3488,40 @@ This work consists of this file fontspec.dtx % % Beginnings of an `l3font', I guess: % \begin{macrocode} -\cs_set_eq:NN \font_set_eq:NN \tex_let:D -\cs_new:Npn \font_set:Nnn #1#2#3 { - \font #1 = \fontspec_fontwrap:n {#2} ~at~#3\scan_stop: +\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 + } +} +% \end{macrocode} +% +% +% \begin{macro}{\fontspec_set:Nnn,\fontspec_gset:Nnn} +% Wrapper around \cs{font_set:Nnn} and \cs{font_gset:Nnn}. +% \begin{macrocode} +\cs_new:Nn \fontspec_font_set:Nnn { + \font_set:Nnn #1 {\fontspec_fontwrap:n {#2}} {#3} } -\cs_new:Npn \font_gset:Nnn #1#2#3 { - \global \font #1 = \fontspec_fontwrap:n {#2} ~at~#3\scan_stop: +\cs_new:Nn \fontspec_font_gset:Nnn { + \font_gset:Nnn #1 {\fontspec_fontwrap:n {#2}} {#3} } % \end{macrocode} +% \end{macro} +% % % \begin{macro}{\font_glyph_if_exist:NnTF} % \begin{macrocode} @@ -3508,6 +3557,7 @@ This work consists of this file fontspec.dtx % \begin{macrocode} \cs_set:Npn \fontspec_select:nn #1#2 { \group_begin: + \font_suppress_not_found_error: \fontspec_init: % \end{macrocode} % \cmd{\l_fontspec_fontname_tl} is used as the generic name of the font being defined. @@ -3537,6 +3587,17 @@ This work consists of this file fontspec.dtx % conditional. % \begin{macrocode} \fontspec_preparse_features:nn {#1}{#2} +% \end{macrocode} +% Finally save the `confirmed' font definition. +% \begin{macrocode} + \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 +% \end{macrocode} +% Continue: +% \begin{macrocode} \fontspec_set_scriptlang: \fontspec_get_features:n {} \bool_set_false:N \l_fontspec_firsttime_bool @@ -3593,13 +3654,6 @@ This work consists of this file fontspec.dtx \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 -% \end{macrocode} -% Finally save the `confirmed' font definition. -% \begin{macrocode} - \font_set:Nnn \zf@basefont {\fontspec_fullname:n {\l_fontspec_fontname_up_tl}} {\f@size pt} - \fontspec_set_font_type: - \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 } % \end{macrocode} % \end{macro} @@ -3756,7 +3810,7 @@ This work consists of this file fontspec.dtx \cs_new:Npn \fontspec_set_bold: { \bool_if:NF \l_fontspec_nobf_bool { \tl_if_empty:NTF \l_fontspec_fontname_bf_tl { - \fontspec_make_font_shapes:nnnnn \l_fontspec_fontname_tl {/B} + \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 @@ -3773,7 +3827,7 @@ This work consists of this file fontspec.dtx \cs_new:Npn \fontspec_set_italic: { \bool_if:NF \l_fontspec_noit_bool { \tl_if_empty:NTF \l_fontspec_fontname_it_tl - { \fontspec_make_font_shapes:nnnnn \l_fontspec_fontname_tl {/I} } + { \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 } @@ -3808,14 +3862,14 @@ This work consists of this file fontspec.dtx { \tl_if_empty:NTF \l_fontspec_fontname_it_tl { - \fontspec_make_font_shapes:nnnnn \l_fontspec_fontname_tl {/BI} + \fontspec_make_auto_font_shapes:nnnnn \l_fontspec_fontname_tl {/BI} } { - \fontspec_make_font_shapes:nnnnn \l_fontspec_fontname_it_tl {/B} + \fontspec_make_auto_font_shapes:nnnnn \l_fontspec_fontname_it_tl {/B} } } { - \fontspec_make_font_shapes:nnnnn \l_fontspec_fontname_bf_tl {/I} + \fontspec_make_auto_font_shapes:nnnnn \l_fontspec_fontname_bf_tl {/I} } } { @@ -3833,7 +3887,7 @@ This work consists of this file fontspec.dtx \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_font_shapes:nnnnn \l_fontspec_fontname_sl_tl {/B} + \fontspec_make_auto_font_shapes:nnnnn \l_fontspec_fontname_sl_tl {/B} \bfdefault \sldefault \l_fontspec_fontfeat_bfsl_clist } }{ @@ -3900,7 +3954,7 @@ This work consists of this file fontspec.dtx % % % -% \begin{macro}{\fontspec_make_font_shapes:nnnn,\fontspec_make_font_shapes:nnnnn} +% \begin{macro}{\fontspec_make_font_shapes:nnnn,\fontspec_make_auto_font_shapes:nnnnn} % \darg{Font name prefix (in the 5-arg case)} % \darg{Font name} % \darg{Font series} @@ -3924,9 +3978,9 @@ This work consists of this file fontspec.dtx % italic small caps by their own identifier. See \vref{sec:sishape} % for the code that enables this usage. % \begin{macrocode} -\cs_new:Nn \fontspec_make_font_shapes:nnnnn { - \font_set:Nnn \l_tmpa_font {\fontspec_fullname:n {#1}} {\f@size pt} - \font_set:Nnn \l_tmpb_font {\fontspec_fullname:n {#1#2}} {\f@size pt} +\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} } { @@ -3936,7 +3990,8 @@ This work consists of this file fontspec.dtx \cs_new:Nn \fontspec_make_font_shapes:nnnn { \group_begin: \tl_set:Nx \l_fontspec_fontname_tl {#1} - \font_set:Nnn \zf@basefont {\fontspec_fullname:n {#1}} {\f@size pt} + \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 { @@ -4201,9 +4256,10 @@ This work consists of this file fontspec.dtx % % \begin{macro}{\sclist_put_right:Nn} % I'm hardly going to write an `sclist' module but a couple of functions are -% useful. +% useful. Here, items in semi-colon lists are always followed by a semi-colon +% (as opposed to the s.-c's being placed between elements) so we can append +% sclists without worrying about it. % \begin{macrocode} -\cs_set_eq:NN \sclist_new:N \tl_new:N \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;} @@ -4222,7 +4278,7 @@ This work consists of this file fontspec.dtx % \begin{macrocode} \cs_new:Nn \fontspec_update_featstr:n { \bool_if:NF \l_fontspec_firsttime_bool { - \sclist_gput_right:Nx \l_fontspec_rawfeatures_sclist {#1;} + \sclist_gput_right:Nx \l_fontspec_rawfeatures_sclist {#1} } } % \end{macrocode} @@ -5151,6 +5207,7 @@ This work consists of this file fontspec.dtx \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} % \end{macrocode} % % \subsubsection{Numbers} diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec-patches.sty b/Master/texmf-dist/tex/latex/fontspec/fontspec-patches.sty index 6f92f41bdb0..4d0c28169ff 100644 --- a/Master/texmf-dist/tex/latex/fontspec/fontspec-patches.sty +++ b/Master/texmf-dist/tex/latex/fontspec/fontspec-patches.sty @@ -8,13 +8,13 @@ %% %% _________________________________________ %% The fontspec package for XeLaTeX/LuaLaTeX -%% (C) 2004--2010 Will Robertson and Khaled Hosny +%% (C) 2004--2011 Will Robertson and Khaled Hosny %% %% License information appended. %% %% \ProvidesPackage{fontspec-patches} - [2010/11/17 v2.1e Advanced font selection for XeLaTeX/LuaLaTeX] + [2011/02/26 v2.1f Advanced font selection for XeLaTeX/LuaLaTeX] \ExplSyntaxOn @@ -102,7 +102,7 @@ }{} } %% -%% Copyright 2004--2010 Will Robertson <wspr81@gmail.com> +%% Copyright 2004--2011 Will Robertson <wspr81@gmail.com> %% Copyright 2009--2010 Khaled Hosny <khaledhosny@eglug.org> %% %% Distributable under the LaTeX Project Public License, diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec.lua b/Master/texmf-dist/tex/latex/fontspec/fontspec.lua index 801f9e4de2d..a6b5528391a 100644 --- a/Master/texmf-dist/tex/latex/fontspec/fontspec.lua +++ b/Master/texmf-dist/tex/latex/fontspec/fontspec.lua @@ -8,7 +8,7 @@ -- -- _________________________________________ -- The fontspec package for XeLaTeX/LuaLaTeX --- (C) 2004--2010 Will Robertson and Khaled Hosny +-- (C) 2004--2011 Will Robertson and Khaled Hosny -- -- License information appended. -- @@ -134,7 +134,7 @@ function fontspec.mathfontdimen(fnt, str) end end -- --- Copyright 2004--2010 Will Robertson <wspr81@gmail.com> +-- Copyright 2004--2011 Will Robertson <wspr81@gmail.com> -- Copyright 2009--2010 Khaled Hosny <khaledhosny@eglug.org> -- -- Distributable under the LaTeX Project Public License, diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec.sty b/Master/texmf-dist/tex/latex/fontspec/fontspec.sty index ebac6a7c599..9586ccfcf51 100644 --- a/Master/texmf-dist/tex/latex/fontspec/fontspec.sty +++ b/Master/texmf-dist/tex/latex/fontspec/fontspec.sty @@ -8,28 +8,32 @@ %% %% _________________________________________ %% The fontspec package for XeLaTeX/LuaLaTeX -%% (C) 2004--2010 Will Robertson and Khaled Hosny +%% (C) 2004--2011 Will Robertson and Khaled Hosny %% %% License information appended. %% %% \ProvidesPackage{fontspec} - [2010/11/17 v2.1e Advanced font selection for XeLaTeX/LuaLaTeX] + [2011/02/26 v2.1f Advanced font selection for XeLaTeX/LuaLaTeX] \RequirePackage{expl3,xparse} \input binhex.tex % before expl syntax! \ExplSyntaxOn -\msg_new:nnn {fontspec} {not-pdftex} +\msg_new:nnn {fontspec} {cannot-use-pdftex} { - Requires~ XeTeX~ or~ LuaTeX~ to~ function! + The~ fontspec~ package~ requires~ either~ XeTeX~ or~ LuaTeX~ to~ function. + \\\\ + You~ must~ change~ your~ typesetting~ engine~ to,~ + e.g.,~ "xelatex"~ or~ "lualatex"\\ + instead~ of~ plain~ "latex"~ or~ "pdflatex". } \xetex_if_engine:F { \luatex_if_engine:TF { \RequirePackage{luaotfload} \RequireLuaModule{fontspec} }{ - \msg_fatal:nn {fontspec} {not-pdftex} + \msg_fatal:nn {fontspec} {cannot-use-pdftex} } } \xetex_if_engine:TF @@ -99,6 +103,15 @@ Size~ information~ must~ be~ supplied.\\ For~ example,~ SizeFeatures={Size={8-12},...}. } +\msg_new:nnnn {fontspec} {font-not-found} +{ + The~ font~ "#1"~ cannot~ be~ found. +} +{ + A~font~might~not~be~found~for~many~reasons.\\ + Check~the~spelling,~where~the~font~is~installed~etc.~etc.\\\\ + When~in~doubt,~ask~someone~for~help! +} \msg_new:nnnn {fontspec} {rename-feature-not-exist} { The~ feature~ #1~ doesn't~ appear~ to~ be~ defined. @@ -469,7 +482,7 @@ } \prg_new_conditional:Nnn \fontspec_if_aat_feature:nn {TF,T,F} { \fontspec_if_fontspec_font:TF { - \font_set:Nnn \zf@basefont {\use:c{zf@family@fontdef\f@family}} {\f@size pt} + \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: @@ -482,7 +495,7 @@ } \prg_new_conditional:Nnn \fontspec_if_opentype: {TF,T,F} { \fontspec_if_fontspec_font:TF { - \font_set:Nnn \zf@basefont {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt} + \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: }{ @@ -491,7 +504,7 @@ } \prg_new_conditional:Nnn \fontspec_if_feature:n {TF,T,F} { \fontspec_if_fontspec_font:TF { - \font_set:Nnn \zf@basefont {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt} + \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} @@ -508,7 +521,7 @@ } \prg_new_conditional:Nnn \fontspec_if_feature:nnn {TF,T,F} { \fontspec_if_fontspec_font:TF { - \font_set:Nnn \zf@basefont {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt} + \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} @@ -523,7 +536,7 @@ } \prg_new_conditional:Nnn \fontspec_if_script:n {TF,T,F} { \fontspec_if_fontspec_font:TF { - \font_set:Nnn \zf@basefont {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt} + \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: @@ -536,7 +549,7 @@ } \prg_new_conditional:Nnn \fontspec_if_language:n {TF,T,F} { \fontspec_if_fontspec_font:TF { - \font_set:Nnn \zf@basefont {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt} + \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} @@ -551,7 +564,7 @@ } \prg_new_conditional:Nnn \fontspec_if_language:nn {TF,T,F} { \fontspec_if_fontspec_font:TF { - \font_set:Nnn \zf@basefont {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt} + \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} @@ -566,7 +579,7 @@ } \prg_new_conditional:Nnn \fontspec_if_current_script:n {TF,T,F} { \fontspec_if_fontspec_font:TF { - \font_set:Nnn \zf@basefont {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt} + \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} @@ -580,7 +593,7 @@ } \prg_new_conditional:Nnn \fontspec_if_current_language:n {TF,T,F} { \fontspec_if_fontspec_font:TF { - \font_set:Nnn \zf@basefont {\csname zf@family@fontdef\f@family\endcsname} {\f@size pt} + \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} @@ -598,12 +611,30 @@ } \xetex_or_luatex:nnn { \cs_set:Npn \fontspec_fontwrap:n #1 } { "#1" } { {#1} } \cs_set:Npn \fontspec_fontwrap:n #1 { "#1" } -\cs_set_eq:NN \font_set_eq:NN \tex_let:D -\cs_new:Npn \font_set:Nnn #1#2#3 { - \font #1 = \fontspec_fontwrap:n {#2} ~at~#3\scan_stop: +\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:Npn \font_gset:Nnn #1#2#3 { - \global \font #1 = \fontspec_fontwrap:n {#2} ~at~#3\scan_stop: +\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: @@ -614,6 +645,7 @@ } \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 { @@ -622,6 +654,11 @@ \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 @@ -646,10 +683,6 @@ \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 - \font_set:Nnn \zf@basefont {\fontspec_fullname:n {\l_fontspec_fontname_up_tl}} {\f@size pt} - \fontspec_set_font_type: - \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 } \prg_new_conditional:Nnn \fontspec_if_detect_external:n {T} { @@ -744,7 +777,7 @@ \cs_new:Npn \fontspec_set_bold: { \bool_if:NF \l_fontspec_nobf_bool { \tl_if_empty:NTF \l_fontspec_fontname_bf_tl { - \fontspec_make_font_shapes:nnnnn \l_fontspec_fontname_tl {/B} + \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 @@ -755,7 +788,7 @@ \cs_new:Npn \fontspec_set_italic: { \bool_if:NF \l_fontspec_noit_bool { \tl_if_empty:NTF \l_fontspec_fontname_it_tl - { \fontspec_make_font_shapes:nnnnn \l_fontspec_fontname_tl {/I} } + { \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 } @@ -774,14 +807,14 @@ { \tl_if_empty:NTF \l_fontspec_fontname_it_tl { - \fontspec_make_font_shapes:nnnnn \l_fontspec_fontname_tl {/BI} + \fontspec_make_auto_font_shapes:nnnnn \l_fontspec_fontname_tl {/BI} } { - \fontspec_make_font_shapes:nnnnn \l_fontspec_fontname_it_tl {/B} + \fontspec_make_auto_font_shapes:nnnnn \l_fontspec_fontname_it_tl {/B} } } { - \fontspec_make_font_shapes:nnnnn \l_fontspec_fontname_bf_tl {/I} + \fontspec_make_auto_font_shapes:nnnnn \l_fontspec_fontname_bf_tl {/I} } } { @@ -793,7 +826,7 @@ \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_font_shapes:nnnnn \l_fontspec_fontname_sl_tl {/B} + \fontspec_make_auto_font_shapes:nnnnn \l_fontspec_fontname_sl_tl {/B} \bfdefault \sldefault \l_fontspec_fontfeat_bfsl_clist } }{ @@ -831,9 +864,9 @@ { \bool_set_true:N \l_fontspec_icu_bool } -\cs_new:Nn \fontspec_make_font_shapes:nnnnn { - \font_set:Nnn \l_tmpa_font {\fontspec_fullname:n {#1}} {\f@size pt} - \font_set:Nnn \l_tmpb_font {\fontspec_fullname:n {#1#2}} {\f@size pt} +\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} } { @@ -843,7 +876,8 @@ \cs_new:Nn \fontspec_make_font_shapes:nnnn { \group_begin: \tl_set:Nx \l_fontspec_fontname_tl {#1} - \font_set:Nnn \zf@basefont {\fontspec_fullname:n {#1}} {\f@size pt} + \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 { @@ -1016,7 +1050,6 @@ { \cs_set_eq:NN \fontspec_make_smallcaps:T \fontspec_make_ot_smallcaps:T } -\cs_set_eq:NN \sclist_new:N \tl_new:N \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;} @@ -1024,7 +1057,7 @@ \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;} + \sclist_gput_right:Nx \l_fontspec_rawfeatures_sclist {#1} } } \cs_new:Npn \fontspec_make_feature:nnn #1#2#3 { @@ -1626,6 +1659,7 @@ \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} @@ -2210,7 +2244,7 @@ {\typeout{No~ fontspec.cfg~ file~ found;~ no~ configuration~ loaded.}} } %% -%% Copyright 2004--2010 Will Robertson <wspr81@gmail.com> +%% Copyright 2004--2011 Will Robertson <wspr81@gmail.com> %% Copyright 2009--2010 Khaled Hosny <khaledhosny@eglug.org> %% %% Distributable under the LaTeX Project Public License, |