diff options
author | Karl Berry <karl@freefriends.org> | 2021-09-15 20:51:24 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-09-15 20:51:24 +0000 |
commit | d5395b52dba2ebe07547293e65ac15a5c02d9b4f (patch) | |
tree | d4d6c55f5f102b39cd21c6a472e4f91eaddb6b4f /Master/texmf-dist/tex/latex/kpfonts-otf | |
parent | 953440a42926ed50c8732e6b59037afecb5b088f (diff) |
kpfonts-otf (15sep21)
git-svn-id: svn://tug.org/texlive/trunk@60515 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/kpfonts-otf')
-rw-r--r-- | Master/texmf-dist/tex/latex/kpfonts-otf/kpfonts-otf.sty | 60 |
1 files changed, 55 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/latex/kpfonts-otf/kpfonts-otf.sty b/Master/texmf-dist/tex/latex/kpfonts-otf/kpfonts-otf.sty index 9c9c4221f4e..434ba2bd632 100644 --- a/Master/texmf-dist/tex/latex/kpfonts-otf/kpfonts-otf.sty +++ b/Master/texmf-dist/tex/latex/kpfonts-otf/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 |