summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/hindmadurai/HindMadurai.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-01-09 21:29:09 +0000
committerKarl Berry <karl@freefriends.org>2021-01-09 21:29:09 +0000
commitaf2eb5865018765eca9a73759eebf200dabd9507 (patch)
tree9e6d8e7d2fea3cb226c645e2b830439cf2fdec49 /Master/texmf-dist/tex/latex/hindmadurai/HindMadurai.sty
parentb23602e101819ca74e345a687f1e3cddf4bc8853 (diff)
hindmadurai (9jan21)
git-svn-id: svn://tug.org/texlive/trunk@57360 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/hindmadurai/HindMadurai.sty')
-rw-r--r--Master/texmf-dist/tex/latex/hindmadurai/HindMadurai.sty52
1 files changed, 52 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/hindmadurai/HindMadurai.sty b/Master/texmf-dist/tex/latex/hindmadurai/HindMadurai.sty
new file mode 100644
index 00000000000..5d8647af3f4
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/hindmadurai/HindMadurai.sty
@@ -0,0 +1,52 @@
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{HindMadurai}
+ [2021/01/09 (Carl-Clemens Ebinger & autoinst) Style file for HindMadurai fonts.]
+
+\RequirePackage{xkeyval}
+\newcommand*{\HindMadurai@scale}{1}
+\DeclareOptionX{scale}{\renewcommand*{\HindMadurai@scale}{#1}}
+\DeclareOptionX{scaled}{\renewcommand*{\HindMadurai@scale}{#1}}
+
+\DeclareOptionX{lining}{\edef\HindMadurai@figurestyle{LF}}
+\DeclareOptionX{tabular}{\edef\HindMadurai@figurealign{T}}
+\DeclareOptionX{mainfont}{
+ \renewcommand{\familydefault}{\rmdefault}
+}
+\DeclareOptionX{semibold}{\edef\bfseries@rm{semibold}}
+\DeclareOptionX{bold}{\edef\bfseries@rm{bold}}
+\DeclareOptionX{medium}{\edef\mdseries@rm{medium}}
+\DeclareOptionX{regular}{\edef\mdseries@rm{regular}}
+\ExecuteOptionsX{lining,tabular}
+\ProcessOptionsX\relax
+
+\RequirePackage{fontenc,textcomp}
+\RequirePackage{ifthen}
+\RequirePackage{mweights}
+
+\IfFileExists{fontaxes.sty}{
+ \RequirePackage{fontaxes}
+}{}
+
+% Here we implement the scale=MatchLowercase option.
+% If this is given, we must compute the correct value of
+% the "\HindMadurai@scale" parameter before loading the .fd files;
+% but to determine that value we of course need the font's x-height.
+% To avoid triggering the loading of .fd files,
+% we use plain TeX's \font primitive to load the testfont.
+% We then compute the ratio of the current x-height to our font's x-height;
+% this is the "\HindMadurai@scale" we will pass to the .fd files.
+\ifthenelse{\equal{\HindMadurai@scale}{MatchLowercase}}
+ { \newlength{\HindMadurai@currentx}
+ \settoheight{\HindMadurai@currentx}{x}
+ \newlength{\HindMadurai@xheight}
+ \settoheight{\HindMadurai@xheight}
+ {{\font\testfont=HindMadurai-Regular-tlf-ot1 at \f@size pt\testfont x}}
+ \renewcommand*{\HindMadurai@scale}
+ {\strip@pt\dimexpr\number\numexpr\number\dimexpr\HindMadurai@currentx\relax*65536/\number\dimexpr\HindMadurai@xheight\relax\relax sp\relax}}
+ {}
+
+\renewcommand*
+ {\rmdefault}
+ {HindMadurai-\HindMadurai@figurealign\HindMadurai@figurestyle}
+
+\endinput