summaryrefslogtreecommitdiff
path: root/fonts/etbb/tex/ETbb.sty
diff options
context:
space:
mode:
Diffstat (limited to 'fonts/etbb/tex/ETbb.sty')
-rw-r--r--fonts/etbb/tex/ETbb.sty48
1 files changed, 40 insertions, 8 deletions
diff --git a/fonts/etbb/tex/ETbb.sty b/fonts/etbb/tex/ETbb.sty
index d08e27032b..476ee84a82 100644
--- a/fonts/etbb/tex/ETbb.sty
+++ b/fonts/etbb/tex/ETbb.sty
@@ -1,7 +1,7 @@
%%
\NeedsTeXFormat{LaTeX2e}
-\def\fileversion{1.01}
-\def\filedate{2020/05/03}
+\def\fileversion{1.04}
+\def\filedate{2020/06/27}
\ProvidesPackage{ETbb}
[\filedate\space v\fileversion. Style file for ETbb.]
@@ -9,6 +9,7 @@
\RequirePackage[full]{textcomp}
\RequirePackage{ifetex}
\ifetex\RequirePackage{etoolbox}\fi %etoolbox loads etex.sty
+\RequirePackage{xstring,ifthen} % for \textfrac
\IfFileExists{mweights.sty}{\RequirePackage{mweights}}{}
\IfFileExists{fontaxes.sty}{
\RequirePackage{fontaxes}
@@ -25,10 +26,41 @@
\fontfigurestyle{inferior}\selectfont}
\DeclareTextFontCommand{\textin}{\infigures}
\let\textinferior\textin
- \providecommand*{\textfrac}[3][\ETbb@raisefrac]{%
- \raise ##1 \hbox{\textsu{##2}\kern \ETbb@foresolidus \textfractionsolidus\kern \ETbb@aftsolidus \textin{##3}}}
-
+% \providecommand*{\textfrac}[3][\ETbb@raisefrac]{%
+% \raise ##1 \hbox{\textsu{##2}\kern \ETbb@foresolidus \textfractionsolidus\kern \ETbb@aftsolidus \textin{##3}}}
}{}
+\def\textde#1{\leavevmode\raise .112em \hbox{\textin{#1}}} % aligned with baseline
+\newcommand{\textfrac}[3][]{% like \textfrac[1]{7}{8}
+ \mbox{%
+ \ifthenelse{\not\equal{#1}{}}%Test for integer portion [optional #1]
+ {\textlf{#1}\kern.05em}{}%
+ \textsu{#2}% numerator
+ \StrRight{#2}{1}[\@digit@]%
+ % look for 1, 2, 3, 4, 7
+ \ifcase\@digit@% 0
+ \or% 1
+ \or\kern.03em% 2
+ \or\kern-.02em% 3
+ \or\kern-.01em% 4
+ \or\kern.01em% 5
+ \or\kern.02em% 6
+ \or\kern-.09em% 7
+ \fi%
+ \kern\ETbb@foresolidus\textfractionsolidus\kern\ETbb@aftsolidus%
+ \StrLeft{#3}{1}[\@digit@]%
+ % look for 1, 4, 5, 7
+ \ifcase\@digit@% 0
+ \or\kern -.02em% 1
+ \or\kern .01em% 2
+ \or\kern -.02em% 3
+ \or\kern -.08em% 4
+ \or\kern -.01em% 5
+ \or\kern -.03em% 6
+ \or\kern .04em% 7
+ \fi%
+ \textde{#3}% denominator [#3]
+ }%
+}
\IfFileExists{xkeyval.sty}{
\newcommand*{\ETbb@scale}{1}
@@ -51,9 +83,9 @@
\newif\if@ETbb@sharpS
\newif\if@ETbb@sups
\newif\if@ETbb@scosf
-\def\ETbb@foresolidus{-.03em}
-\def\ETbb@aftsolidus{.02em}
-\def\ETbb@raisefrac{.111em}
+\def\ETbb@foresolidus{-.04em}
+\def\ETbb@aftsolidus{-.03em}
+\def\ETbb@raisefrac{.112em}
\DeclareOptionX{foresolidus}{\gdef\ETbb@foresolidus{#1}}
\DeclareOptionX{aftsolidus}{\gdef\ETbb@aftsolidus{#1}}
\DeclareOptionX{raisefrac}{\gdef\ETbb@raisefrac{#1}}