X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw-ofs.tex;h=5fae70d599b971cb4f8498099c45c61a55f46e9b;hb=refs%2Fheads%2Fmaster;hp=7d33a882e0259b870ddef630ab04d9ddb50ec4cc;hpb=3b3af3ae6bed74cdcf1681ad41a45e0c32391fb4;p=ucwmac.git diff --git a/ucw-ofs.tex b/ucw-ofs.tex index 7d33a88..5fae70d 100644 --- a/ucw-ofs.tex +++ b/ucw-ofs.tex @@ -2,9 +2,12 @@ % Written by Martin Mares in 2010 and placed into public domain % ------------------------------------------------------------------------- +\ucwdefmodule{ofs} + \ifx\OFSversion\undefined \input ofs.tex % \detailfontmessages +\nofontmessages \fi % We extend OFS's default CM family by several fonts: cmb, cmcsc @@ -68,29 +71,33 @@ \newfam\bbfam \def\bb{\fam\bbfam} -\def\loadbbm{ - \loadmathfam\bbfam[/bbm] +\def\loadbbm{% + \loadmathfam\bbfam[/bbm]% } \loadbbm % Recalculate line spacing for a given point size of the font (assuming CM-like metrics). % Also sets \strut and \topskip. -\def\setbaselines#1{ +\def\setbaselines#1{% \dimen0=1pt \dimen0=#1\dimen0 \normalbaselineskip=1.2\dimen0 \normallineskip=0.1\dimen0 - \setbox\strutbox=\hbox{\vrule height 0.85\dimen0 depth 0.35\dimen0 width 0pt} + \setbox\strutbox=\hbox{\vrule height 0.85\dimen0 depth 0.35\dimen0 width 0pt}% \topskip=1\dimen0 \normalbaselines } % Switch to a specified font size (including math, line spacing etc.) -\def\settextsize#1{ - \def\fomenc{CM} - \setfonts[/#1] - \setmath[//] - \setbaselines{#1} +\def\settextsize#1{% + \def\fomenc{CM}% + \setfonts[/#1]% + \setmath[//]% + \setbaselines{#1}% \loadbbm } \def\twelvepoint{\settextsize{12}} + +% Re-define \tt, so that it works in both text and math mode +\loadmathfam\ttfam[/cmtt\fotenc] +\def\tt{\ifmmode\fam\ttfam\else\setfonts[CMTypewriter/]\fi}