diff options
Diffstat (limited to 'fonts/kpfonts-otf/tex/kpfonts-otf.sty')
-rw-r--r-- | fonts/kpfonts-otf/tex/kpfonts-otf.sty | 72 |
1 files changed, 10 insertions, 62 deletions
diff --git a/fonts/kpfonts-otf/tex/kpfonts-otf.sty b/fonts/kpfonts-otf/tex/kpfonts-otf.sty index 4d6ca62a31..9fdb53d30b 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.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 |