diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/projlib/projlib-font.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/projlib/projlib-font.sty | 105 |
1 files changed, 92 insertions, 13 deletions
diff --git a/Master/texmf-dist/tex/latex/projlib/projlib-font.sty b/Master/texmf-dist/tex/latex/projlib/projlib-font.sty index c308c1c66d7..50ffb4258c2 100644 --- a/Master/texmf-dist/tex/latex/projlib/projlib-font.sty +++ b/Master/texmf-dist/tex/latex/projlib/projlib-font.sty @@ -1,8 +1,25 @@ +%% +%% This is file `projlib-font.sty', +%% generated with the docstrip utility. + +%% Copyright (C) 2021-2022 by Jinwen XU +%% +%% This is part of the ProjLib Toolkit. +%% +%% This work may be distributed and/or modified under the conditions of the +%% LaTeX Project Public License, either version 1.3c of this license or (at +%% your option) any later version. The latest version of this license is in +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3c or later is part of all distributions of LaTeX version +%% 2005/12/01 or later. +%% \NeedsTeXFormat{LaTeX2e}[2020-10-01] \RequirePackage{l3keys2e} \ProvidesExplPackage {projlib-font} - {2022/03/01} {} + {2022/03/11} {} {Font selection and configuration} \keys_define:nn { projlib-font } @@ -31,6 +48,9 @@ } \ProcessKeysOptions { projlib-font } +\bool_new:N \g_projlib_font_already_set_bool +\bool_gset_false:N \g_projlib_font_already_set_bool + \RequirePackage { setspace } \cs_new:Nn \projlib_font_set_linespacing_latin:n @@ -55,26 +75,81 @@ \RequirePackage { lmodern } } \projlib_font_set_linespacing_latin:n { \setstretch { 1.00 } } + \bool_gset_true:N \g_projlib_font_already_set_bool } \bool_if:NT \l__projlib_font_palatino_bool { - \RequirePackage { mathpazo } - \PassOptionsToPackage { defaultsups } { newpxtext } - \RequirePackage { newpxtext } - \cs_undefine:c { openbox } + \sys_if_engine_pdftex:TF + { + \RequirePackage { mathpazo } + \PassOptionsToPackage { defaultsups } { newpxtext } + \RequirePackage { newpxtext } + \cs_undefine:c { openbox } + \bool_if:NT \l__projlib_font_useosf_bool { \useosf } + } + { + \PassOptionsToPackage { warnings-off = { mathtools-colon, mathtools-overbracket } } { unicode-math } + \RequirePackage { unicode-math } + \defaultfontfeatures{ Scale=MatchLowercase, Ligatures=TeX } + \bool_if:NTF \l__projlib_font_useosf_bool + { + \setmainfont { TeXGyrePagellaX-Regular.otf } + [ + BoldFont = TeXGyrePagellaX-Bold.otf , + ItalicFont = TeXGyrePagellaX-Italic.otf , + BoldItalicFont = TeXGyrePagellaX-BoldItalic.otf, + Numbers = OldStyle ] + } + { + \setmainfont { TeXGyrePagellaX-Regular.otf } + [ + BoldFont = TeXGyrePagellaX-Bold.otf , + ItalicFont = TeXGyrePagellaX-Italic.otf , + BoldItalicFont = TeXGyrePagellaX-BoldItalic.otf, + ] + } + \setmathfont { texgyrepagella-math.otf } + } \projlib_font_set_linespacing_latin:n { \setstretch { 1.07 } } - \bool_if:NT \l__projlib_font_useosf_bool { \useosf } + \bool_gset_true:N \g_projlib_font_already_set_bool } \bool_if:NT \l__projlib_font_times_bool { - \PassOptionsToPackage { defaultsups } { newtxtext } - \RequirePackage { newtxtext } - \RequirePackage { newtxmath } - \cs_undefine:c { openbox } + \sys_if_engine_pdftex:TF + { + \PassOptionsToPackage { defaultsups } { newtxtext } + \RequirePackage { newtxtext } + \RequirePackage { newtxmath } + \cs_undefine:c { openbox } + \bool_if:NT \l__projlib_font_useosf_bool { \useosf } + } + { + \PassOptionsToPackage { warnings-off = { mathtools-colon, mathtools-overbracket } } { unicode-math } + \RequirePackage { unicode-math } + \defaultfontfeatures{ Scale=MatchLowercase, Ligatures=TeX } + \bool_if:NTF \l__projlib_font_useosf_bool + { + \setmainfont { TeXGyreTermesX-Regular.otf } + [ + BoldFont = TeXGyreTermesX-Bold.otf , + ItalicFont = TeXGyreTermesX-Italic.otf , + BoldItalicFont = TeXGyreTermesX-BoldItalic.otf, + Numbers = OldStyle ] + } + { + \setmainfont { TeXGyreTermesX-Regular.otf } + [ + BoldFont = TeXGyreTermesX-Bold.otf , + ItalicFont = TeXGyreTermesX-Italic.otf , + BoldItalicFont = TeXGyreTermesX-BoldItalic.otf, + ] + } + \setmathfont { texgyretermes-math.otf } + } \projlib_font_set_linespacing_latin:n { \setstretch { 1.00 } } - \bool_if:NT \l__projlib_font_useosf_bool { \useosf } + \bool_gset_true:N \g_projlib_font_already_set_bool } \bool_if:NT \l__projlib_font_garamond_bool @@ -87,7 +162,9 @@ \cs_undefine:c { openbox } \RequirePackage { ebgaramond-maths } \RequirePackage { ebgaramond } + \cs_undefine:c { Bbbk } \projlib_font_set_linespacing_latin:n { \setstretch { 1.00 } } + \bool_gset_true:N \g_projlib_font_already_set_bool } \bool_if:NT \l__projlib_font_noto_bool @@ -98,7 +175,9 @@ } \RequirePackage { anyfontsize } \RequirePackage { notomath } + \cs_undefine:c { Bbbk } \projlib_font_set_linespacing_latin:n { \setstretch { 1.00 } } + \bool_gset_true:N \g_projlib_font_already_set_bool } \bool_if:NT \l__projlib_font_biolinum_bool @@ -133,10 +212,10 @@ } \projlib_font_set_linespacing_latin:n { \setstretch { 1.05 } } \RequirePackage [ italic, defaultmathsizes ] { mathastext } + \bool_gset_true:N \g_projlib_font_already_set_bool } -\RequirePackage { silence } -\WarningFilter { microtype } { Unable } +\PassOptionsToPackage { verbose = silent } { microtype } \RequirePackage { microtype } \endinput |