[latex3-commits] [git/LaTeX3-latex3-babel] main: Fix #188. New patch for fontspec warnings. (8d42add)
Javier
email at dante.de
Sun Sep 25 19:28:59 CEST 2022
Repository : https://github.com/latex3/babel
On branch : main
Link : https://github.com/latex3/babel/commit/8d42add1a7eaf14486ddc2bca7033af2b7d16634
>---------------------------------------------------------------
commit 8d42add1a7eaf14486ddc2bca7033af2b7d16634
Author: Javier <email at localhost>
Date: Sun Sep 25 19:28:59 2022 +0200
Fix #188. New patch for fontspec warnings.
>---------------------------------------------------------------
8d42add1a7eaf14486ddc2bca7033af2b7d16634
README.md | 4 ++-
babel.dtx | 62 +++++++++++++++++++++++---------------------
babel.ins | 2 +-
babel.pdf | Bin 885856 -> 886222 bytes
bbcompat.dtx | 2 +-
locale/bo/babel-bo.ini | 6 ++---
locale/bo/babel-tibetan.tex | 4 +--
7 files changed, 42 insertions(+), 38 deletions(-)
diff --git a/README.md b/README.md
index 347a534..d2916b2 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-## Babel 3.80.2869
+## Babel 3.80.2871
**Development**
@@ -50,6 +50,8 @@ respective authors.
```
3.81 dev
* Tibetan line breaking and justification.
+ * No 'fontspec' warnings about inexistent languages and
+ scripts.
3.80 2022-09-16
* Ethiopic calendar.
diff --git a/babel.dtx b/babel.dtx
index 1eee69c..4cba342 100644
--- a/babel.dtx
+++ b/babel.dtx
@@ -32,7 +32,7 @@
%
% \iffalse
%<*filedriver>
-\ProvidesFile{babel.dtx}[2022/09/23 v3.80.2869 The Babel package]
+\ProvidesFile{babel.dtx}[2022/09/25 v3.80.2871 The Babel package]
\documentclass{ltxdoc}
\GetFileInfo{babel.dtx}
\usepackage{fontspec}
@@ -5176,8 +5176,8 @@ help from Bernd Raichle, for which I am grateful.
% \section{Tools}
%
% \begin{macrocode}
-%<<version=3.80.2869>>
-%<<date=2022/09/23>>
+%<<version=3.80.2871>>
+%<<date=2022/09/25>>
% \end{macrocode}
%
% \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -12058,9 +12058,7 @@ help from Bernd Raichle, for which I am grateful.
\ifx\RTLfootnotetext\@undefined
\AtEndOfPackage{%
\EnableBabelHook{babel-bidi}%
- \ifx\fontspec\@undefined
- \bbl at loadfontspec % bidi needs fontspec
- \fi
+ \bbl at loadfontspec % bidi needs fontspec
\usepackage#1{bidi}}%
\fi}
\ifnum\bbl at bidimode>200
@@ -12940,24 +12938,14 @@ help from Bernd Raichle, for which I am grateful.
%<<*Font selection>>
\bbl at trace{Font handling with fontspec}
\ifx\ExplSyntaxOn\@undefined\else
- \ExplSyntaxOn
- \catcode`\ =10
+ \def\bbl at fs@warn#1#2{% \bbl at tempfs is the original macro
+ \in@{,#1,}{,no-script,language-not-exist,}%
+ \ifin@\else\bbl at tempfs{#1}{#2}\fi}
\def\bbl at loadfontspec{%
- \usepackage{fontspec}% TODO. Apply patch always
- \expandafter
- \def\csname msg~text~>~fontspec/language-not-exist\endcsname##1##2##3##4{%
- Font '\l_fontspec_fontname_tl' is using the\\%
- default features for language '##1'.\\%
- That's usually fine, because many languages\\%
- require no specific features, but if the output is\\%
- not as expected, consider selecting another font.}
- \expandafter
- \def\csname msg~text~>~fontspec/no-script\endcsname##1##2##3##4{%
- Font '\l_fontspec_fontname_tl' is using the\\%
- default features for script '##2'.\\%
- That's not always wrong, but if the output is\\%
- not as expected, consider selecting another font.}}
- \ExplSyntaxOff
+ \let\bbl at loadfontspec\relax
+ \ifx\fontspec\@undefined
+ \usepackage{fontspec}%
+ \fi}%
\fi
\@onlypreamble\babelfont
\newcommand\babelfont[2][]{% 1=langs/scripts 2=fam
@@ -12969,9 +12957,7 @@ help from Bernd Raichle, for which I am grateful.
\fi}%
\edef\bbl at tempa{#1}%
\def\bbl at tempb{#2}% Used by \bbl at bblfont
- \ifx\fontspec\@undefined
- \bbl at loadfontspec
- \fi
+ \bbl at loadfontspec
\EnableBabelHook{babel-fontspec}% Just calls \bbl at switchfont
\bbl at bblfont}
\newcommand\bbl at bblfont[2][]{% 1=features 2=fontname, @font=rm|sf|tt
@@ -13126,8 +13112,11 @@ help from Bernd Raichle, for which I am grateful.
{\\\newfontscript{\bbl at cl{sname}}{\bbl at cl{sotf}}}%
\<keys_if_exist:nnF>{fontspec-opentype}{Language/\bbl at cl{lname}}%
{\\\newfontlanguage{\bbl at cl{lname}}{\bbl at cl{lotf}}}%
+ \let\\\bbl at tempfs\<__fontspec_warning:nx>%
+ \let\<__fontspec_warning:nx>\\\bbl at fs@warn
\\\renewfontfamily\\#4%
[\bbl at cl{lsys},#2]}{#3}% ie \bbl at exp{..}{#3}
+ \bbl at exp{\let\<__fontspec_warning:nx>\\\bbl at tempfs}%
\begingroup
#4%
\xdef#1{\f at family}% eg, \bbl at rmdflt@lang{FreeSerif(0)}
@@ -14486,10 +14475,11 @@ end
\@ifnextchar[{\bbl at settransform{0}}{\bbl at settransform{0}[]}}
\gdef\babelposthyphenation{&%
\@ifnextchar[{\bbl at settransform{1}}{\bbl at settransform{1}[]}}
+\gdef\bbl at postlinebreak{\bbl at settransform{2}[]} &% WIP
\gdef\bbl at settransform#1[#2]#3#4#5{&%
\ifcase#1
\bbl at activateprehyphen
- \else
+ \or
\bbl at activateposthyphen
\fi
\begingroup
@@ -14505,7 +14495,7 @@ end
rep = rep:gsub('^%s*(remove)%s*$', 'remove = true')
rep = rep:gsub('^%s*(insert)%s*,', 'insert = true, ')
rep = rep:gsub('(string)%s*=%s*([^%s,]*)', Babel.capture_func)
- if #1 == 0 then
+ if #1 == 0 or #1 == 2 then
rep = rep:gsub('(space)%s*=%s*([%d%.]+)%s+([%d%.]+)%s+([%d%.]+)',
'space = {' .. '%2, %3, %4' .. '}')
rep = rep:gsub('(spacefactor)%s*=%s*([%d%.]+)%s+([%d%.]+)%s+([%d%.]+)',
@@ -14518,6 +14508,16 @@ end
end
tex.print([[\string\babeltempa{{]] .. rep .. [[}}]])
}}}&%
+ \bbl at foreach\babeltempb{&%
+ \bbl at forkv{{##1}}{&%
+ \in@{,####1,}{,nil,step,data,remove,insert,string,no,pre,&%
+ no,post,penalty,kashida,space,spacefactor,}&%
+ \ifin@\else
+ \bbl at error
+ {Bad option '####1' in a transform.\\&%
+ I’ll ignore it but expect more errors}&%
+ {See the manual for further info.}&%
+ \fi}}&%
\let\bbl at kv@attribute\relax
\let\bbl at kv@label\relax
\bbl at forkv{#2}{\bbl at csarg\edef{kv@##1}{##2}}&%
@@ -14528,7 +14528,7 @@ end
local lbkr = Babel.linebreaking.replacements[#1]
local u = unicode.utf8
local id, attr, label
- if #1 == 0 then
+ if #1 == 0 or #1 == 2 then
id = \the\csname bbl at id@@#3\endcsname\space
else
id = \the\csname l@#3\endcsname\space
@@ -14543,7 +14543,7 @@ end
\fi
&% Convert pattern:
local patt = string.gsub([==[#4]==], '%s', '')
- if #1 == 0 then
+ if #1 == 0 or #1 == 2 then
patt = string.gsub(patt, '|', ' ')
end
if not u.find(patt, '()', nil, true) then
@@ -15080,6 +15080,7 @@ end
Babel.linebreaking.replacements = {}
Babel.linebreaking.replacements[0] = {} -- pre
Babel.linebreaking.replacements[1] = {} -- post
+Babel.linebreaking.replacements[2] = {} -- post-line WIP
-- Discretionaries contain strings as nodes
function Babel.str_to_nodes(fn, matches, base)
@@ -15231,6 +15232,7 @@ Babel.us_char = string.char(31)
function Babel.hyphenate_replace(head, mode)
local u = unicode.utf8
local lbkr = Babel.linebreaking.replacements[mode]
+ if mode == 2 then mode = 0 end -- WIP
local word_head = head
diff --git a/babel.ins b/babel.ins
index d05700e..2ab5a2f 100644
--- a/babel.ins
+++ b/babel.ins
@@ -26,7 +26,7 @@
%% and covered by LPPL is defined by the unpacking scripts (with
%% extension .ins) which are part of the distribution.
%%
-\def\filedate{2022/09/23}
+\def\filedate{2022/09/25}
\def\batchfile{babel.ins}
\input docstrip.tex
diff --git a/babel.pdf b/babel.pdf
index 6d28f48..5d0a375 100644
Binary files a/babel.pdf and b/babel.pdf differ
diff --git a/bbcompat.dtx b/bbcompat.dtx
index 7d4b1e6..beb8cea 100644
--- a/bbcompat.dtx
+++ b/bbcompat.dtx
@@ -30,7 +30,7 @@
%
% \iffalse
%<*dtx>
-\ProvidesFile{bbcompat.dtx}[2022/09/23 v3.80.2869]
+\ProvidesFile{bbcompat.dtx}[2022/09/25 v3.80.2871]
%</dtx>
%
%% File 'bbcompat.dtx'
diff --git a/locale/bo/babel-bo.ini b/locale/bo/babel-bo.ini
index ba751ca..0ba6f9a 100644
--- a/locale/bo/babel-bo.ini
+++ b/locale/bo/babel-bo.ini
@@ -137,10 +137,10 @@ time.short = [HH]:[mm]
[typography]
frenchspacing = yes
hyphenrules =
-lefthyphenmin =
-righthyphenmin =
+lefthyphenmin = 1
+righthyphenmin = 1
hyphenchar =
-prehyphenchar =
+prehyphenchar = 0
posthyphenchar =
exhyphenchar =
preexhyphenchar =
diff --git a/locale/bo/babel-tibetan.tex b/locale/bo/babel-tibetan.tex
index e19387a..6c6841f 100644
--- a/locale/bo/babel-tibetan.tex
+++ b/locale/bo/babel-tibetan.tex
@@ -17,8 +17,8 @@
{ {}, {space=#1, data=1 } }%
\babelprehyphenation{tibetan}{ ^^^^0f0d | ^^^^0f0d }%
{ {}, {insert, penalty=10000}, {}, {} }%
- \babelprehyphenation{tibetan}{ ^^^^0f0b [^ ^^^^0f0d] }%
- { {}, {insert, space=0 .0001 0, data=1}, {} }%
+ \babelprehyphenation{tibetan}{ ^^^^0f0b () ([^ ^^^^0f0d]) () }%
+ { {insert, space=0 .0001 0, data=1}, {string = {1}} }%
\directlua{
Babel.tibetan = Babel.tibetan or {}
%
More information about the latex3-commits
mailing list.