From e6e6335c7edb9bb6074c636bf2c370608c773923 Mon Sep 17 00:00:00 2001 From: Will Robertson Date: Fri, 26 Apr 2024 13:13:30 +0930 Subject: [PATCH] trim spaces around font files/names addresses latex3/luaotfload#283 --- fontspec-code-internal.dtx | 1 + testfiles/fontload-trimspace.luatex.tlg | 8 ++++++++ testfiles/fontload-trimspace.lvt | 14 ++++++++++++++ testfiles/fontload-trimspace.tlg | 8 ++++++++ 4 files changed, 31 insertions(+) create mode 100644 testfiles/fontload-trimspace.luatex.tlg create mode 100644 testfiles/fontload-trimspace.lvt create mode 100644 testfiles/fontload-trimspace.tlg diff --git a/fontspec-code-internal.dtx b/fontspec-code-internal.dtx index f0af944..7ee9ffb 100644 --- a/fontspec-code-internal.dtx +++ b/fontspec-code-internal.dtx @@ -97,6 +97,7 @@ \cs_new:Nn \@@_sanitise_fontname:Nn { \tl_set:Nx #1 {#2} + \tl_trim_spaces:N #1 \@@_process_ext:N #1 } diff --git a/testfiles/fontload-trimspace.luatex.tlg b/testfiles/fontload-trimspace.luatex.tlg new file mode 100644 index 0000000..23d2922 --- /dev/null +++ b/testfiles/fontload-trimspace.luatex.tlg @@ -0,0 +1,8 @@ +This is a generated file for the l3build validation system. +Don't change this file in any respect. +TU/texgyrepagella-regular.otf(0)/m/n: + [texgyrepagella-regular.otf]:mode=node;script=latn;language=dflt;+tlig; +TU/texgyrepagella-regular.otf(0)/m/n: + [texgyrepagella-regular.otf]:mode=node;script=latn;language=dflt;+tlig; +*************** +Compilation 1 of test file completed with exit status 0 diff --git a/testfiles/fontload-trimspace.lvt b/testfiles/fontload-trimspace.lvt new file mode 100644 index 0000000..abe2b6e --- /dev/null +++ b/testfiles/fontload-trimspace.lvt @@ -0,0 +1,14 @@ + +\input{fontspec-testsetup.tex} + +\usepackage{fontspec} + +\begin{document} + +\setmainfont{texgyrepagella-regular.otf} +hello \CURRNFSS + +\setmainfont{ texgyrepagella-regular.otf } +hello \CURRNFSS + +\end{document} diff --git a/testfiles/fontload-trimspace.tlg b/testfiles/fontload-trimspace.tlg new file mode 100644 index 0000000..2cda896 --- /dev/null +++ b/testfiles/fontload-trimspace.tlg @@ -0,0 +1,8 @@ +This is a generated file for the l3build validation system. +Don't change this file in any respect. +TU/texgyrepagella-regular.otf(0)/m/n: + "[texgyrepagella-regular.otf]/OT:script=latn;language=dflt;mapping=tex-text;" at 10.0pt +TU/texgyrepagella-regular.otf(0)/m/n: + "[texgyrepagella-regular.otf]/OT:script=latn;language=dflt;mapping=tex-text;" at 10.0pt +*************** +Compilation 1 of test file completed with exit status 0