Skip to content

Commit

Permalink
Merge branch 'develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
wspr authored Feb 13, 2024
2 parents 67f5311 + 3ddb840 commit 4e4332f
Show file tree
Hide file tree
Showing 44 changed files with 1,142 additions and 205 deletions.
24 changes: 2 additions & 22 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,28 +45,8 @@ jobs:
# Boilerplate
- name: Checkout repository
uses: actions/checkout@v3
# GitHub Actions don't regenerate the test if the key doesn't change, so
# we integrate a random UUID into the key to keep them different.
# DO NOT CHANGE THIS
- name: Generate unique ID
id: get-id
run: |
echo -n ::set-output name=id::
cat /proc/sys/kernel/random/uuid
# Actually load the cache. Since we never reuse the key, we need restore-keys
# to indicate the prefix of our caches. This loads the newest cache with this
# prefix in the key.
#
# If we want to force regeneration of the cache, increase the number after
# *both* instances of "texlive-v"
- name: Load cache
uses: actions/cache@v2
with:
path: ~/texlive
key: texlive2022-v0-${{ steps.get-id.outputs.id }}
restore-keys: texlive2022-v0-
- name: Install TeX Live
uses: zauguin/install-texlive@v1
uses: zauguin/install-texlive@v3
with:
# List the required TeX Live packages in a separate file to allow reuse in
# different workflows.
Expand All @@ -92,7 +72,7 @@ jobs:
# 2. If we succeed building documentation
- name: Archive documentation
if: ${{ matrix.artifact_name == 'Documentation' && success() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.artifact_name }}
path: "**/*.pdf"
Expand Down
14 changes: 14 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
Change history
==============

## Unreleased

* Added a `Scale=MatchAveragecase` paramater which averages `Scale=MatchLowercase` and `Scale=MatchUppercase`.
* switched options to LaTeX keyval handler
* added option verbose to undo silent/quiet
* euenc/tuenc options are obsolete
* TU is the only encoding
* Support variable fonts under LuaLaTeX.
* Skip scanning for filenames when loading fonts by name on LuaLaTeX.
* Allow restricting filename lookup to kpathsea lookups using `KpseOnly`.
* added support for named colors from l3color
* support with lualatex spotcolors and cmyk colors in the pdf.


## v2.8a (2022/01/15)

* Add `SwashFont` and `BoldSwashFont` features to support LaTeX's now-builtin `\textsw`
Expand Down
3 changes: 2 additions & 1 deletion fontspec-code-internal.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,8 @@

