summaryrefslogtreecommitdiff
path: root/fonts/kpfonts-otf/tex/kpfonts-otf.sty
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-09-16 03:00:49 +0000
committerNorbert Preining <norbert@preining.info>2021-09-16 03:00:49 +0000
commite7ce6275948b3b197682f44f64fdb1daf672109c (patch)
tree449e399bcfe3428c2a95def2b57ce8345c7d90b5 /fonts/kpfonts-otf/tex/kpfonts-otf.sty
parent3c36091e77e72aa582c29594048a092b63eae83c (diff)
CTAN sync 202109160300
Diffstat (limited to 'fonts/kpfonts-otf/tex/kpfonts-otf.sty')
-rw-r--r--fonts/kpfonts-otf/tex/kpfonts-otf.sty60
1 files changed, 55 insertions, 5 deletions
diff --git a/fonts/kpfonts-otf/tex/kpfonts-otf.sty b/fonts/kpfonts-otf/tex/kpfonts-otf.sty
index 9c9c4221f4..434ba2bd63 100644
--- a/fonts/kpfonts-otf/tex/kpfonts-otf.sty
+++ b/fonts/kpfonts-otf/tex/kpfonts-otf.sty
@@ -1,6 +1,6 @@
\NeedsTeXFormat{LaTeX2e}[2019-01-01]
-\def\fileversion{0.37}
-\def\filedate{2021-08-18}
+\def\fileversion{0.38}
+\def\filedate{2021-09-12}
\ProvidesPackage{kpfonts-otf}[\filedate\space\fileversion]
% Ensure luatex or xetex engine
@@ -82,7 +82,7 @@
\newfontfamily\KpRoman{KpRoman}
\newfontfamily\KpLight{KpLight}
% Euro symbol
- \newcommand*{\kp@euro}{\char"E990\relax}
+ \newcommand*{\kp@euro}{\ifkp@eurosym\char"E990 \else\char"20AC \fi}
\newcommand*{\kpeuro}[1][]{\def\@tmp{#1}%
\ifx\@tmp\@empty \kp@euro \else #1~\kp@euro\fi
}
@@ -115,6 +115,54 @@
\fi
\defaultfontfeatures+[KpRoman,KpLight,\sffamily]{%
Style=Historic,Ligatures=Historic,Contextuals=Alternate}
+ \ifluatex
+ % This function adds character U+200B (zero width space) when an "s"
+ % is followed by a TeX space (glue or penalty) so that it is not turned
+ % into a long "s" by the "calt" feature.
+ \directlua{%
+ function add_eow_char (head)
+ local eow = 0x200B
+ local GLUE = node.id("glue")
+ local GLYPH = node.id("glyph")
+ local SPSKIP = 13
+ local PENALTY = node.id("penalty")
+ local Longs =
+ {[string.byte("s")] = true}
+ local new_node = node.new
+ local copy_node = node.copy
+ local insert_node_after = node.insert_after
+ % Perserve TeX's kerning
+ head = node.kerning(head)
+ % wordbd is the zero width node to add
+ local wordbd = new_node(GLYPH)
+ for item in node.traverse_id(GLYPH, head) do
+ if Longs[item.char] then
+ local fid = item.font
+ % Check if char U+200B is available in the current font:
+ % code borrowed from file "luaotfload-auxiliary.lua".
+ local fontdata = fonts.hashes.identifiers[fid]
+ if fontdata and fontdata.characters[eow] then
+ nxt = item.next
+ if not nxt or (nxt.id == GLUE and nxt.subtype == SPSKIP)
+ or nxt.id == PENALTY then
+ wordbd.font = fid
+ wordbd.char = eow
+ wordbd.attr = item.attr
+ insert_node_after(head,item,copy_node(wordbd))
+ end
+ end
+ end
+ end
+ end
+ }
+ % Register *after* loading babel-french!
+ \AtBeginDocument{%
+ \directlua{
+ luatexbase.add_to_callback("kerning", add_eow_char,
+ "add_end_of_word_boundary");
+ }
+ }
+ \fi
\fi
% Smallcaps
\ifkp@largesmallcaps
@@ -259,9 +307,11 @@
\Umathchardef\lambdabar = 0 0 "E02A \relax
\Umathchardef\mbfvec = 0 0 "E044 \relax
\Umathchardef\mbfwp = 0 0 "E045 \relax
- \Umathchardef\mbfimath = 0 0 "E046 \relax
- \Umathchardef\mbfjmath = 0 0 "E047 \relax
+ \Umathchardef\mbfdotlessi = 0 0 "E046 \relax
+ \Umathchardef\mbfdotlessj = 0 0 "E047 \relax
\Umathchardef\mbfell = 0 0 "E049 \relax
+ \Umathchardef\mbfimath = 0 0 "E066 \relax
+ \Umathchardef\mbfjmath = 0 0 "E067 \relax
\Umathchardef\mbhbar = 0 0 "E068 \relax
\Umathchardef\mbhslash = 0 0 "E06F \relax
\Umathchardef\mithbar = 0 0 "E078 \relax