summaryrefslogtreecommitdiff
path: root/fonts/erewhon-math/fourier-otf.sty
diff options
context:
space:
mode:
Diffstat (limited to 'fonts/erewhon-math/fourier-otf.sty')
-rw-r--r--fonts/erewhon-math/fourier-otf.sty100
1 files changed, 76 insertions, 24 deletions
diff --git a/fonts/erewhon-math/fourier-otf.sty b/fonts/erewhon-math/fourier-otf.sty
index b6df0ae57a..b43e11a0bf 100644
--- a/fonts/erewhon-math/fourier-otf.sty
+++ b/fonts/erewhon-math/fourier-otf.sty
@@ -1,7 +1,7 @@
\NeedsTeXFormat{LaTeX2e}[2018/01/01]
-\def\fileversion{0.45}%
-\def\filedate{2021/04/18}%
- \ProvidesPackage{fourier-otf}[\filedate\space\fileversion]
+\def\fileversion{0.47}
+\def\filedate{2021/09/16}
+\ProvidesPackage{fourier-otf}[\filedate\space\fileversion]
% Ensure luatex or xetex engine
\RequirePackage{iftex}[2019/10/24]
@@ -14,10 +14,14 @@
\newopentypefeature{Style}{subsetneq}{ss06}
\newopentypefeature{Style}{parallelslant}{ss07}
-% Options: forward them to \setmathfont except "tight" and "loose"
+% Options: forward them to \setmathfont except "tight", "loose" and "no-text".
\RequirePackage{xkeyval}
-\newtoks\FOTtoks
+\newtoks\FOTtoksT
+\newtoks\FOTtoksM
+
\newif\ifFOT@tight
+\newif\ifFOT@notext
+\DeclareOptionX{no-text}{\FOT@notexttrue}
\DeclareOptionX{tight}{\FOT@tighttrue}
\DeclareOptionX{loose}{\FOT@tightfalse}
\DeclareOptionX{math-style}{\Store@KV@Option{math-style}{#1}}
@@ -27,28 +31,63 @@
\DeclareOptionX{CharacterVariant}{\Store@KV@Option{CharacterVariant}{#1}}
\DeclareOptionX{StylisticSet}{\Store@KV@Option{StylisticSet}{#1}}
\DeclareOptionX{Style}{\Store@KV@Option{Style}{#1}}
+\DeclareOptionX{Scale}{\Store@KV@Option{Scale}{#1}}
\newcommand*{\Store@KV@Option}[2]{%
- \FOTtoks=\expandafter{\the\FOTtoks #1={#2},}}
+ \def\FOT@scale{Scale}\def\FOT@opt{#1}%
+ \ifx\FOT@opt\FOT@scale\FOTtoksT={Scale={#2}}\fi
+ \FOTtoksM=\expandafter{\the\FOTtoksM #1={#2},}}
\ExecuteOptionsX{tight}
\ProcessOptionsX
-\expandafter\setmathfont\expandafter[\the\FOTtoks]{Erewhon-Math.otf}
+% Math fonts: Erewhon-Math
+% Following Joseph Wright in https://tex.stackexchange.com/questions/451
+\begingroup
+ \edef\temp{%
+ \endgroup
+ \noexpand\setmathfont{Erewhon-Math.otf}%
+ [\unexpanded\expandafter{\the\FOTtoksM}]%
+ }
+ \temp
\ifFOT@tight
\thinmuskip=2mu
\medmuskip=2.5mu plus 1mu minus 2.5mu
\thickmuskip=3.5mu plus 2.5mu
\fi
-% Text Serif fonts: Erewhon
-\setmainfont{Erewhon}[
- Extension = .otf,
- UprightFont = *-Regular,
- BoldFont = *-Bold,
- ItalicFont = *-Italic,
- BoldItalicFont = *-BoldItalic,
- SlantedFont = *-RegularSlanted,
- BoldSlantedFont = *-BoldSlanted
- ]
-% Text Sans Serif fonts: lmss (default)
-% Text Typewriter fonts: lmtt (default)
+% Text Serif fonts.
+\ifFOT@notext
+\else
+ %Text Serif fonts: Erewhon
+ \begingroup
+ \defaultfontfeatures[Erewhon]
+ {Extension = .otf ,
+ UprightFont = *-Regular,
+ BoldFont = *-Bold,
+ ItalicFont = *-Italic,
+ BoldItalicFont = *-BoldItalic,
+ SlantedFont = *-RegularSlanted,
+ BoldSlantedFont = *-BoldSlanted}
+ \edef\temp{%
+ \endgroup
+ \noexpand\setmainfont{Erewhon}%
+ [\unexpanded\expandafter{\the\FOTtoksT}]%
+ }
+ \temp
+\fi
+% Enable FourierOrns' scaling anyway.
+\begingroup
+ \defaultfontfeatures[FourierOrns]
+ {Extension = .otf ,
+ UprightFont = *-Regular,
+ BoldFont = *-Bold,
+ ItalicFont = *-Italic,
+ BoldItalicFont = *-BoldItalic}
+ \edef\temp{%
+ \endgroup
+ \noexpand\renewfontfamily\FourierOrns{FourierOrns}%
+ [\unexpanded\expandafter{\the\FOTtoksT}]%
+ }
+ \temp
+% Text Sans Serif fonts: default (lmss unless specified)
+% Text Typewriter fonts: default (lmtt unless specified)
\AtBeginDocument{%
% Fourier specific math
@@ -60,9 +99,22 @@
\Umathchardef\mbfvarpartial = 0 0 "E040 \relax
\Umathchardef\mbfvarvarrho = 0 0 "E041 \relax
\Umathchardef\mbfvarvarpi = 0 0 "E042 \relax
+ \Umathchardef\mbfvec = 0 0 "E044 \relax
+ \Umathchardef\mbfwp = 0 0 "E045 \relax
+ \Umathchardef\mbfdotlessi = 0 0 "E046 \relax
+ \Umathchardef\mbfdotlessj = 0 0 "E047 \relax
+ \Umathchardef\mbfhbar = 0 0 "E048 \relax
+ \Umathchardef\mbfell = 0 0 "E049 \relax
+ \Umathchardef\mbftriangleleft = 0 0 "E04E \relax
+ \Umathchardef\mbftriangleright = 0 0 "E04F \relax
\Umathchardef\mbfitvarpartial = 0 0 "E060 \relax
\Umathchardef\mbfitvarvarrho = 0 0 "E061 \relax
\Umathchardef\mbfitvarvarpi = 0 0 "E062 \relax
+ \Umathchardef\mbfitwp = 0 0 "E065 \relax
+ \Umathchardef\mbfimath = 0 0 "E066 \relax
+ \Umathchardef\mbfjmath = 0 0 "E067 \relax
+ \Umathchardef\mbfithbar = 0 0 "E068 \relax
+ \Umathchardef\mbfitell = 0 0 "E069 \relax
\Umathchardef\mitvarpartial = 0 0 "E070 \relax
\Umathchardef\mitvarvarrho = 0 0 "E071 \relax
\Umathchardef\mitvarvarpi = 0 0 "E072 \relax
@@ -95,7 +147,7 @@
Reported}%
}%
{% AMS Symbols not referenced in unicode-math-table.tex
- % \Umathchardef\sum = <math type> <family> <slot>
+ % \Umathchardef\<cmd> = <math type> <family> <slot>
% <math type> : \mathord=0 \mathrel=3 ; <family>=0
\Umathchardef\circledR = 0 0 "24C7 \relax
\Umathchardef\circledS = 0 0 "24C8 \relax
@@ -117,7 +169,7 @@
\Umathchardef\ngeqq = 3 0 "E0AB \relax
\Umathchardef\npreceq = 3 0 "E098 \relax
\Umathchardef\nsucceq = 3 0 "E099 \relax
- \let\centerdot\cdotp % vysmblksquare ?
+ \let\centerdot\cdotp
\let\restriction\upharpoonright
\let\doteqdot\Doteq
\let\doublecup\Cup
@@ -126,8 +178,8 @@
\let\gggtr\ggg
\let\circlearrowleft\acwopencirclearrow
\let\circlearrowright\cwopencirclearrow
- \let\lozenge\diamondsuit
- \let\blacklozenge\vardiamondsuit
+ \let\lozenge\mdlgwhtlozenge
+ \let\blacklozenge\mdlgblklozenge
\let\square\mdlgwhtsquare
\let\blacksquare\mdlgblksquare
\let\dashleftarrow\leftdasharrow
@@ -152,7 +204,7 @@
\let\unlhd\trianglelefteq
\let\unrhd\trianglerighteq
\let\leadsto\rightcurvedarrow
- \let\Box\mdlgwhtsquare
+ \let\Box\lgwhtsquare
\let\Diamond\mdlgwhtdiamond
}%
}