summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/fontspec
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-07-16 20:50:34 +0000
committerKarl Berry <karl@freefriends.org>2017-07-16 20:50:34 +0000
commit1d94e11374efd2df67fc1f555b35b0ba661edb94 (patch)
treed67b06cfc3cecdc5ed27f8e1b9160ff8b4382d88 /Master/texmf-dist/source/latex/fontspec
parent71e75f5809b91f87b0008504ab8e6e2516e84ca1 (diff)
fontspec (16jul17)
git-svn-id: svn://tug.org/texlive/trunk@44820 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/fontspec')
-rw-r--r--Master/texmf-dist/source/latex/fontspec/fontspec-api.dtx4
-rw-r--r--Master/texmf-dist/source/latex/fontspec/fontspec-doc-featset.tex5
-rw-r--r--Master/texmf-dist/source/latex/fontspec/fontspec-internal.dtx39
-rw-r--r--Master/texmf-dist/source/latex/fontspec/fontspec-keyval.dtx35
-rw-r--r--Master/texmf-dist/source/latex/fontspec/fontspec-vars.dtx2
-rw-r--r--Master/texmf-dist/source/latex/fontspec/fontspec-xfss.dtx4
-rw-r--r--Master/texmf-dist/source/latex/fontspec/fontspec.dtx6
7 files changed, 68 insertions, 27 deletions
diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-api.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-api.dtx
index 33da24e5bd2..d28517a09c9 100644
--- a/Master/texmf-dist/source/latex/fontspec/fontspec-api.dtx
+++ b/Master/texmf-dist/source/latex/fontspec/fontspec-api.dtx
@@ -118,7 +118,9 @@
% \end{macro}
%
% \begin{macro}{\fontspec_if_feature:nnnTF}
-% Test whether the currently selected font with raw OpenType script tag |#1| and raw OpenType language tag |#2| contains the raw OpenType feature tag |#3|. E.g.: |\fontspec_if_feature:nTF {latn} {ROM} {pnum} {True} {False}|
+% Test whether the currently selected font with raw OpenType script tag |#1| and
+% raw OpenType language tag |#2| contains the raw OpenType feature tag |#3|.
+% E.g.:\\ | \fontspec_if_feature:nTF {latn} {ROM} {pnum} {True} {False}|
% Returns false if the font is not loaded by fontspec or is not an OpenType
% font.
% \begin{macrocode}
diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-doc-featset.tex b/Master/texmf-dist/source/latex/fontspec/fontspec-doc-featset.tex
index 3a1da2019ac..f49d164f652 100644
--- a/Master/texmf-dist/source/latex/fontspec/fontspec-doc-featset.tex
+++ b/Master/texmf-dist/source/latex/fontspec/fontspec-doc-featset.tex
@@ -62,10 +62,11 @@ To reset default font features, simply call the command with an empty argument:
Using the |+| form of the command appends the \meta{font features} to any already-selected defaults.
-\section{Default settings from a file}
+\section{Font settings from file}
-In addition to the defaults that may be specified in the document as described above, when a font is first loaded, a configuration file is searched
+In addition to the defaults that may be specified in the document as described above, when a font is first loaded, a font settings file is searched
for with the name `\meta{fontname}\texttt{.fontspec}'.\footnote{Located in the current folder or within a standard \texttt{texmf} location.}
+If you want to \emph{disable} this feature on a per-font basis, use the \feat{IgnoreFontspecFile} font option.
The contents of this file can be used to specify default font features without
having to have this information present within each document.
diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-internal.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-internal.dtx
index 2de5752f0df..7c4daabcd19 100644
--- a/Master/texmf-dist/source/latex/fontspec/fontspec-internal.dtx
+++ b/Master/texmf-dist/source/latex/fontspec/fontspec-internal.dtx
@@ -43,6 +43,8 @@
\@@_if_detect_external:nT {#2}
{ \keys_set:nn {fontspec-preparse-external} {Path} }
+ \keys_set_known:nn {fontspec-preparse-cfg} {#1}
+
\@@_init_ttc:n {#2}
\@@_load_external_fontoptions:Nn \l_fontspec_fontname_tl {#2}
@@ -138,17 +140,20 @@
% This file could set font-specific options for the font about to be loaded.
% \begin{macrocode}
\cs_new:Nn \@@_load_external_fontoptions:Nn
- {
+ {
+ \bool_if:NT \l_@@_fontcfg_bool
+ {
%<debug> \typeout{:: @@_load_external_fontoptions:Nn \exp_not:N #1 {#2} }
- \@@_sanitise_fontname:Nn #1 {#2}
- \tl_set:Nx \l_@@_ext_filename_tl {#1.fontspec}
- \tl_remove_all:Nn \l_@@_ext_filename_tl {~}
- \prop_if_in:NVF \g_@@_fontopts_prop #1
- {
- \exp_args:No \file_if_exist:nT { \l_@@_ext_filename_tl }
- { \file_input:n { \l_@@_ext_filename_tl } }
- }
- }
+ \@@_sanitise_fontname:Nn #1 {#2}
+ \tl_set:Nx \l_@@_ext_filename_tl {#1.fontspec}
+ \tl_remove_all:Nn \l_@@_ext_filename_tl {~}
+ \prop_if_in:NVF \g_@@_fontopts_prop #1
+ {
+ \exp_args:No \file_if_exist:nT { \l_@@_ext_filename_tl }
+ { \file_input:n { \l_@@_ext_filename_tl } }
+ }
+ }
+ }
% \end{macrocode}
% \end{macro}
%
@@ -1023,11 +1028,19 @@
% reads in the string, delimited by a space; this input is padded with \cmd\@empty s
% and anything beyond four chars is snipped. The \cmd\@empty s then are used to reconstruct
% the spaces in the string to number calculation.
+%
+% For backwards compatibility this code also strips a leading |+| or |-|.
% \begin{macrocode}
\cs_set:Nn \@@_iv_str_to_num:Nn
- {
- \@@_iv_str_to_num:w #1 \q_nil #2 \c_empty_tl \c_empty_tl \q_nil
- }
+ {
+ \@@_strip_leading_sign:Nw #1#2 \q_nil
+ }
+\cs_set:Npn \@@_strip_leading_sign:Nw #1#2#3 \q_nil
+ {
+ \bool_if:nTF { \str_if_eq_p:nn {#2} {+} || \str_if_eq_p:nn {#2} {-} }
+ { \@@_iv_str_to_num:w #1 \q_nil #3 \c_empty_tl \c_empty_tl \q_nil }
+ { \@@_iv_str_to_num:w #1 \q_nil #2#3 \c_empty_tl \c_empty_tl \q_nil }
+ }
\cs_set:Npn \@@_iv_str_to_num:w #1 \q_nil #2#3#4#5#6 \q_nil
{
\int_set:Nn #1
diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-keyval.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-keyval.dtx
index f81e1680d5b..9b2516cf26a 100644
--- a/Master/texmf-dist/source/latex/fontspec/fontspec-keyval.dtx
+++ b/Master/texmf-dist/source/latex/fontspec/fontspec-keyval.dtx
@@ -15,7 +15,7 @@
\clist_set:Nn \g_@@_all_keyval_modules_clist
{
fontspec, fontspec-opentype, fontspec-aat,
- fontspec-preparse, fontspec-preparse-external, fontspec-preparse-nested,
+ fontspec-preparse, fontspec-preparse-cfg, fontspec-preparse-external, fontspec-preparse-nested,
fontspec-renderer
}
% \end{macrocode}
@@ -40,6 +40,18 @@
%
% These features are extracted from the font feature list before all others.
%
+% \paragraph{Don't load font config file}
+% \begin{macrocode}
+\@@_keys_define_code:nnn {fontspec-preparse-cfg} {IgnoreFontspecFile}
+ {
+ \bool_set_false:N \l_@@_fontcfg_bool
+ }
+\@@_keys_define_code:nnn {fontspec-preparse-external} {NoFontCfg}
+ {
+ \bool_set_false:N \l_@@_fontcfg_bool
+ }
+% \end{macrocode}
+%
% \begin{macro}{Path}
% For fonts that aren't installed in the system. If no argument is given, the font is located
% with |kpsewhich|; it's either in the current directory or the \TeX\ tree. Otherwise, the
@@ -420,18 +432,29 @@
% This script is executed for every extra shape, which seems wasteful,
% but allows alternate italic shapes from a separate font, say, to
% be loaded and to be auto-scaled correctly. Even if this would be ugly.
+%
+% To begin, change to \cs{rmfamily} but use internal commands in case cs{rmfamily}
+% has been overwritten.
+% (Note that changing \cs{rmfamily} with fontspec resets \cs{encodingdefault}
+% appropriately.)
% \begin{macrocode}
\cs_new:Nn \@@_calc_scale:n
{
\group_begin:
- \rmfamily
+
+ \fontencoding { \encodingdefault }
+ \fontfamily { \rmdefault }
+ \selectfont
+
\@@_set_font_dimen:NnN \l_@@_tmpa_dim {#1} \font
\@@_set_font_dimen:NnN \l_@@_tmpb_dim {#1} \l_fontspec_font
+
\tl_gset:Nx \l_@@_scale_tl
- {
- \fp_eval:n { \dim_to_fp:n {\l_@@_tmpa_dim} /
- \dim_to_fp:n {\l_@@_tmpb_dim} }
- }
+ {
+ \fp_eval:n { \dim_to_fp:n {\l_@@_tmpa_dim} /
+ \dim_to_fp:n {\l_@@_tmpb_dim} }
+ }
+
\@@_info:n {set-scale}
\group_end:
}
diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-vars.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-vars.dtx
index eb2f0e0b39c..0c8957d6253 100644
--- a/Master/texmf-dist/source/latex/fontspec/fontspec-vars.dtx
+++ b/Master/texmf-dist/source/latex/fontspec/fontspec-vars.dtx
@@ -32,6 +32,8 @@
\bool_new:N \l_@@_ot_bool
\bool_new:N \l_@@_mm_bool
\bool_new:N \l_@@_graphite_bool
+\bool_new:N \l_@@_fontcfg_bool
+\bool_set_true:N \l_@@_fontcfg_bool
% \end{macrocode}
% For dealing with legacy maths:
% \begin{macrocode}
diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-xfss.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-xfss.dtx
index e62bed49f9e..a75d0a54495 100644
--- a/Master/texmf-dist/source/latex/fontspec/fontspec-xfss.dtx
+++ b/Master/texmf-dist/source/latex/fontspec/fontspec-xfss.dtx
@@ -56,9 +56,9 @@
% \begin{macrocode}
\prg_new_conditional:Nnn \@@_if_merge_shape:n {TF}
{
- \bool_if:nTF
+ \bool_lazy_and:nnTF
+ { \tl_if_exist_p:c { \@@_shape_merge:nn {\f@shape} {#1} } }
{
- \tl_if_exist_p:c { \@@_shape_merge:nn {\f@shape} {#1} } &&
\cs_if_exist_p:c
{
\f@encoding/\f@family/\f@series/
diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec.dtx
index e460179754e..b212234bd0b 100644
--- a/Master/texmf-dist/source/latex/fontspec/fontspec.dtx
+++ b/Master/texmf-dist/source/latex/fontspec/fontspec.dtx
@@ -79,14 +79,14 @@ And the derived files: fontspec*.sty,fontspec.lua, fontspec.pdf.
%<fontspec&xetexx>\ProvidesExplPackage{fontspec-xetex}%
%<fontspec&luatex>\ProvidesExplPackage{fontspec-luatex}%
%<*fontspec>
- {2017/03/31}{2.6a}{Font selection for XeLaTeX and LuaLaTeX}
+ {2017/07/16}{2.6b}{Font selection for XeLaTeX and LuaLaTeX}
%</fontspec>
%<lua>fontspec = fontspec or {}
%<lua>local fontspec = fontspec
%<lua>fontspec.module = {
%<lua> name = "fontspec",
-%<lua> version = "2.6a",
-%<lua> date = "2017/03/31",
+%<lua> version = "2.6b",
+%<lua> date = "2017/07/16",
%<lua> description = "Font selection for XeLaTeX and LuaLaTeX",
%<lua> author = "Khaled Hosny, Philipp Gesang, Will Robertson",
%<lua> copyright = "Khaled Hosny, Philipp Gesang, Will Robertson",