\str_if_eq:eeF { \l_@@_hexcol_tl \l_@@_opacity_tl }
{ \c_@@_hexcol_tl \c_@@_opacity_tl }
{ \@@_update_featstr:n { color = \l_@@_hexcol_tl\l_@@_opacity_tl } }
%<XE> { \@@_update_featstr:n { color = \l_@@_hexcol_tl\l_@@_opacity_tl } }
%<LU> { \@@_update_featstr:n { color = {\l_@@_hexcol_tl\l_@@_opacity_tl} } }
}
% \end{macrocode}
% \end{macro}
Expand Down
54 changes: 45 additions & 9 deletions fontspec-code-keyval.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -718,26 +718,61 @@
% \end{macrocode}
%
% \paragraph{Color}
% Hooks into pkg{xcolor}, which names its colours \texttt{\char`\\color@<name>}.
% Test first if the color is a named l3color, then if it is a color from
% \pkg{xcolor}, which names its colours \texttt{\char`\\color@<name>}.
% If this fails the argument is assumed to be a hex color.
%
% \begin{macrocode}
\@@_keys_define_code:nnn {fontspec} {Color}
{
\cs_if_exist:cTF { \token_to_str:N \color@ #1 }
%<*XE>
\color_if_exist:nTF {#1}
{
\convertcolorspec{named}{#1}{HTML}\l_@@_hexcol_tl
\color_export:nnN {#1} {HTML}\l_@@_hexcol_tl
}
{
\int_compare:nTF { \tl_count:n {#1} == 6 }
{ \tl_set:Nn \l_@@_hexcol_tl {#1} }
\cs_if_exist:cTF { \token_to_str:N \color@ #1 }
{
\convertcolorspec{named}{#1}{HTML}\l_@@_hexcol_tl
}
{
\int_compare:nTF { \tl_count:n {#1} == 8 }
{ \fontspec_parse_colour:viii #1 }
\int_compare:nTF { \tl_count:n {#1} == 6 }
{ \tl_set:Nn \l_@@_hexcol_tl {#1} }
{
\bool_if:NF \l_@@_firsttime_bool
{ \@@_warning:nx {bad-colour} {#1} }
\int_compare:nTF { \tl_count:n {#1} == 8 }
{ \fontspec_parse_colour:viii #1 }
{
\bool_if:NF \l_@@_firsttime_bool
{ \@@_warning:nx {bad-colour} {#1} }
}
}
}
}
%</XE>
%<*LU>
\color_if_exist:nTF {#1}
{
\tl_set:Nn \l_@@_hexcol_tl {#1}
}
{
\cs_if_exist:cTF { \token_to_str:N \color@ #1 }
{
\convertcolorspec{named}{#1}{HTML}\l_@@_hexcol_tl
}
{
\int_compare:nTF { \tl_count:n {#1} == 6 }
{ \tl_set:Nn \l_@@_hexcol_tl {#1} }
{
\int_compare:nTF { \tl_count:n {#1} == 8 }
{ \fontspec_parse_colour:viii #1 }
{
\bool_if:NF \l_@@_firsttime_bool
{ \@@_warning:nx {bad-colour} {#1} }
}
}
}
}
%</LU>
}
% \end{macrocode}
%
Expand Down Expand Up @@ -766,6 +801,7 @@
}
\tl_set:Nx \l_@@_opacity_tl
{
%<LU> ,
\int_compare:nT { \l_@@_tmp_int <= "F } {0} % zero pad
\int_to_hex:n { \l_@@_tmp_int }
}
Expand Down
4 changes: 2 additions & 2 deletions fontspec-code-load.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{
\RequirePackage{luaotfload}
\lua_now:e{require("fontspec")}
\RequirePackageWithOptions{fontspec-luatex}
\RequirePackage{fontspec-luatex}
\endinput
}
% \end{macrocode}
Expand All @@ -30,7 +30,7 @@
% \begin{macrocode}
\sys_if_engine_xetex:T
{
\RequirePackageWithOptions{fontspec-xetex}
\RequirePackage{fontspec-xetex}
\endinput
}
% \end{macrocode}
Expand Down
15 changes: 13 additions & 2 deletions fontspec-code-msg.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,21 @@
Input mapping not supported in LuaTeX.\\
Use "Ligatures=TeX" instead of "Mapping=tex-text".
}
\@@_msg_new:nn {cm-default-obsolete}
% \end{macrocode}
% message for package options must be loaded earlier
% \begin{macrocode}
%</fontspec>
%<*options>
\msg_new:nnn {fontspec} {cm-default-obsolete}
{
The~"cm-default"~package~option~is~obsolete.
}
\msg_new:nnn {fontspec} {enc-obsolete}
{
The "cm-default" package option is obsolete.
The~"#1"~package~option~is~obsolete.~TU~is~the~default~encoding.
}
%</options>
%<*fontspec>
\@@_msg_new:nn {font-index-needs-ttc}
{
The "FontIndex" feature is only supported by TTC (TrueType Collection) fonts.\\
Expand Down
97 changes: 43 additions & 54 deletions fontspec-code-opening.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -4,75 +4,74 @@
%
% \iffalse
% \begin{macrocode}
%<*fontspec>
%<*options>
% \end{macrocode}
% \fi
%
% \subsection{Package options}
%
% \begin{macrocode}
\DeclareOption{cm-default}
\DeclareKeys
{
\@@_warning:n {cm-default-obsolete}
}
cm-default .code:n = { \msg_warning:nn {fontspec} {cm-default-obsolete} }
% \end{macrocode}
%
% \begin{macrocode}
\DeclareOption {math} { \bool_gset_true:N \g_@@_math_bool }
\DeclareOption {no-math} { \bool_gset_false:N \g_@@_math_bool }
\DeclareOption {config} { \bool_gset_true:N \g_@@_cfg_bool }
\DeclareOption {no-config}{ \bool_gset_false:N \g_@@_cfg_bool }
\DeclareOption {euenc} { \bool_gset_true:N \g_@@_euenc_bool }
\DeclareOption {tuenc} { \bool_gset_false:N \g_@@_euenc_bool }
,math .bool_gset:N = \g_@@_math_bool
,math .usage:n = preamble
,no-math .bool_gset_inverse:N = \g_@@_math_bool
,no-math .usage:n = preamble
,config .bool_gset:N = \g_@@_cfg_bool
,config .usage:n = load
,no-config .bool_gset_inverse:N = \g_@@_cfg_bool
,no-config .usage:n = load
,euenc .code:n = { \msg_warning:nnn {fontspec} {enc-obsolete}{euenc} }
,tuenc .code:n = { \msg_warning:nnn {fontspec} {enc-obsolete}{tuenc} }
% \end{macrocode}
%
% \begin{macrocode}
\DeclareOption {quiet}
{
\msg_redirect_module:nnn { fontspec } { warning } { info }
\msg_redirect_module:nnn { fontspec } { info } { none }
}
\DeclareOption{silent}
{
\msg_redirect_module:nnn { fontspec } { warning } { none }
\msg_redirect_module:nnn { fontspec } { info } { none }
}
,quiet .code:n =
{
\msg_redirect_module:nnn { fontspec } { warning } { info }
\msg_redirect_module:nnn { fontspec } { info } { none }
}
,silent .code:n =
{
\msg_redirect_module:nnn { fontspec } { warning } { none }
\msg_redirect_module:nnn { fontspec } { info } { none }
}
,verbose .code:n =
{
\msg_redirect_module:nnn { fontspec } { warning } { warning }
\msg_redirect_module:nnn { fontspec } { info } { info }
}
}
% \end{macrocode}
%
% \begin{macrocode}
\ExecuteOptions{config,math,tuenc}
\ProcessOptions*
\SetKeys{config,math}
\ProcessKeyOptions
% \end{macrocode}
%
%
% \iffalse
% \begin{macrocode}
%</options>
%<*fontspec>
% \end{macrocode}
% \fi
%
%
% \subsection{Encodings}
%
% Soon to be the default, with a just-in-case check:
% Now the default, with a just-in-case check:
% \begin{macrocode}
\bool_if:NF \g_@@_euenc_bool
{
\file_if_exist:nTF {tuenc.def}
{
\cs_if_exist:cF {T@TU}
{
\@@_warning:n {tu-clash}
\DeclareFontEncoding{TU}{}{}
\DeclareFontSubstitution{TU}{lmr}{m}{n}
}
}
{
\@@_warning:n {tu-missing}
\bool_gset_true:N \g_@@_euenc_bool
}
}
\bool_if:NTF \g_@@_euenc_bool
\cs_if_exist:cF {T@TU}
{
%<XE> \tl_gset:Nn \g_fontspec_encoding_tl {EU1}
%<LU> \tl_gset:Nn \g_fontspec_encoding_tl {EU2}
\@@_warning:n {tu-clash}
\DeclareFontEncoding{TU}{}{}
\DeclareFontSubstitution{TU}{lmr}{m}{n}
}
{ \tl_gset:Nn \g_fontspec_encoding_tl { TU } }
\tl_gset:Nn \g_fontspec_encoding_tl { TU }
% \end{macrocode}
%
% \begin{macrocode}
Expand Down Expand Up @@ -100,16 +99,6 @@
% Something to do with \cmd\select@language\ ending up in the \texttt{.aux}
% file which is read at the beginning of the document.
%
% \begin{macrocode}
\bool_if:NT \g_@@_euenc_bool
{
%<LU> \cs_set_eq:NN \fontspec_tmp: \XeTeXpicfile
%<LU> \cs_set:Npn \XeTeXpicfile {}
\RequirePackage{xunicode}
%<LU> \cs_set_eq:NN \XeTeXpicfile \fontspec_tmp:
}
% \end{macrocode}
%
%
% \subsection{Generic functions}
%
Expand Down
9 changes: 7 additions & 2 deletions fontspec-code-vars.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
%
% \iffalse
% \begin{macrocode}
%<@@=fontspec>
%<*fontspec>
% \end{macrocode}
% \fi
Expand Down Expand Up @@ -50,9 +51,12 @@
% \end{macrocode}
% For package options:
% \begin{macrocode}
%</fontspec>
%<*options>
\bool_new:N \g_@@_cfg_bool
\bool_new:N \g_@@_math_bool
\bool_new:N \g_@@_euenc_bool
%</options>
%<*fontspec>
% \end{macrocode}
%
% \begin{macrocode}
Expand Down Expand Up @@ -295,7 +299,8 @@
%
% \begin{macrocode}
\tl_const:Nn \c_@@_hexcol_tl {000000}
\tl_const:Nn \c_@@_opacity_tl {FF~}
%<XE> \tl_const:Nn \c_@@_opacity_tl {FF~}
%<LU> \tl_const:Nn \c_@@_opacity_tl {}
\tl_const:Nn \c_@@_postadjust_tl { \l_@@_wordspace_adjust_tl \l_@@_punctspace_adjust_tl }
% \end{macrocode}
%
Expand Down
Loading

0 comments on commit 4e4332f

Please sign in to comment.