summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-01-17 21:28:23 +0000
committerKarl Berry <karl@freefriends.org>2019-01-17 21:28:23 +0000
commit590f92a6661f059e1c49b7b453c6c43149865628 (patch)
tree4a6e2c981817b1e58634f3f6c03fc48cd0c0ada8 /Master/texmf-dist/tex
parentdf2e480fb0e83b9160de826127a9200714b9f3f2 (diff)
fontspec (17jan19)
git-svn-id: svn://tug.org/texlive/trunk@49739 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty109
-rw-r--r--Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty147
-rw-r--r--Master/texmf-dist/tex/latex/fontspec/fontspec.lua4
-rw-r--r--Master/texmf-dist/tex/latex/fontspec/fontspec.sty2
4 files changed, 163 insertions, 99 deletions
diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty b/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty
index 7382cdaa732..6c799b521b1 100644
--- a/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty
+++ b/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty
@@ -41,7 +41,7 @@
\RequirePackage{xparse}
\ProvidesExplPackage{fontspec-luatex}%
- {2019/01/16}{2.6k}{Font selection for XeLaTeX and LuaLaTeX}
+ {2019/01/18}{2.6l}{Font selection for XeLaTeX and LuaLaTeX}
%%^^A%% fontspec-code-load.dtx -- part of FONTSPEC <wspr.io/fontspec>
%%^^A%% fontspec-code-vars.dtx -- part of FONTSPEC <wspr.io/fontspec>
@@ -73,10 +73,14 @@
\bool_new:N \l__fontspec_proceed_bool
\bool_new:N \l__fontspec_check_feat_bool
\bool_new:N \l__fontspec_never_check_bool
+\bool_new:N \l__fontspec_scripts_missing_bool
\int_new:N \l__fontspec_script_int
\int_new:N \l__fontspec_language_int
\int_new:N \l__fontspec_strnum_int
\int_new:N \l__fontspec_tmp_int
+\int_new:N \l__fontspec_tmpa_int
+\int_new:N \l__fontspec_tmpb_int
+\int_new:N \l__fontspec_tmpc_int
\int_new:N \l__fontspec_em_int
\int_new:N \l__fontspec_emdef_int
\int_new:N \l__fontspec_strong_int
@@ -407,6 +411,10 @@
{
Font "\l_fontspec_fontname_tl" does not contain any OpenType `Script' information.
}
+\__fontspec_msg_new:nnn {fontspec} {dflt-script}
+ {
+ Font "\l_fontspec_fontname_tl" falling back to default (DFLT) script.
+ }
\__fontspec_msg_new:nnn {fontspec} {opa-twice}
{
Opacity set twice, in both Colour and Opacity.\\
@@ -1281,6 +1289,13 @@
\__fontspec_primitive_font_gset:Nnn \l_fontspec_font
{ \__fontspec_construct_font_call:nn { \l__fontspec_fontname_up_tl } {} } {\f@size pt}
\l_fontspec_font % this is necessary for LuaLaTeX to check the scripts properly
+ \__fontspec_check_script:NnTF \l_fontspec_font {DFLT}
+ {
+ \bool_set_false:N \l__fontspec_scripts_missing_bool
+ }
+ {
+ \bool_set_true:N \l__fontspec_scripts_missing_bool
+ }
}
\cs_new:Nn \__fontspec_construct_font_call:nnnnnn
{
@@ -1310,11 +1325,30 @@
{
\bool_if:NT \l__fontspec_firsttime_bool
{
- \tl_if_empty:NTF \l__fontspec_script_name_tl
+ \bool_if:NTF \l__fontspec_scripts_missing_bool
{
- \__fontspec_check_script:NnTF \l_fontspec_font {latn}
+ \__fontspec_info:n {no-scripts}
+ }
+ {
+ \tl_if_empty:NTF \l__fontspec_script_name_tl
+ {
+ \__fontspec_check_script:NnTF \l_fontspec_font {latn}
+ {
+ \tl_set:Nn \l__fontspec_script_name_tl {Latin}
+ \tl_if_empty:NT \l__fontspec_lang_name_tl
+ {
+ \tl_set:Nn \l__fontspec_lang_name_tl {Default}
+ }
+ \keys_set:nx {fontspec-opentype} {Script=\l__fontspec_script_name_tl}
+ \keys_set:nx {fontspec-opentype} {Language=\l__fontspec_lang_name_tl}
+ }
+ {
+ \__fontspec_info:n {dflt-script}
+ \keys_set:nx {fontspec-opentype} {Script=Default}
+ \keys_set:nx {fontspec-opentype} {Language=Default}
+ }
+ }
{
- \tl_set:Nn \l__fontspec_script_name_tl {Latin}
\tl_if_empty:NT \l__fontspec_lang_name_tl
{
\tl_set:Nn \l__fontspec_lang_name_tl {Default}
@@ -1322,18 +1356,6 @@
\keys_set:nx {fontspec-opentype} {Script=\l__fontspec_script_name_tl}
\keys_set:nx {fontspec-opentype} {Language=\l__fontspec_lang_name_tl}
}
- {
- \__fontspec_info:n {no-scripts}
- \bool_set_true:N \l__fontspec_never_check_bool
- }
- }
- {
- \tl_if_empty:NT \l__fontspec_lang_name_tl
- {
- \tl_set:Nn \l__fontspec_lang_name_tl {Default}
- }
- \keys_set:nx {fontspec-opentype} {Script=\l__fontspec_script_name_tl}
- \keys_set:nx {fontspec-opentype} {Language=\l__fontspec_lang_name_tl}
}
}
}
@@ -1817,7 +1839,13 @@
{ \tl_set:Nx \l__fontspec_tmp_tl {\curr@fontshape/\f@size} }
{ \tl_set:Nx \l__fontspec_tmp_tl {\cs_to_str:N #1} }
\directlua{fontspec.check_ot_script("\l__fontspec_tmp_tl", "#2")}
- \bool_if:NTF \l__fontspec_check_bool \prg_return_true: \prg_return_false:
+ \bool_if:NTF \l__fontspec_check_bool
+ {
+ \prg_return_true:
+ }
+ {
+ \prg_return_false:
+ }
}
}
\prg_new_conditional:Nnn \__fontspec_check_lang:Nn {TF}
@@ -1848,7 +1876,7 @@
}
\prg_new_conditional:Nnn \__fontspec_check_ot_feat:Nnnn {TF,F}
{
- \bool_if:NTF \l__fontspec_never_check_bool
+ \bool_if:nTF {\l__fontspec_never_check_bool || \l__fontspec_scripts_missing_bool}
{ \prg_return_true: }
{
\__fontspec_ot_validate_tag:x {#2}
@@ -2754,34 +2782,37 @@
{
\keys_define:nn { fontspec-opentype } { Script / #1 .code:n =
{
- \bool_set_false:N \l__fontspec_scriptlang_exist_bool
- \clist_map_inline:nn {#2}
- {
- \__fontspec_check_script:NnT \l_fontspec_font {####1}
- {
- \tl_set:Nn \l_fontspec_script_tl {####1}
- \int_set:Nn \l__fontspec_script_int {\l__fontspec_strnum_int}
- \bool_set_true:N \l__fontspec_scriptlang_exist_bool
- \tl_gset:Nx \g__fontspec_single_feat_tl { script=####1 }
- \clist_map_break:
- }
- }
- \bool_if:NF \l__fontspec_scriptlang_exist_bool
+ \bool_if:NF \l__fontspec_scripts_missing_bool
{
- \str_if_eq:eeTF {#1} {Latin}
- {
- \__fontspec_warning:nx {script-not-exist} {#1}
- }
+ \bool_set_false:N \l__fontspec_scriptlang_exist_bool
+ \clist_map_inline:nn {#2}
{
- \__fontspec_check_script:NnTF \l_fontspec_font {latn}
+ \__fontspec_check_script:NnT \l_fontspec_font {####1}
{
- \__fontspec_warning:nx {script-not-exist-latn} {#1}
- \tl_set:Nn \l_fontspec_script_tl {latn}
+ \tl_set:Nn \l_fontspec_script_tl {####1}
\int_set:Nn \l__fontspec_script_int {\l__fontspec_strnum_int}
+ \bool_set_true:N \l__fontspec_scriptlang_exist_bool
+ \tl_gset:Nx \g__fontspec_single_feat_tl { script=####1 }
+ \clist_map_break:
}
+ }
+ \bool_if:NF \l__fontspec_scriptlang_exist_bool
+ {
+ \str_if_eq:eeTF {#1} {Latin}
{
\__fontspec_warning:nx {script-not-exist} {#1}
- \keys_set:nn {fontspec-opentype} { Script = Default }
+ }
+ {
+ \__fontspec_check_script:NnTF \l_fontspec_font {latn}
+ {
+ \__fontspec_warning:nx {script-not-exist-latn} {#1}
+ \tl_set:Nn \l_fontspec_script_tl {latn}
+ \int_set:Nn \l__fontspec_script_int {\l__fontspec_strnum_int}
+ }
+ {
+ \__fontspec_warning:nx {script-not-exist} {#1}
+ \keys_set:nn {fontspec-opentype} { Script = Default }
+ }
}
}
}
diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty b/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
index c3740818680..1e7ad583f4b 100644
--- a/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
+++ b/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
@@ -41,7 +41,7 @@
\RequirePackage{xparse}
\ProvidesExplPackage{fontspec-xetex}%
- {2019/01/16}{2.6k}{Font selection for XeLaTeX and LuaLaTeX}
+ {2019/01/18}{2.6l}{Font selection for XeLaTeX and LuaLaTeX}
%%^^A%% fontspec-code-load.dtx -- part of FONTSPEC <wspr.io/fontspec>
%%^^A%% fontspec-code-vars.dtx -- part of FONTSPEC <wspr.io/fontspec>
@@ -73,10 +73,14 @@
\bool_new:N \l__fontspec_proceed_bool
\bool_new:N \l__fontspec_check_feat_bool
\bool_new:N \l__fontspec_never_check_bool
+\bool_new:N \l__fontspec_scripts_missing_bool
\int_new:N \l__fontspec_script_int
\int_new:N \l__fontspec_language_int
\int_new:N \l__fontspec_strnum_int
\int_new:N \l__fontspec_tmp_int
+\int_new:N \l__fontspec_tmpa_int
+\int_new:N \l__fontspec_tmpb_int
+\int_new:N \l__fontspec_tmpc_int
\int_new:N \l__fontspec_em_int
\int_new:N \l__fontspec_emdef_int
\int_new:N \l__fontspec_strong_int
@@ -407,6 +411,10 @@
{
Font "\l_fontspec_fontname_tl" does not contain any OpenType `Script' information.
}
+\__fontspec_msg_new:nnn {fontspec} {dflt-script}
+ {
+ Font "\l_fontspec_fontname_tl" falling back to default (DFLT) script.
+ }
\__fontspec_msg_new:nnn {fontspec} {opa-twice}
{
Opacity set twice, in both Colour and Opacity.\\
@@ -1277,6 +1285,13 @@
\__fontspec_primitive_font_gset:Nnn \l_fontspec_font
{ \__fontspec_construct_font_call:nn { \l__fontspec_fontname_up_tl } {} } {\f@size pt}
\l_fontspec_font % this is necessary for LuaLaTeX to check the scripts properly
+ \__fontspec_check_script:NnTF \l_fontspec_font {DFLT}
+ {
+ \bool_set_false:N \l__fontspec_scripts_missing_bool
+ }
+ {
+ \bool_set_true:N \l__fontspec_scripts_missing_bool
+ }
}
\cs_new:Nn \__fontspec_construct_font_call:nnnnnn
{
@@ -1306,11 +1321,30 @@
{
\bool_if:NT \l__fontspec_firsttime_bool
{
- \tl_if_empty:NTF \l__fontspec_script_name_tl
+ \bool_if:NTF \l__fontspec_scripts_missing_bool
+ {
+ \__fontspec_info:n {no-scripts}
+ }
{
- \__fontspec_check_script:NnTF \l_fontspec_font {latn}
+ \tl_if_empty:NTF \l__fontspec_script_name_tl
+ {
+ \__fontspec_check_script:NnTF \l_fontspec_font {latn}
+ {
+ \tl_set:Nn \l__fontspec_script_name_tl {Latin}
+ \tl_if_empty:NT \l__fontspec_lang_name_tl
+ {
+ \tl_set:Nn \l__fontspec_lang_name_tl {Default}
+ }
+ \keys_set:nx {fontspec-opentype} {Script=\l__fontspec_script_name_tl}
+ \keys_set:nx {fontspec-opentype} {Language=\l__fontspec_lang_name_tl}
+ }
+ {
+ \__fontspec_info:n {dflt-script}
+ \keys_set:nx {fontspec-opentype} {Script=Default}
+ \keys_set:nx {fontspec-opentype} {Language=Default}
+ }
+ }
{
- \tl_set:Nn \l__fontspec_script_name_tl {Latin}
\tl_if_empty:NT \l__fontspec_lang_name_tl
{
\tl_set:Nn \l__fontspec_lang_name_tl {Default}
@@ -1318,18 +1352,6 @@
\keys_set:nx {fontspec-opentype} {Script=\l__fontspec_script_name_tl}
\keys_set:nx {fontspec-opentype} {Language=\l__fontspec_lang_name_tl}
}
- {
- \__fontspec_info:n {no-scripts}
- \bool_set_true:N \l__fontspec_never_check_bool
- }
- }
- {
- \tl_if_empty:NT \l__fontspec_lang_name_tl
- {
- \tl_set:Nn \l__fontspec_lang_name_tl {Default}
- }
- \keys_set:nx {fontspec-opentype} {Script=\l__fontspec_script_name_tl}
- \keys_set:nx {fontspec-opentype} {Language=\l__fontspec_lang_name_tl}
}
}
}
@@ -1755,19 +1777,21 @@
\int_compare:nT { \tl_count:n {#6} > 2 }
{ \__fontspec_error:nx {ot-tag-too-long} {#2#3#4#5#6} }
- \str_if_eq:eeTF {#2#3#4#5#6} {DFLT}
- { \int_zero:N #1 }
+ \int_set:Nn #1
{
- \int_set:Nn #1
- {
- `#2 * "1000000
- + `#3 * "10000
- + \ifx \c_empty_tl #4 32 \else `#4 \fi * "100
- + \ifx \c_empty_tl #5 32 \else `#5 \fi
- }
+ `#2 * "1000000
+ + `#3 * "10000
+ + \ifx \c_empty_tl #4 32 \else `#4 \fi * "100
+ + \ifx \c_empty_tl #5 32 \else `#5 \fi
+ }
+ }
+\cs_new_protected:Nn \__fontspec_lang_dflt_correct:N
+ {
+ \int_compare:nNnT {#1} = {1145457748} % "DFLT"
+ {
+ \int_zero:N #1
}
}
-\cs_generate_variant:Nn \__fontspec_iv_str_to_num:Nn {No}
%%^^A%% fontspec-code-opentype.dtx -- part of FONTSPEC <wspr.io/fontspec>
@@ -1879,18 +1903,23 @@
{
\__fontspec_iv_str_to_num:Nx \l__fontspec_strnum_int {#2}
\__fontspec_iv_str_to_num:Nx \l__fontspec_script_int {#3}
- \int_set:Nn \l_tmpb_int
+ \int_set:Nn \l__fontspec_tmpb_int
{ \XeTeXOTcountlanguages #1 \l__fontspec_script_int }
- \int_zero:N \l_tmpa_int
+ \int_zero:N \l__fontspec_tmpa_int
\bool_set_false:N \l__fontspec_check_bool
- \bool_until_do:nn { \int_compare_p:nNn \l_tmpa_int = \l_tmpb_int }
+ \bool_until_do:nn { \int_compare_p:nNn \l__fontspec_tmpa_int = \l__fontspec_tmpb_int }
{
- \ifnum\XeTeXOTlanguagetag #1 \l__fontspec_script_int \l_tmpa_int = \l__fontspec_strnum_int
- \bool_set_true:N \l__fontspec_check_bool
- \int_set:Nn \l_tmpa_int {\l_tmpb_int}
- \else
- \int_incr:N \l_tmpa_int
- \fi
+ \int_set:Nn \l__fontspec_tmpc_int
+ { \XeTeXOTlanguagetag #1 \l__fontspec_script_int \l__fontspec_tmpa_int }
+
+ \int_compare:nNnTF \l__fontspec_tmpc_int = \l__fontspec_strnum_int
+ {
+ \bool_set_true:N \l__fontspec_check_bool
+ \int_set:Nn \l__fontspec_tmpa_int {\l__fontspec_tmpb_int}
+ }
+ {
+ \int_incr:N \l__fontspec_tmpa_int
+ }
}
\bool_if:NTF \l__fontspec_check_bool \prg_return_true: \prg_return_false:
}
@@ -1902,11 +1931,12 @@
}
\prg_new_conditional:Nnn \__fontspec_check_ot_feat:Nnnn {TF,F}
{
- \bool_if:NTF \l__fontspec_never_check_bool
+ \bool_if:nTF {\l__fontspec_never_check_bool || \l__fontspec_scripts_missing_bool}
{ \prg_return_true: }
{
\__fontspec_iv_str_to_num:Nx \l__fontspec_strnum_int {#2}
\__fontspec_iv_str_to_num:Nx \l__fontspec_language_int {#3}
+ \__fontspec_lang_dflt_correct:N \l__fontspec_language_int
\__fontspec_iv_str_to_num:Nx \l__fontspec_script_int {#4}
\int_set:Nn \l_tmpb_int
{
@@ -2895,34 +2925,37 @@
{
\keys_define:nn { fontspec-opentype } { Script / #1 .code:n =
{
- \bool_set_false:N \l__fontspec_scriptlang_exist_bool
- \clist_map_inline:nn {#2}
+ \bool_if:NF \l__fontspec_scripts_missing_bool
{
- \__fontspec_check_script:NnT \l_fontspec_font {####1}
+ \bool_set_false:N \l__fontspec_scriptlang_exist_bool
+ \clist_map_inline:nn {#2}
{
- \tl_set:Nn \l_fontspec_script_tl {####1}
- \int_set:Nn \l__fontspec_script_int {\l__fontspec_strnum_int}
- \bool_set_true:N \l__fontspec_scriptlang_exist_bool
- \tl_gset:Nx \g__fontspec_single_feat_tl { script=####1 }
- \clist_map_break:
- }
- }
- \bool_if:NF \l__fontspec_scriptlang_exist_bool
- {
- \str_if_eq:eeTF {#1} {Latin}
- {
- \__fontspec_warning:nx {script-not-exist} {#1}
- }
- {
- \__fontspec_check_script:NnTF \l_fontspec_font {latn}
+ \__fontspec_check_script:NnT \l_fontspec_font {####1}
{
- \__fontspec_warning:nx {script-not-exist-latn} {#1}
- \tl_set:Nn \l_fontspec_script_tl {latn}
+ \tl_set:Nn \l_fontspec_script_tl {####1}
\int_set:Nn \l__fontspec_script_int {\l__fontspec_strnum_int}
+ \bool_set_true:N \l__fontspec_scriptlang_exist_bool
+ \tl_gset:Nx \g__fontspec_single_feat_tl { script=####1 }
+ \clist_map_break:
}
+ }
+ \bool_if:NF \l__fontspec_scriptlang_exist_bool
+ {
+ \str_if_eq:eeTF {#1} {Latin}
{
\__fontspec_warning:nx {script-not-exist} {#1}
- \keys_set:nn {fontspec-opentype} { Script = Default }
+ }
+ {
+ \__fontspec_check_script:NnTF \l_fontspec_font {latn}
+ {
+ \__fontspec_warning:nx {script-not-exist-latn} {#1}
+ \tl_set:Nn \l_fontspec_script_tl {latn}
+ \int_set:Nn \l__fontspec_script_int {\l__fontspec_strnum_int}
+ }
+ {
+ \__fontspec_warning:nx {script-not-exist} {#1}
+ \keys_set:nn {fontspec-opentype} { Script = Default }
+ }
}
}
}
diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec.lua b/Master/texmf-dist/tex/latex/fontspec/fontspec.lua
index cd2bd1b9063..a3b2cebcf69 100644
--- a/Master/texmf-dist/tex/latex/fontspec/fontspec.lua
+++ b/Master/texmf-dist/tex/latex/fontspec/fontspec.lua
@@ -23,8 +23,8 @@ fontspec = fontspec or {}
local fontspec = fontspec
fontspec.module = {
name = "fontspec",
- version = "2.6k",
- date = "2019/01/16",
+ version = "2.6l",
+ date = "2019/01/18",
description = "Font selection for XeLaTeX and LuaLaTeX",
author = "Khaled Hosny, Philipp Gesang, Will Robertson",
copyright = "Khaled Hosny, Philipp Gesang, Will Robertson",
diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec.sty b/Master/texmf-dist/tex/latex/fontspec/fontspec.sty
index ca07864a63a..a5a4ba37d20 100644
--- a/Master/texmf-dist/tex/latex/fontspec/fontspec.sty
+++ b/Master/texmf-dist/tex/latex/fontspec/fontspec.sty
@@ -21,7 +21,7 @@
\RequirePackage{xparse}
\ProvidesExplPackage{fontspec}%
- {2019/01/16}{2.6k}{Font selection for XeLaTeX and LuaLaTeX}
+ {2019/01/18}{2.6l}{Font selection for XeLaTeX and LuaLaTeX}
%%^^A%% fontspec-code-load.dtx -- part of FONTSPEC <wspr.io/fontspec>
\sys_if_engine_luatex:T