summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/fontsetup/fspgfsdidotot.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-12-20 22:21:32 +0000
committerKarl Berry <karl@freefriends.org>2019-12-20 22:21:32 +0000
commitf27cb1d537a34677b1291d5365c80cde1416417c (patch)
tree0e2d0e89e70b388b3f45fe8e81491a09cdca51e8 /Master/texmf-dist/tex/latex/fontsetup/fspgfsdidotot.sty
parent42fff9c15d299e41425b1aef482186e3cd2f4d9a (diff)
fontsetup (20dec19)
git-svn-id: svn://tug.org/texlive/trunk@53195 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/fontsetup/fspgfsdidotot.sty')
-rw-r--r--Master/texmf-dist/tex/latex/fontsetup/fspgfsdidotot.sty49
1 files changed, 49 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/fontsetup/fspgfsdidotot.sty b/Master/texmf-dist/tex/latex/fontsetup/fspgfsdidotot.sty
new file mode 100644
index 00000000000..6de2cfd7366
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/fontsetup/fspgfsdidotot.sty
@@ -0,0 +1,49 @@
+
+\RequirePackage{fontspec}
+
+\setmainfont[ItalicFont=GFSOlga,
+ BoldFont=GFSDidotBold,
+ BoldItalicFont=GFSDidotBoldItalic,SlantedFont=GFSDidotItalic,
+ SmallCapsFeatures={Numbers=OldStyle}]{GFSDidot.otf}
+\newfontfamily{\GFSDidotoSubstFont}[%
+ ItalicFont=GFSDidotItalic,
+ BoldFont=GFSDidotBold,
+ BoldItalicFont=GFSDidotBoldItalic,
+ SmallCapsFeatures={Numbers=OldStyle}]{GFSDidot.otf}
+
+
+\RequirePackage{unicode-math}
+%\setmathfont{XITSMath-Regular.otf}
+\setmathfont{STIX2Math.otf}
+\setmathfont[range=\mathup/{num,latin,Latin,greek,Greek}]{GFSDidot.otf}
+\setmathfont[range=\mathbfup/{num,latin,Latin,greek,Greek}]{GFSDidotBold.otf}
+\setmathfont[range=\mathit/{greek,Greek}]{GFSOlga.otf}
+\setmathfont[range=\mathit/{num,latin,Latin}]{GFSDidotItalic.otf}
+\setmathfont[range=\mathbfit/{num,latin,Latin,greek,Greek}]{GFSDidotBoldItalic.otf}
+
+%% the next code replaces non-existent Olga Latin with GFSDidotItalic Latin
+\XeTeXinterchartokenstate=1%
+\newXeTeXintercharclass\GFSDidotoSubst%
+\count255="0021%
+\loop\ifnum\count255<"0341%
+ \XeTeXcharclass\count255=\GFSDidotoSubst%
+ \advance\count255 by 1%
+\repeat%
+\XeTeXinterchartoks 0 \GFSDidotoSubst = {\begingroup\GFSDidotoSubstFont}%
+\XeTeXinterchartoks 4095 \GFSDidotoSubst = {\begingroup\GFSDidotoSubstFont}%
+\XeTeXinterchartoks \GFSDidotoSubst 0 = {\endgroup}%
+\XeTeXinterchartoks \GFSDidotoSubst 4095 = {\endgroup}%
+%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%% Fix epsilons %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\AtBeginDocument{\renewcommand{\epsilon}{\textit{ε}}
+\renewcommand{\varepsilon}{\textsl{ε}}}
+%%%%%%%%% Fix phi %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\newfontfamily\phifix[Scale=1.2]{GFSDidotItalic.otf}
+\AtBeginDocument{\renewcommand{\phi}{\textrm{\phifix\char"03D5}}}
+%%%%%%%%% Fix theta %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\AtBeginDocument{\renewcommand{\theta}{\textsl{θ}}
+\renewcommand{\vartheta}{\textit{θ}}}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\endinput