diff options
author | Karl Berry <karl@freefriends.org> | 2007-07-16 17:14:02 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2007-07-16 17:14:02 +0000 |
commit | f098a3f19cc6d5414b65f0c3b0777f034741ba88 (patch) | |
tree | 83d8b1af5d4ee33176a09f3229dce40dbc2a1b58 /Master/texmf-dist/tex/xelatex/fontspec/fontspec.sty | |
parent | cdc057d0c6bc289fb757b60024ada53615e5ff4e (diff) |
fontspec update (20jun07)
git-svn-id: svn://tug.org/texlive/trunk@4633 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/fontspec/fontspec.sty')
-rw-r--r-- | Master/texmf-dist/tex/xelatex/fontspec/fontspec.sty | 125 |
1 files changed, 83 insertions, 42 deletions
diff --git a/Master/texmf-dist/tex/xelatex/fontspec/fontspec.sty b/Master/texmf-dist/tex/xelatex/fontspec/fontspec.sty index 824c0ff3da0..312a873355a 100644 --- a/Master/texmf-dist/tex/xelatex/fontspec/fontspec.sty +++ b/Master/texmf-dist/tex/xelatex/fontspec/fontspec.sty @@ -13,7 +13,7 @@ %% License information appended. %% \ProvidesPackage{fontspec} - [2006/12/24 v1.13 Advanced font selection for XeLaTeX] + [2007/06/20 v1.14 Advanced font selection for XeLaTeX] \RequirePackage{ifxetex} \RequireXeTeX \newif\ifzf@firsttime @@ -30,12 +30,15 @@ \newif\ifzf@package@babel@loaded \newif\if@zf@configfile \newif\if@zf@euenc +\newif\if@zf@math \newcount\c@zf@newff \newcount\c@zf@index \newcount\c@zf@script \newcount\c@zf@language -\newcommand\zf@PackageError[2]{\PackageError{fontspec}{#1}{#2}} -\newcommand\zf@PackageWarning[1]{\PackageWarning{fontspec}{#1}} +\def\zf@nl{^^J\space\space\space\space} +\newcommand\zf@PackageError[2]{\PackageError{fontspec}{{\zf@nl #1}^^J}{#2}} +\newcommand\zf@PackageWarning[1]{% + \PackageWarning{fontspec}{\zf@nl #1^^JThis warning occured}} \newcommand\zf@PackageInfo[1]{\PackageInfo{fontspec}{#1}} \providecommand\def@cx[2]{\expandafter\edef\csname#1\endcsname{#2}} \providecommand\gdef@cx[2]{\expandafter\xdef\csname#1\endcsname{#2}} @@ -43,10 +46,13 @@ \expandafter\let\csname#1\expandafter\endcsname\csname#2\endcsname} \DeclareOption{cm-default}{\@zf@euencfalse} \DeclareOption{lm-default}{\@zf@euenctrue} +\DeclareOption{math}{\@zf@mathtrue} +\DeclareOption{no-math}{\@zf@mathfalse} \DeclareOption{config}{\@zf@configfiletrue} +\DeclareOption{no-config}{\@zf@configfilefalse} \DeclareOption{noconfig}{\@zf@configfilefalse} \DeclareOption{quiet}{\let\zf@PackageWarning\zf@PackageInfo} -\ExecuteOptions{config,lm-default} +\ExecuteOptions{config,lm-default,math} \ProcessOptions* \RequirePackage{ifxetex} \RequireXeTeX @@ -54,7 +60,9 @@ \RequirePackage{xkeyval}[2005/05/07] \if@zf@euenc \def\zf@enc{EU1} - \RequirePackage{lmodern} + \renewcommand{\rmdefault}{lmr} + \renewcommand{\sfdefault}{lmss} + \renewcommand{\ttdefault}{lmtt} \RequirePackage[\zf@enc]{fontenc} \else \def\zf@enc{U} @@ -121,16 +129,22 @@ \newcommand*\defaultfontfeatures[1]{\def\zf@default@options{#1,}} \let\zf@default@options\@empty \newcommand*\addfontfeatures[1]{% - \begingroup - \let\zf@default@options\@empty - \edef\@tempa{% - \noexpand\zf@fontspec - {\csname zf@family@options\f@family\endcsname,#1}% - {\csname zf@family@fontname\f@family\endcsname}}% - \@tempa - \endgroup - \fontfamily\zf@family\selectfont - \ignorespaces} + \ifcsname zf@family@fontdef\f@family\endcsname + \begingroup + \let\zf@default@options\@empty + \edef\@tempa{% + \noexpand\zf@fontspec + {\csname zf@family@options\f@family\endcsname,#1}% + {\csname zf@family@fontname\f@family\endcsname}}% + \@tempa + \endgroup + \fontfamily\zf@family\selectfont + \expandafter\ignorespaces + \else + \zf@PackageWarning{% + \protect\addfontfeature (s) ignored;\zf@nl + it cannot be used with a font that wasn't selected by fontspec.}% + \fi} \let\addfontfeature\addfontfeatures \newcommand*\newfontfeature[2]{% \stepcounter{zf@newff}% @@ -174,8 +188,9 @@ \xdef\zf@family@long{\zf@family@long+lang=#1}% \xdef\zf@pre@ff{\zf@pre@ff language=#2,}% \else - \zf@PackageWarning{Font \fontname\zf@basefont does not contain - language '#1' for script '\zf@script@name'}% + \zf@PackageWarning{% + Font \fontname\zf@basefont does not contain + language '#1' for script '\zf@script@name'}% \fi}} \newcommand*\zf@fontspec[2]{% \begingroup @@ -213,7 +228,7 @@ \fi \xdef\zf@family{\@nameuse{zf@UID@\zf@family@long}}% \unless\ifcsname zf@family@fontname\zf@family\endcsname - \zf@PackageInfo{Defining font family for "#2" + \zf@PackageInfo{Defining font family for '#2' with options [\zf@default@options #1]}% \gdef@cx{zf@family@fontname\zf@family}{\zf@fontname}% \gdef@cx{zf@family@options\zf@family}{\zf@default@options #1}% @@ -327,7 +342,7 @@ \zf@scale"\zf@size@fnt\zf@suffix:\zf@pre@ff\zf@ff#1"}}% \fi \edef\@tempa{\noexpand - \DeclareFontShape{\zf@enc}{\zf@family}{#2}{#3}% + \DeclareFontShape{\zf@enc}{\zf@family}{#2}{#3} {\zf@font@str}{\zf@adjust}}% \@tempa \edef\@tempa{#3}% @@ -364,9 +379,9 @@ \let\zf@it@feat \@empty \let\zf@bfit@feat \@empty \let\zf@sc@feat \@empty - \let\zf@size\@empty - \let\zf@size@feat\@empty - \let\zf@size@fnt\@empty + \let\zf@size \@empty + \let\zf@size@feat \@empty + \let\zf@size@fnt \@empty \c@zf@script 1818326126\relax \def\zf@script@name{Latin}% \c@zf@language 0\relax @@ -396,13 +411,13 @@ \ifx\@tempa\@empty \zf@PackageWarning{% '\XKV@tfam=\XKV@tkey' feature not supported - for AAT font '\fontname\zf@basefont'}% + for AAT font \fontname\zf@basefont}% \else \zf@make@aat@feature@string{#1}{#2}% \ifx\@tempa\@empty \zf@PackageWarning{% - AAT feature '\XKV@tfam=\XKV@tkey' - (#1,#2) not available in font '\fontname\zf@basefont'}% + AAT feature '\XKV@tfam=\XKV@tkey' (#1,#2) not available\zf@nl + in font \fontname\zf@basefont}% \else \zf@update@family{+#1,#2}% \zf@update@ff\@tempa @@ -414,7 +429,7 @@ \ifx\@tempa\@empty \zf@PackageWarning{% '\XKV@tfam=\XKV@tkey' feature not supported - for ICU font '\fontname\zf@basefont'}% + for ICU font \fontname\zf@basefont}% \else \expandafter\zf@check@ot@feat\expandafter{\@tempa}% \if@tempswa @@ -423,8 +438,10 @@ \else \zf@PackageWarning{% OpenType feature '\XKV@tfam=\XKV@tkey' (#3) - not available in font \fontname\zf@basefont, script - '\zf@script@name', language '\zf@language@name'}% + not available\zf@nl + for font \fontname\zf@basefont, \zf@nl + with script '\zf@script@name',\zf@nl + and language '\zf@language@name'.}% \fi \fi \fi} @@ -435,7 +452,7 @@ \newcommand*\keyval@alias@key[4][KV]{% \let@cc{#1@#2@#4}{#1@#2@#3}% \let@cc{#1@#2@#4@default}{#1@#2@#3@default}} -\newcommand*\multi@alias@key[2]{ +\newcommand*\multi@alias@key[2]{% \key@ifundefined[zf]{preparse}{#1} {\key@ifundefined[zf]{options}{#1} {\zf@PackageError{The feature #1 doesn't appear to be defined} @@ -445,7 +462,7 @@ \newcommand*\zf@make@aat@feature@string[2]{% \edef\@tempa{\XeTeXfeaturename\zf@basefont #1}% \unless\ifx\@tempa\@empty - \ifnum\XeTeXisexclusivefeature\zf@basefont #1 > 0 + \ifnum\XeTeXisexclusivefeature\zf@basefont #1>0 \edef\@tempb{\XeTeXselectorname\zf@basefont #1 #2}% \else \unless\ifodd #2 @@ -590,9 +607,7 @@ \unless\ifzf@firsttime\def\zf@sc@feat{,#1}\fi \zf@update@family{scfeat:\zap@space #1 \@empty}} \define@key[zf]{preparse}{SizeFeatures}{% - \unless\ifzf@firsttime - \def\zf@size@feat{#1}% - \fi + \unless\ifzf@firsttime\def\zf@size@feat{#1}\fi \zf@update@family{sizefeat:\zap@space #1 \@empty}} \define@key[zf]{sizing}{Size}{\def\zf@size{#1}} \define@key[zf]{sizing}{Font}{\def\zf@size@fnt{#1}} @@ -664,15 +679,15 @@ \zf@PackageError {\fontname\zf@basefont\space doesn't appear to have the glyph corresponding to #1.} {You can't hyphenate with a character that's not available!} - \fi} + \fi}% \else {\zf@basefont\ifnum\XeTeXcharglyph#1 > 0 \g@addto@macro\zf@adjust{\hyphenchar\font#1\relax}% \else \zf@PackageError {\fontname\zf@basefont\space doesn't appear to have the glyph corresponding to #1.} - {You can't hyphenate with a character that's not available!} - \fi} + {You can't hyphenate with a character that's not available!}% + \fi}% \fi \fi} \def\zf@check@one@char#1#2\zf@@{\def\@tempb{#2}} @@ -1026,8 +1041,9 @@ \xdef\zf@family@long{\zf@family@long+lang=Turkish}% \xdef\zf@pre@ff{\zf@pre@ff language=TUR,}% \else - \zf@PackageWarning{Font \fontname\zf@basefont does not contain - language '#1' for script '\zf@script@name'}% + \zf@PackageWarning{Language '#1' not available\zf@nl + for font \fontname\zf@basefont\zf@nl + with script '\zf@script@name'.}% \fi \fi} \define@key[zf]{options}{RawFeature}{% @@ -1061,7 +1077,7 @@ \zf@merge@shape\updefault\sidefault\scdefault} \@ifpackageloaded{euler}{\zf@package@euler@loadedtrue} {\zf@package@euler@loadedfalse} -\AtBeginDocument{% +\def\zf@math{% \let\zf@font@warning\@font@warning \let\@font@warning\@font@info \@ifpackageloaded{euler}{% @@ -1069,9 +1085,9 @@ \zf@math@eulertrue \else \zf@PackageError{The euler package must be loaded BEFORE fontspec} - {fontspec only overwrites euler's attempt to \MessageBreak - define the maths text fonts if fontspec is \MessageBreak - loaded after euler. Type <return> to proceed\MessageBreak + {fontspec only overwrites euler's attempt to ^^J + define the maths text fonts if fontspec is ^^J + loaded after euler. Type <return> to proceed ^^J with incorrect \protect\mathit, \protect\mathbf, etc} \fi}{} \@ifpackageloaded{lucbmath}{\zf@math@lucidatrue}{} @@ -1152,6 +1168,31 @@ \SetMathAlphabet\mathsf{bold}\zf@enc\zf@sfmaths\bfdefault\updefault \SetMathAlphabet\mathtt{bold}\zf@enc\zf@ttmaths\bfdefault\updefault \let\font@warning\zf@font@warning} +\def\zf@math@maybe{% + \@ifpackageloaded{anttor}{\ifx\define@antt@mathversions a\@zf@mathfalse\fi}{} + \@ifpackageloaded{arev}{\@zf@mathfalse}{} + \@ifpackageloaded{eulervm}{\@zf@mathfalse}{} + \@ifpackageloaded{mathdesign}{\@zf@mathfalse}{} + \@ifpackageloaded{concmath}{\@zf@mathfalse}{} + \@ifpackageloaded{cmbright}{\@zf@mathfalse}{} + \@ifpackageloaded{mathesf}{\@zf@mathfalse}{} + \@ifpackageloaded{gfsartemisia}{\@zf@mathfalse}{} + \@ifpackageloaded{gfsneohellenic}{\@zf@mathfalse}{} + \@ifpackageloaded{iwona}{\ifx\define@iwona@mathversions a\@zf@mathfalse\fi}{} + \@ifpackageloaded{kpfonts}{\@zf@mathfalse}{} + \@ifpackageloaded{kmath}{\@zf@mathfalse}{} + \@ifpackageloaded{kurier}{\ifx\define@kurier@mathversions a\@zf@mathfalse\fi}{} + \@ifpackageloaded{fouriernc}{\@zf@mathfalse}{} + \@ifpackageloaded{fourier}{\@zf@mathfalse}{} + \@ifpackageloaded{mathpazo}{\@zf@mathfalse}{} + \@ifpackageloaded{mathptmx}{\@zf@mathfalse}{} + \@ifpackageloaded{MinionPro}{\@zf@mathfalse}{} + \@ifpackageloaded{unicode-math}{\@zf@mathfalse}{} + \if@zf@math + \zf@PackageWarning{Adjusting the maths setup (use [no-math] to avoid this).} + \zf@math + \fi} +\AtBeginDocument{\zf@math@maybe} \if@zf@configfile \InputIfFileExists{fontspec.cfg} {\typeout{fontspec.cfg loaded.}} |