diff options
author | Karl Berry <karl@freefriends.org> | 2022-11-10 20:14:47 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-11-10 20:14:47 +0000 |
commit | 8d93505ae106136092f3476f0a6a0878914fa8e5 (patch) | |
tree | 3ef440a36dc1c11ea20a4a356cbb1a1352654123 /Master/texmf-dist/tex | |
parent | e94d9ee5a54aafce193010647473253303322176 (diff) |
kpfonts-otf (10nov22)
git-svn-id: svn://tug.org/texlive/trunk@64984 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/kpfonts-otf/kpfonts-otf.sty | 72 |
1 files changed, 10 insertions, 62 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 4d6ca62a315..9fdb53d30b0 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.45} -\def\filedate{2022-10-06} +\def\fileversion{0.46} +\def\filedate{2022-11-10} \ProvidesPackage{kpfonts-otf}[\filedate\space\fileversion] % Ensure luatex or xetex engine @@ -21,7 +21,6 @@ \newif\ifkp@osn \newif\ifkp@os \newif\ifkp@vos -\newif\ifkp@longs \newif\ifkp@Qtail % \newif\ifkp@lightmath @@ -50,9 +49,7 @@ \DeclareOption{lighttext} {\kp@lighttexttrue} \DeclareOption{oldstylenums} {\kp@osntrue} \DeclareOption{oldstyle} {\kp@ostrue\kp@osntrue\kp@Qtailtrue} -\DeclareOption{longs} {\kp@longstrue} -\DeclareOption{veryoldstyle} {\kp@vostrue\kp@osntrue\kp@Qtailtrue - \ifluatex\kp@longstrue\fi} +\DeclareOption{veryoldstyle} {\kp@vostrue\kp@osntrue\kp@Qtailtrue} \DeclareOption{largesmallcaps} {\kp@largesmallcapstrue} \DeclareOption{altfligs} {\kp@altfligstrue} \DeclareOption{germandbls} {\kp@germandblstrue} @@ -81,6 +78,8 @@ % Text fonts setup... \ifkp@text \RequirePackage{fontspec}[2019/01/01] + % Style alias (text only) + \newopentypefeature{Style}{autolongs}{+ss12} \RequirePackage{realscripts} % Two candidates for \rmfamily: \newfontfamily\KpRoman{KpRoman} @@ -98,6 +97,9 @@ % Accents not in tuenc.def \DeclareUnicodeAccent{\candra} \UnicodeEncodingName{"0310} \DeclareUnicodeAccent{\ringbelow} \UnicodeEncodingName{"0325} + % Long s: ſ + \DeclareTextCommand{\longs}{TU}{\char"17F} + \DeclareTextCommand{\shorts}{TU}{\char"17F\char"200B} % Oldstylenums \ifkp@osn \ifkp@tt @@ -115,64 +117,10 @@ %% Veryoldstyle \ifkp@vos \ifkp@tt - \defaultfontfeatures+[\ttfamily]{Style=Historic, Contextuals=Alternate} + \defaultfontfeatures+[\ttfamily]{StylisticSet=12} \fi \defaultfontfeatures+[KpRoman,KpLight,\sffamily]{% - Style=Historic,Ligatures=Historic,Contextuals=Alternate} - \fi - %% No Long s before spaces with luatex - \ifkp@longs - \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"); - } - } - \else - \PackageWarning{kpfonts-otf}% - {Option "longs" skipped (luatex only), reported} - \fi + StylisticSet=12, Ligatures=Historic} \fi % Smallcaps \ifkp@largesmallcaps |