summaryrefslogtreecommitdiff
path: root/fonts/kpfonts-otf/tex/kpfonts-otf.sty
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-03-17 03:01:06 +0000
committerNorbert Preining <norbert@preining.info>2021-03-17 03:01:06 +0000
commitbb51b61cfc3fcb367f52d31948039a1468fbcf80 (patch)
tree2c9be8de7fa3daaf6064452aaecc8ed6a0f8d567 /fonts/kpfonts-otf/tex/kpfonts-otf.sty
parent4947a16af6c8e33f697a8da222db7f3ad027ba94 (diff)
CTAN sync 202103170301
Diffstat (limited to 'fonts/kpfonts-otf/tex/kpfonts-otf.sty')
-rw-r--r--fonts/kpfonts-otf/tex/kpfonts-otf.sty199
1 files changed, 110 insertions, 89 deletions
diff --git a/fonts/kpfonts-otf/tex/kpfonts-otf.sty b/fonts/kpfonts-otf/tex/kpfonts-otf.sty
index 1975e7c660..0630b74ed2 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.34}
-\def\filedate{2021-01-30}
+\def\fileversion{0.35}
+\def\filedate{2021-03-14}
\ProvidesPackage{kpfonts-otf}[\filedate\space\fileversion]
% Ensure luatex or xetex engine
@@ -15,7 +15,9 @@
\newif\ifkp@lighttext
\newif\ifkp@largesmallcaps
\newif\ifkp@altfligs
+\newif\ifkp@eurosym
\newif\ifkp@germandbls
+\newif\ifkp@harfbuzz
\newif\ifkp@osn
\newif\ifkp@os
\newif\ifkp@vos
@@ -48,6 +50,8 @@
\DeclareOption{largesmallcaps} {\kp@largesmallcapstrue}
\DeclareOption{altfligs} {\kp@altfligstrue}
\DeclareOption{germandbls} {\kp@germandblstrue}
+\DeclareOption{eurosym} {\kp@eurosymtrue}
+\DeclareOption{harfbuzz} {\kp@harfbuzztrue}
% Math options
\DeclareOption{lightmath} {\kp@lightmathtrue}
\DeclareOption{bbsans} {\kp@sfmathbbtrue}
@@ -63,82 +67,28 @@
\kp@mathfalse}
\ProcessOptions
-% This is adapted from babel to concatenate font features.
+% This is adapted from babel to concatenate (rm & sf) font features.
\def\KP@addto#1#2{%
{\toks@\expandafter{#1,#2}%
\xdef#1{\the\toks@}}%
}
-\def\KP@options{Ligatures=TeX}
-
-\ifkp@symbols % true unless "nomath"
- \RequirePackage{unicode-math}[2019/01/01]
- % \D close integral
- \ifkp@Dcommand
- \newcommand*{\D}[1]{\mathclose{\,\symup{d}}#1}%
- \fi
-\fi
-% Loading Math fonts...
-\ifkp@math
- \ifkp@tight
- \thinmuskip=2mu
- \medmuskip=2.5mu plus 1mu minus 2.5mu
- \thickmuskip=3.5mu plus 2.5mu
- \fi
- \ifkp@lightmath
- \ifkp@calasscr
- \defaultfontfeatures+[KpMath-Light.otf]{RawFeature=+ss01}
- \fi
- \ifkp@sfmathbb
- \defaultfontfeatures+[KpMath-Light.otf]{RawFeature=+ss02}
- \fi
- \ifkp@narrowiints
- \defaultfontfeatures+[KpMath-Light.otf]{RawFeature=+ss03}
- \fi
- \ifkp@frenchstyle
- \defaultfontfeatures+[KpMath-Light.otf]{math-style=french}
- \fi
- \ifkp@osnm
- \defaultfontfeatures+[KpMath-Light.otf]{Numbers=Lowercase}
- \fi
- \ifkp@oldReIm
- \defaultfontfeatures+[KpMath-Light.otf]{RawFeature=+cv03}
- \fi
- \ifkp@partialup
- \defaultfontfeatures+[KpMath-Light.otf]{partial=upright}
- \fi
- \setmathfont{KpMath-Light.otf}
- \else
- \ifkp@calasscr
- \defaultfontfeatures+[KpMath-Regular.otf]{RawFeature=+ss01}
- \fi
- \ifkp@sfmathbb
- \defaultfontfeatures+[KpMath-Regular.otf]{RawFeature=+ss02}
- \fi
- \ifkp@narrowiints
- \defaultfontfeatures+[KpMath-Regular.otf]{RawFeature=+ss03}
- \fi
- \ifkp@frenchstyle
- \defaultfontfeatures+[KpMath-Regular.otf]{math-style=french}
- \fi
- \ifkp@osnm
- \defaultfontfeatures+[KpMath-Regular.otf]{Numbers=Lowercase}
- \fi
- \ifkp@oldReIm
- \defaultfontfeatures+[KpMath-Regular.otf]{RawFeature=+cv03}
- \fi
- \ifkp@partialup
- \defaultfontfeatures+[KpMath-Regular.otf]{partial=upright}
- \fi
- \setmathfont{KpMath-Regular.otf}
- \fi
-\fi
+\def\KP@Toptions{Ligatures=TeX}
+% Concatenation of Math options.
+\newtoks\KpMtoks
+\newcommand*{\Store@KP@MOption}[2]{%
+ \KpMtoks=\expandafter{\the\KpMtoks #1={#2},}}
% Loading Text fonts...
\ifkp@text
\RequirePackage{fontspec}[2019/01/01]
- % This needed with LuaTeX to typeset composed chars not ready-made
- % in the KPfonts (f.i. ċṅṁ plus āēīōūẽĕ in sans-serif).
- \ifluahbtex\defaultfontfeatures{Renderer=HarfBuzz}\fi
+ % Euro symbol
+ \newcommand*{\kp@euro}{\char"E990\relax}
+ \newcommand*{\kpeuro}[1][]{\def\@tmp{#1}%
+ \ifx\@tmp\@empty \kp@euro \else #1~\kp@euro\fi
+ }
+ % Option harfbuzz is needed with HBLuaTeX to typeset composed chars
+ % not ready-made in the KPfonts (f.i. ċṅṁ, ạẹịụọṃ,…).
+ \ifluahbtex\ifkp@harfbuzz\defaultfontfeatures+{Renderer=HarfBuzz}\fi\fi
% TS1 accent in Private Area
\DeclareUnicodeAccent{\newtie}{TU}{"E9F0}
% Accents not in tuenc.def
@@ -149,58 +99,65 @@
\ifkp@tt
\defaultfontfeatures+[\ttfamily]{Numbers=Lowercase}
\fi
- \KP@addto\KP@options{Numbers=Lowercase}
+ \KP@addto\KP@Toptions{Numbers=Lowercase}
\fi
%% Oldstyle
\ifkp@os
\ifkp@tt
\defaultfontfeatures+[\ttfamily]{Style=Swash}
\fi
- \KP@addto\KP@options{Style=Swash,Ligatures=Rare}
+ \KP@addto\KP@Toptions{Style=Swash,Ligatures=Rare}
\fi
%% Veryoldstyle
\ifkp@vos
\ifkp@tt
\defaultfontfeatures+[\ttfamily]{Style=Historic, Contextuals=Alternate}
\fi
- \KP@addto\KP@options{Style=Historic, Ligatures=Historic,
+ \KP@addto\KP@Toptions{Style=Historic, Ligatures=Historic,
Contextuals=Alternate}
\fi
% Smallcaps
\ifkp@largesmallcaps
- \KP@addto\KP@options{SmallCapsFeatures = {Letters=SmallCaps}}
+ \KP@addto\KP@Toptions{SmallCapsFeatures = {Letters=SmallCaps}}
\else
- \KP@addto\KP@options{SmallCapsFeatures = {Letters=PetiteCaps}}
+ \KP@addto\KP@Toptions{SmallCapsFeatures = {Letters=PetiteCaps}}
\fi
% Altfligs
\ifkp@altfligs
- \KP@addto\KP@options{StylisticSet=1}
+ \KP@addto\KP@Toptions{StylisticSet=1}
\fi
% Germandbls
\ifkp@germandbls
- \KP@addto\KP@options{StylisticSet=2}
+ \KP@addto\KP@Toptions{StylisticSet=2}
+ \fi
+ % Euro symbol
+ \ifkp@eurosym
+ \ifkp@tt
+ \defaultfontfeatures+[\ttfamily]{StylisticSet=3}
+ \fi
+ \KP@addto\KP@Toptions{StylisticSet=3}
\fi
% Text Serif fonts:
\ifkp@lighttext
- \setmainfont{KpLight}[\KP@options]
- \newfontface\Semibold{KpRoman-Regular.otf}[\KP@options]
- \newfontface\SemiboldItalic{KpRoman-Italic.otf}[\KP@options]
- \newfontface\Extrabold{KpRoman-Bold.otf}[\KP@options]
- \newfontface\ExtraboldItalic{KpRoman-BoldItalic.otf}[\KP@options]
+ \setmainfont{KpLight}[\KP@Toptions]
+ \newfontface\Semibold{KpRoman-Regular.otf}[\KP@Toptions]
+ \newfontface\SemiboldItalic{KpRoman-Italic.otf}[\KP@Toptions]
+ \newfontface\Extrabold{KpRoman-Bold.otf}[\KP@Toptions]
+ \newfontface\ExtraboldItalic{KpRoman-BoldItalic.otf}[\KP@Toptions]
\DeclareTextFontCommand{\textsb}{\Semibold}
\DeclareTextFontCommand{\texteb}{\Extrabold}
\else
- \setmainfont{KpRoman}[\KP@options]
- \newfontface\Light{KpRoman-Light.otf}[\KP@options]
- \newfontface\LightItalic {KpRoman-LightItalic.otf}[\KP@options]
- \newfontface\Semibold{KpRoman-Semibold.otf}[\KP@options]
- \newfontface\SemiboldItalic{KpRoman-SemiboldItalic.otf}[\KP@options]
+ \setmainfont{KpRoman}[\KP@Toptions]
+ \newfontface\Light{KpRoman-Light.otf}[\KP@Toptions]
+ \newfontface\LightItalic {KpRoman-LightItalic.otf}[\KP@Toptions]
+ \newfontface\Semibold{KpRoman-Semibold.otf}[\KP@Toptions]
+ \newfontface\SemiboldItalic{KpRoman-SemiboldItalic.otf}[\KP@Toptions]
\DeclareTextFontCommand{\textsb}{\Semibold}
\DeclareTextFontCommand{\textlt}{\Light}
\fi
% Text Sans Serif fonts:
\ifkp@sf
- \setsansfont{KpSans}[\KP@options]
+ \setsansfont{KpSans}[\KP@Toptions]
\fi
% Text Typewriter fonts:
\ifkp@tt
@@ -213,8 +170,72 @@
\DeclareRobustCommand\textpsc[1]{{\pscshape #1}}
\fi
+\ifkp@symbols % true unless "nomath"
+ \RequirePackage{unicode-math}[2019/01/01]
+ % \D close integral
+ \ifkp@Dcommand
+ \newcommand*{\D}[1]{\mathclose{\,\symup{d}}#1}%
+ \fi
+\fi
+
+% Loading Math fonts...
+\ifkp@math
+ \ifkp@tight
+ \thinmuskip=2mu
+ \medmuskip=2.5mu plus 1mu minus 2.5mu
+ \thickmuskip=3.5mu plus 2.5mu
+ \fi
+ \ifkp@lightmath
+ \ifkp@calasscr
+ \Store@KP@MOption{RawFeature}{+ss01}
+ \fi
+ \ifkp@sfmathbb
+ \Store@KP@MOption{RawFeature}{+ss02}
+ \fi
+ \ifkp@narrowiints
+ \Store@KP@MOption{RawFeature}{+ss03}
+ \fi
+ \ifkp@osnm
+ \Store@KP@MOption{Numbers}{Lowercase}
+ \fi
+ \ifkp@oldReIm
+ \Store@KP@MOption{RawFeature}{+cv00}
+ \fi
+ \ifkp@frenchstyle
+ \Store@KP@MOption{math-style}{french}
+ \fi
+ \ifkp@partialup
+ \Store@KP@MOption{partial}{upright}
+ \fi
+ \expandafter\setmathfont\expandafter[\the\KpMtoks]{KpMath-Light.otf}
+ \else
+ \ifkp@calasscr
+ \Store@KP@MOption{RawFeature}{+ss01}
+ \fi
+ \ifkp@sfmathbb
+ \Store@KP@MOption{RawFeature}{+ss02}
+ \fi
+ \ifkp@narrowiints
+ \Store@KP@MOption{RawFeature}{+ss03}
+ \fi
+ \ifkp@osnm
+ \Store@KP@MOption{Numbers}{Lowercase}
+ \fi
+ \ifkp@oldReIm
+ \Store@KP@MOption{RawFeature}{+cv00}
+ \fi
+ \ifkp@frenchstyle
+ \Store@KP@MOption{math-style}{french}
+ \fi
+ \ifkp@partialup
+ \Store@KP@MOption{partial}{upright}
+ \fi
+ \expandafter\setmathfont\expandafter[\the\KpMtoks]{KpMath-Regular.otf}
+ \fi
+\fi
+
\ifkp@symbols
- % Style aliases
+ % Style aliases (math only)
\newopentypefeature{Style}{mathcal}{ss01}
\newopentypefeature{Style}{bbsans}{ss02}
\newopentypefeature{Style}{narrowiints}{ss03}