diff options
author | Karl Berry <karl@freefriends.org> | 2014-10-02 22:37:13 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-10-02 22:37:13 +0000 |
commit | 57641fb7736fa7dfb82f596d9cac992db6651895 (patch) | |
tree | 7519dedbe553cc6c418fa709d96b5e25fd9a9381 /Master/texmf-dist/source/fonts/drm | |
parent | f28d6db58747245c798b3e77ac8a8871b9190095 (diff) |
drm (2oct14)
git-svn-id: svn://tug.org/texlive/trunk@35300 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/fonts/drm')
-rw-r--r-- | Master/texmf-dist/source/fonts/drm/drm.dtx | 652 |
1 files changed, 579 insertions, 73 deletions
diff --git a/Master/texmf-dist/source/fonts/drm/drm.dtx b/Master/texmf-dist/source/fonts/drm/drm.dtx index 4809973fe84..80a6e503b91 100644 --- a/Master/texmf-dist/source/fonts/drm/drm.dtx +++ b/Master/texmf-dist/source/fonts/drm/drm.dtx @@ -24,11 +24,12 @@ % \iffalse %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] -%<package>\ProvidesPackage{drm}[2015/01/01 v2.2 support for dozenal fonts] +%<package>\ProvidesPackage{drm}[2015/01/01 v3.0 support for dozenal fonts] %<*driver> \documentclass{ltxdoc} \usepackage[absolute]{textpos} +\usepackage{parcolumns} \usepackage{doc} \usepackage{array} \usepackage{lettrine} @@ -44,7 +45,7 @@ \usepackage[greek,english]{babel} \languageattribute{greek}{polutoniko} \usepackage[colorlinks]{hyperref} -\usepackage[]{drm} +\usepackage[typeone]{drm} \usepackage{makeidx} \EnableCrossrefs \PageIndex @@ -70,7 +71,7 @@ \ifnodefaultmath,\fi,\ifsymbolsonly,\fi,\newlength, \counterA,\counterB,\newcount,\r@@t,\z@,\DeclareMathRadical, \DeclareRobustCommand,\bBigg@,\@ifnextchar,\@sqrt,\@makefnmark, - \@thefnmark} + \@thefnmark,\catcode,\active,\Q} \begin{document} \DocInput{drm.dtx} @@ -78,7 +79,7 @@ %</driver> % \fi % -% \title{The \texttt{drm} Font Package, v2.2} +% \title{The \texttt{drm} Font Package, v3.0} % \author{Donald P.\ Goodman III} % \date{\today} % @@ -96,7 +97,9 @@ % inferior figures. It also comes with extensible % decorative rules to be used with ornaments from itself or % other fonts, along with an extremely flexible ellipsis -% package. A set of decorative initials is planned. +% package. Decorative initials are also provided by means +% of \MP\ macros and superimposed figures; these are +% flexible in color, size, and style. % \end{abstract} % % \tableofcontents @@ -206,6 +209,13 @@ % what defaults it resets. % % \begin{description} +% \item[typeone] \DescribeMacro{typeone}The |typeone| +% option will probably be used most of the time that |drm| +% itself is used; it forces |drm| to use un-rasterized +% outlines rather than bitmapped pk files, letting the pdf +% viewer do the rendering. Given that most pdf viewers have +% an awfully hard time decently displaying prerendered +% bitmap fonts, the |typeone| option will often be useful. % \item[nodefault] \DescribeMacro{nodefault}The |nodefault| % option means that |drm| will not change any of the % defaults of the document; that is, loading |drm| with the @@ -370,6 +380,34 @@ % \end{center} % \end{table} % +% \subsection{Alternate Glyphs} +% +% While this section is titled in the plural, there is at +% present only one such: +% \DescribeMacro{\drmshortq}|\drmshortq|, which gives us +% ``\drmshortq'' rather than ``Q.'' This is mostly useful +% for situations in which the ``Q'' is followed by some +% character with a descender (say, ``\drmshortq p'' as +% opposed to ``Qp''), or when it is being used as a dropped +% capital and the extended tail would overwrite the text. +% (An enlarged dropped capital might have a tail +% underscoring the entire paragraph, which might actually +% look attractive.) +% +% If for some reason you'd like to use ``\drmshortq'' all +% the time, and consign the admittedly somewhat baroque +% ``Q'' to the dustbin, you can do so by issuing the +% following commands: +% +% \begin{center} +% |\catcode`\Q=\active\def Q{\drmshortq}| +% \end{center} +% +% Note that this involves some deep \TeX\ magic, and command +% names containing the character ``Q'' will be broken by +% this. Fortunately, such commands are few and far between; +% |drm| does not contain any. +% % \subsection{Font Families} % % DRM contains a full set of the normal font families you'd @@ -615,8 +653,8 @@ % have a real italic, but occasionally does find its uses in % full-featured fonts. % -% Often, non-typographers think that italic type is simply -% normal type slanted a little to the right, but that's not +% Non-typographers often think that italic type is simply +% normal type slanted to the right, but that's not % really the case. A comparison is given in Table % \ref{tab:slantedtypes}. % @@ -1544,6 +1582,163 @@ % So once in a while, we might actually be able to use this % feature for something other than its novelty value. % +% \subsubsection{Decorative Initials} +% \label{subsub:decorinit} +% +% DRM, as of v3.0, provides for decorative initials. These +% are not traditional decorative initials, however, with +% intricate patterns provided individually for each letter. +% They are, rather, formed with a single background pattern, +% with the necessary letter superimposed. The goal is to +% make the background pattern interchangeable. The color of +% that background pattern and the color of the foreground +% letter can be controlled separately. Despite the single +% background pattern, therefore, this provides for a +% remarkable degree of flexibility. +% +% \DescribeMacro{\drmdecinit}|\drmdecinit| is the name of +% the game here, a command which takes five arguments, all +% of which are mandatory. +% +% \begin{center} +% \cmd{\drmdecinit} \marg{width} \marg{height} +% \marg{bgcolor} \marg{fgcolor} \marg{fgchar} +% \end{center} +% +% These are largely self-explanatory, so a few examples will +% likely do. Note that |drm| uses the excellent |gmp| +% package to get the \MP\ code to be part of the \LaTeX\ +% code, allowing \LaTeX\ to control significant parts of the +% formatting. This means that one will have to run a shell +% script along with compiling the document, similarly to +% |bibtex|, |makeindex|, or a host of others. +% +% \begin{parcolumns}{2} +% \colchunk[1]{ +% \begin{spverbatim}\lettrine[lines=4,noindent=0pt, +% findent=-1em]{\drmdecinit{40pt} +% {40pt}{blue}{(.625,0,0)}{L}}{orem +% ipsum}\end{spverbatim}}\colchunk[2]{ +% \raggedright\begin{spverbatim}\lettrine[lines=4,noindent=0pt, +% findent=-1em]{\drmdecinit{40pt} +% {40pt}{blue}{red}{L}}{orem ipsum}\end{spverbatim}}\end{parcolumns} +% \begin{parcolumns}{2} +% \colchunk[1]{ +% \lettrine[lines=4, findent=-1em,nindent=0pt] +% {\drmdecinit{40pt}{40pt}{blue}{(.625,0,0)}{L}}{orem ipsum} +% dolor sit amet, consectetur adipiscing elit. Ut porttitor +% libero lacus, a rhoncus dolor finibus vel. Morbi +% volputate condimentum orna\-re. In scelerisque +% aliquam\drmfelip +% }\colchunk[2]{ +% \lettrine[lines=4,nindent=0pt,findent=-1em] +% {\drmdecinit{40pt}{40pt}{blue}{red}{L}}{orem ipsum} +% dolor sit amet, consectetur adipiscing elit. Ut porttitor +% libero lacus, a rhoncus dolor finibus vel. Morbi +% volputate condimentum orna\-re. In scelerisque +% aliquam\drmfelip +% }\end{parcolumns} +% +% \vskip\baselineskip +% The colors are \MP\ colors; unfortunately, this means that +% we can use only ``black,'' ``white,'' ``red,'' ``green,'' +% and ``blue'' by name. However, any valid \MP\ color +% specification will work. In the example above, for +% example, to get a darker red, one could use |.4red|, or +% one could specify colors in RGB notation, as shown above +% on the left. Note that, when doing this latter, the +% parentheses are necessary. +% +% These decorative initials lend themselves to some other, +% sometimes unexpected, uses. For example, decorative +% enumerates. It is best to use lining figures rather than +% textual figures for this. +% +% DRM offers the command +% \DescribeMacro{\drmdecinitfont}|\drmdecinitfont|, which is +% the font which DRM uses for the decorative initials. Because +% of the internals of the |gmp| package, the simple name of +% the font can't be inserted here; it must be defined in a +% particular way. The default is, of course, to use DRM, +% and is defined thus: +% +% \begin{spverbatim} +% \def\drmdecinitfont{\unexpanded{\font\drminitfontcom=drm10}}% +% \end{spverbatim} +% +% In other words, one must define the fonts in the +% old-fashioned \TeX\ way. The above is the default; so +% whenever you've changed it for some reason, you can get it +% back to the above by entering +% \DescribeMacro{\drmdecinitfontdefault}|\drmdecinitfontdefault|; +% this simply restores the default definition as given +% above. +% +% For the ornate enumerations, we can simply redefine +% |\drmdecinitfont| to use the lining figures from |drmsym|, +% which conveniently are located at precisely the code +% points that one would expect them. Simply issue: +% +% \begin{quote}\begin{spverbatim} +% \def\drmdecinitfont{\unexpanded{\font\drminitfontcom=drmsym10} %}% +% \renewcommand{\labelenumi}{% +% \drmdecinit{14pt}{14pt}{blue}{red}{\theenumi}} +% \end{spverbatim}\end{quote} +% +% This redefines |\drmdecinitfont| to use |drmsym| rather +% than simply |drm|, then redefines the enumerate labels to +% be DRM decorative initials, resulting in the following: +% +%\def\drmdecinitfont{\unexpanded{\font\drminitfontcom=drmsym10} %}% +% \renewcommand{\labelenumi}{% +% \drmdecinit{14pt}{14pt}{blue}{red}{\theenumi}} +% \begin{quote} +% \begin{enumerate} +% \item The first item. +% \item The second item. +% \end{enumerate} +% \end{quote} +% \drmdecinitfontdefault +% +% \renewcommand{\labelenumi}{\theenumi.} +% Any character whatever can be used this way, provided that +% the font is correctly selected. Doubtlessly many creative +% uses for this ability will be found. +% +% One trick, almost necessary when using these on any +% significant scale, is a macro to make them less typing. +% For example, to use them as four-line lettrines using +% Daniel Flipo's excellent |lettrine| package: +% +% \def\declettrine#1#2{% +% \lettrine[lines=4,nindent=0pt,findent=-1em]% +% {\drmdecinit{40pt}{40pt}{blue}{red}{#1}}{#2}% +% }% +% \begin{spverbatim} +% \def\declettrine#1#2{% +% \lettrine[lines=4,nindent=0pt,findent=-1em]% +% {\drmdecinit{40pt}{40pt}{blue}{red}{#1}}{#2}% +% }% +% \end{spverbatim} +% +% Rather than having to type the whole of the above each +% time now, one can do it in a more natural manner: +% +% \begin{center} +% \begin{tabular}{p{0.4\linewidth}p{0.4\linewidth}} +% \begin{spverbatim} +%\declettrine{L}{orem ipsum} dolor sit amet, consectetur +%adipiscing elit. Ut porttitor libero lacus, a rhoncus dolor +%finibus vel. Morbi volputate condimentum ornare. In +%scelerisque aliquam\drmfelip\end{spverbatim} & +% \declettrine{L}{orem ipsum} dolor sit amet, consectetur +% adipiscing elit. Ut porttitor libero lacus, a rhoncus +% dolor finibus vel. Morbi volputate condimentum ornare. +% In scelerisque aliquam\drmfelip \\ +% \end{tabular} +% \end{center} +% +% % \subsection{Math} % \label{sub:math} % @@ -1617,7 +1812,7 @@ % By default, using |\big| and friends doesn't work, a % problem I haven't been able to resolve. However, by % requiring |amsmath|, |drm| provides a more directly -% flexible mechanism for this: % \DescribeMacro{\bigd}|\bigd|, +% flexible mechanism for this: \DescribeMacro{\bigd}|\bigd|, % which allows arbitrarily sized delimiters. It takes a % single argument, which is an integer describing the % desired size: @@ -1635,7 +1830,7 @@ % % This symbols, of course, also work inline (as opposed to % displayed, which is what we have above); you can take -% $\sqrt{2}$ and have $(3\times\left(4\over3\right))$ just +% $\sqrt{2\over3}$ and have $(3\times\left(4\over3\right))$ just % as easily in a paragraph as in a display, though you may % want to take care that you're not using too much space for % your lines. (I didn't take care in this paragraph, and @@ -1696,11 +1891,14 @@ % Load the required packages. DRM contains TS1, LGR, OML, % OMS, and T1 encoded fonts, so we load |fontenc| with all % these encodings as options. We also load |modroman| for -% the |\romanize| macro, defined below. +% the |\romanize| macro, defined below. Finally, we load +% |gmp| for the decorative initials (this allows including +% \MP\ code in \LaTeX\ source). % \begin{macrocode} \RequirePackage[LGR,OML,OMS,TS1,T1]{fontenc} \RequirePackage{modroman} \RequirePackage{amsmath} +\RequirePackage{gmp} % \end{macrocode} % Now we declare our options. % \begin{macrocode} @@ -1708,78 +1906,151 @@ \newif\ifnodefaultmath\nodefaultmathfalse \newif\ifnodefaulttext\nodefaulttextfalse \newif\ifsymbolsonly\symbolsonlyfalse +\newif\iftypeone\typeonefalse \DeclareOption{nodefault}{\nodefaulttrue\nodefaultmathtrue% \nodefaulttexttrue} \DeclareOption{nodefaultmath}{\nodefaultmathtrue} \DeclareOption{nodefaulttext}{\nodefaulttexttrue} \DeclareOption{symbolsonly}{\symbolsonlytrue\nodefaulttrue% \nodefaulttexttrue\nodefaultmathtrue} +\DeclareOption{typeone}{\typeonetrue} \ProcessOptions % \end{macrocode} -% Begin defining the font families. +% Begin defining the font families. First, define the fonts +% with the file |drm.map| if the option |typeone| was +% requested; otherwise, load the \MF\ files directly. % \begin{macrocode} -\DeclareFontFamily{T1}{drm}{} -\DeclareFontFamily{TS1}{drm}{} -\DeclareFontFamily{LGR}{drm}{} -\DeclareFontFamily{U}{drmsups}{} -\DeclareFontFamily{U}{drminfs}{} -\DeclareFontShape{U}{drminfs}{m}{n}{ <-7> drminf6 - <7> drminf7 <8> drminf8 <9> drminf9 <10-12> drminf10 - <12-13> drminf12 <14-17> drminf14 <17-24> drminf17 - <24-> drminf24 }{} -\DeclareFontShape{U}{drmsups}{m}{n}{ <-7> drmfigs6 - <7> drmfigs7 <8> drmfigs8 <9> drmfigs9 <10-12> drmfigs10 - <12-13> drmfigs12 <14-17> drmfigs14 <17-24> drmfigs17 - <24-> drmfigs24 }{} -\DeclareFontShape{T1}{drm}{m}{n}{ <-7> drm6 <7> drm7 <8> drm8 - <9> drm9 <10-12> drm10 <12-13> drm12 <14-17> drm14 - <17-24> drm17 <24-> drm24 }{} -\DeclareFontShape{T1}{drm}{m}{sc}{<-7> drmsc6 <7> drmsc7 - <8> drmsc8 <9> drmsc9 <10-12> drmsc10 <12-14> drmsc12 - <14-17> drmsc14 <17-24> drmsc17 <24-> drmsc24 }{} -\DeclareFontShape{T1}{drm}{m}{tc}{<-7> drmtc6 <7> drmtc7 - <8> drmtc8 <9> drmtc9 <10-12> drmtc10 <12-14> drmtc12 - <14-17> drmtc14 <17-24> drmtc17 <24-> drmtc24 }{} -\DeclareFontShape{T1}{drm}{bx}{sc}{<-7> drmscbx6 <7> drmscbx7 - <8> drmscbx8 <9> drmscbx9 <10-12> drmscbx10 <12-14> drmscbx12 - <14-17> drmscbx14 <17-24> drmscbx17 <24-> drmscbx24 }{} -\DeclareFontShape{T1}{drm}{bx}{tc}{<-7> drmtcbx6 <7> drmtcbx7 - <8> drmtcbx8 <9> drmtcbx9 <10-12> drmtcbx10 <12-14> drmtcbx12 - <14-17> drmtcbx14 <17-24> drmtcbx17 <24-> drmtcbx24 }{} -\DeclareFontShape{T1}{drm}{m}{itsc}{<-7> drmitsc6 <7> drmitsc7 - <8> drmitsc8 <9> drmitsc9 <10-12> drmitsc10 <12-14> drmitsc12 - <14-17> drmitsc14 <17-24> drmitsc17 <24-> drmitsc24 }{} -\DeclareFontShape{T1}{drm}{m}{ittc}{<-7> drmittc6 <7> drmittc7 - <8> drmittc8 <9> drmittc9 <10-12> drmittc10 <12-14> drmittc12 - <14-17> drmittc14 <17-24> drmittc17 <24-> drmittc24 }{} -\DeclareFontShape{T1}{drm}{m}{sl}{<-7> drmsl6 <7> drmsl7 - <8> drmsl8 <9> drmsl9 <10-12> drmsl10 <12-14> drmsl12 - <14-17> drmsl14 <17-24> drmsl17 <24-> drmsl24 }{} -\DeclareFontShape{T1}{drm}{m}{it}{ <-7> drmit6 <7> drmit7 - <8> drmit8 <9> drmit9 <10-12> drmit10 <12-14> drmit12 - <14-17> drmit14 <17-24> drmit17 <24-> drmit24 }{} -\DeclareFontShape{T1}{drm}{bx}{it}{ <-7> drmitbx6 <7> drmitbx7 - <8> drmitbx8 <9> drmitbx9 <10-12> drmitbx10 <12-14> drmitbx12 - <14-17> drmitbx14 <17-24> drmitbx17 <24-> drmitbx24 }{} -\DeclareFontShape{T1}{drm}{m}{ui}{<-7> drmui6 <7> drmui7 - <8> drmui8 <9> drmui9 <10-12> drmui10 <12-14> drmui12 - <14-17> drmui14 <17-24> drmui17 <24-> drmui24 }{} -\DeclareFontShape{T1}{drm}{bx}{ui}{<-7> drmuibx6 <7> drmuibx7 - <8> drmuibx8 <9> drmuibx9 <10-12> drmuibx10 <12-14> drmuibx12 - <14-17> drmuibx14 <17-24> drmuibx17 <24-> drmuibx24 }{} -\DeclareFontShape{T1}{drm}{l}{n}{<-7> drml6 <7> drml7 - <8> drml8 <9> drml9 <10-12> drml10 <12-14> drml12 - <14-17> drml14 <17-24> drml17 <24-> drml24 }{} -\DeclareFontShape{T1}{drm}{b}{n}{<-7> drmb6 <7> drmb7 - <8> drmb8 <9> drmb9 <10-12> drmb10 <12-14> drmb12 - <14-17> drmb14 <17-24> drmb17 <24-> drmb24 }{} -\DeclareFontShape{T1}{drm}{bx}{n}{<-7> drmbx6 <7> drmbx7 - <8> drmbx8 <9> drmbx9 <10-12> drmbx10 <12-14> drmbx12 - <14-17> drmbx14 <17-24> drmbx17 <24-> drmbx24 }{} -\DeclareFontShape{TS1}{drm}{m}{n}{<-7> drmsym7 - <8> drmsym8 <9> drmsym9 <10-12> drmsym10 <12-14> drmsym12 - <14-17> drmsym14 <17-24> drmsym17 <24-> drmsym24 }{} -\DeclareFontShape{LGR}{drm}{m}{n}{<-> drmgrk10 }{} +\iftypeone + \RequirePackage{ifpdf} + \ifpdf + \pdfmapfile{=drm.map} + \fi + \DeclareFontFamily{T1}{drm}{} + \DeclareFontFamily{TS1}{drm}{} + \DeclareFontFamily{LGR}{drm}{} + \DeclareFontFamily{U}{drmsups}{} + \DeclareFontFamily{U}{drminfs}{} + \DeclareFontShape{U}{drminfs}{m}{n}{ <-7> drminf6 + <7> drminf7 <8> drminf8 <9> drminf9 <10-12> drminf10 + <12-13> drminf12 <14-17> drminf14 <17-24> drminf17 + <24-> drminf24 }{} + \DeclareFontShape{U}{drmsups}{m}{n}{ <-7> drmfigs6 + <7> drmfigs7 <8> drmfigs8 <9> drmfigs9 <10-12> drmfigs10 + <12-13> drmfigs12 <14-17> drmfigs14 <17-24> drmfigs17 + <24-> drmfigs24 }{} + \DeclareFontShape{T1}{drm}{m}{n}{ <-7> drm6 <7> drm7 <8> drm8 + <9> drm9 <10-12> drm10 <12-13> drm12 <14-17> drm14 + <17-24> drm17 <24-> drm24 }{} + \DeclareFontShape{T1}{drm}{m}{sc}{<-7> drmsc6 <7> drmsc7 + <8> drmsc8 <9> drmsc9 <10-12> drmsc10 <12-14> drmsc12 + <14-17> drmsc14 <17-24> drmsc17 <24-> drmsc24 }{} + \DeclareFontShape{T1}{drm}{m}{tc}{<-7> drmtc6 <7> drmtc7 + <8> drmtc8 <9> drmtc9 <10-12> drmtc10 <12-14> drmtc12 + <14-17> drmtc14 <17-24> drmtc17 <24-> drmtc24 }{} + \DeclareFontShape{T1}{drm}{bx}{sc}{<-7> drmscbx6 <7> drmscbx7 + <8> drmscbx8 <9> drmscbx9 <10-12> drmscbx10 <12-14> drmscbx12 + <14-17> drmscbx14 <17-24> drmscbx17 <24-> drmscbx24 }{} + \DeclareFontShape{T1}{drm}{bx}{tc}{<-7> drmtcbx6 <7> drmtcbx7 + <8> drmtcbx8 <9> drmtcbx9 <10-12> drmtcbx10 <12-14> drmtcbx12 + <14-17> drmtcbx14 <17-24> drmtcbx17 <24-> drmtcbx24 }{} + \DeclareFontShape{T1}{drm}{m}{itsc}{<-7> drmitsc6 <7> drmitsc7 + <8> drmitsc8 <9> drmitsc9 <10-12> drmitsc10 <12-14> drmitsc12 + <14-17> drmitsc14 <17-24> drmitsc17 <24-> drmitsc24 }{} + \DeclareFontShape{T1}{drm}{m}{ittc}{<-7> drmittc6 <7> drmittc7 + <8> drmittc8 <9> drmittc9 <10-12> drmittc10 <12-14> drmittc12 + <14-17> drmittc14 <17-24> drmittc17 <24-> drmittc24 }{} + \DeclareFontShape{T1}{drm}{m}{sl}{<-7> drmsl6 <7> drmsl7 + <8> drmsl8 <9> drmsl9 <10-12> drmsl10 <12-14> drmsl12 + <14-17> drmsl14 <17-24> drmsl17 <24-> drmsl24 }{} + \DeclareFontShape{T1}{drm}{m}{it}{ <-7> drmit6 <7> drmit7 + <8> drmit8 <9> drmit9 <10-12> drmit10 <12-14> drmit12 + <14-17> drmit14 <17-24> drmit17 <24-> drmit24 }{} + \DeclareFontShape{T1}{drm}{bx}{it}{ <-7> drmitbx6 <7> drmitbx7 + <8> drmitbx8 <9> drmitbx9 <10-12> drmitbx10 <12-14> drmitbx12 + <14-17> drmitbx14 <17-24> drmitbx17 <24-> drmitbx24 }{} + \DeclareFontShape{T1}{drm}{m}{ui}{<-7> drmui6 <7> drmui7 + <8> drmui8 <9> drmui9 <10-12> drmui10 <12-14> drmui12 + <14-17> drmui14 <17-24> drmui17 <24-> drmui24 }{} + \DeclareFontShape{T1}{drm}{bx}{ui}{<-7> drmuibx6 <7> drmuibx7 + <8> drmuibx8 <9> drmuibx9 <10-12> drmuibx10 <12-14> drmuibx12 + <14-17> drmuibx14 <17-24> drmuibx17 <24-> drmuibx24 }{} + \DeclareFontShape{T1}{drm}{l}{n}{<-7> drml6 <7> drml7 + <8> drml8 <9> drml9 <10-12> drml10 <12-14> drml12 + <14-17> drml14 <17-24> drml17 <24-> drml24 }{} + \DeclareFontShape{T1}{drm}{b}{n}{<-7> drmb6 <7> drmb7 + <8> drmb8 <9> drmb9 <10-12> drmb10 <12-14> drmb12 + <14-17> drmb14 <17-24> drmb17 <24-> drmb24 }{} + \DeclareFontShape{T1}{drm}{bx}{n}{<-7> drmbx6 <7> drmbx7 + <8> drmbx8 <9> drmbx9 <10-12> drmbx10 <12-14> drmbx12 + <14-17> drmbx14 <17-24> drmbx17 <24-> drmbx24 }{} + \DeclareFontShape{TS1}{drm}{m}{n}{<-7> drmsym7 + <8> drmsym8 <9> drmsym9 <10-12> drmsym10 <12-14> drmsym12 + <14-17> drmsym14 <17-24> drmsym17 <24-> drmsym24 }{} + \DeclareFontShape{LGR}{drm}{m}{n}{<-> drmgrk10 }{} +\else + \DeclareFontFamily{T1}{drm}{} + \DeclareFontFamily{TS1}{drm}{} + \DeclareFontFamily{LGR}{drm}{} + \DeclareFontFamily{U}{drmsups}{} + \DeclareFontFamily{U}{drminfs}{} + \DeclareFontShape{U}{drminfs}{m}{n}{ <-7> drminf6 + <7> drminf7 <8> drminf8 <9> drminf9 <10-12> drminf10 + <12-13> drminf12 <14-17> drminf14 <17-24> drminf17 + <24-> drminf24 }{} + \DeclareFontShape{U}{drmsups}{m}{n}{ <-7> drmfigs6 + <7> drmfigs7 <8> drmfigs8 <9> drmfigs9 <10-12> drmfigs10 + <12-13> drmfigs12 <14-17> drmfigs14 <17-24> drmfigs17 + <24-> drmfigs24 }{} + \DeclareFontShape{T1}{drm}{m}{n}{ <-7> drm6 <7> drm7 <8> drm8 + <9> drm9 <10-12> drm10 <12-13> drm12 <14-17> drm14 + <17-24> drm17 <24-> drm24 }{} + \DeclareFontShape{T1}{drm}{m}{sc}{<-7> drmsc6 <7> drmsc7 + <8> drmsc8 <9> drmsc9 <10-12> drmsc10 <12-14> drmsc12 + <14-17> drmsc14 <17-24> drmsc17 <24-> drmsc24 }{} + \DeclareFontShape{T1}{drm}{m}{tc}{<-7> drmtc6 <7> drmtc7 + <8> drmtc8 <9> drmtc9 <10-12> drmtc10 <12-14> drmtc12 + <14-17> drmtc14 <17-24> drmtc17 <24-> drmtc24 }{} + \DeclareFontShape{T1}{drm}{bx}{sc}{<-7> drmscbx6 <7> drmscbx7 + <8> drmscbx8 <9> drmscbx9 <10-12> drmscbx10 <12-14> drmscbx12 + <14-17> drmscbx14 <17-24> drmscbx17 <24-> drmscbx24 }{} + \DeclareFontShape{T1}{drm}{bx}{tc}{<-7> drmtcbx6 <7> drmtcbx7 + <8> drmtcbx8 <9> drmtcbx9 <10-12> drmtcbx10 <12-14> drmtcbx12 + <14-17> drmtcbx14 <17-24> drmtcbx17 <24-> drmtcbx24 }{} + \DeclareFontShape{T1}{drm}{m}{itsc}{<-7> drmitsc6 <7> drmitsc7 + <8> drmitsc8 <9> drmitsc9 <10-12> drmitsc10 <12-14> drmitsc12 + <14-17> drmitsc14 <17-24> drmitsc17 <24-> drmitsc24 }{} + \DeclareFontShape{T1}{drm}{m}{ittc}{<-7> drmittc6 <7> drmittc7 + <8> drmittc8 <9> drmittc9 <10-12> drmittc10 <12-14> drmittc12 + <14-17> drmittc14 <17-24> drmittc17 <24-> drmittc24 }{} + \DeclareFontShape{T1}{drm}{m}{sl}{<-7> drmsl6 <7> drmsl7 + <8> drmsl8 <9> drmsl9 <10-12> drmsl10 <12-14> drmsl12 + <14-17> drmsl14 <17-24> drmsl17 <24-> drmsl24 }{} + \DeclareFontShape{T1}{drm}{m}{it}{ <-7> drmit6 <7> drmit7 + <8> drmit8 <9> drmit9 <10-12> drmit10 <12-14> drmit12 + <14-17> drmit14 <17-24> drmit17 <24-> drmit24 }{} + \DeclareFontShape{T1}{drm}{bx}{it}{ <-7> drmitbx6 <7> drmitbx7 + <8> drmitbx8 <9> drmitbx9 <10-12> drmitbx10 <12-14> drmitbx12 + <14-17> drmitbx14 <17-24> drmitbx17 <24-> drmitbx24 }{} + \DeclareFontShape{T1}{drm}{m}{ui}{<-7> drmui6 <7> drmui7 + <8> drmui8 <9> drmui9 <10-12> drmui10 <12-14> drmui12 + <14-17> drmui14 <17-24> drmui17 <24-> drmui24 }{} + \DeclareFontShape{T1}{drm}{bx}{ui}{<-7> drmuibx6 <7> drmuibx7 + <8> drmuibx8 <9> drmuibx9 <10-12> drmuibx10 <12-14> drmuibx12 + <14-17> drmuibx14 <17-24> drmuibx17 <24-> drmuibx24 }{} + \DeclareFontShape{T1}{drm}{l}{n}{<-7> drml6 <7> drml7 + <8> drml8 <9> drml9 <10-12> drml10 <12-14> drml12 + <14-17> drml14 <17-24> drml17 <24-> drml24 }{} + \DeclareFontShape{T1}{drm}{b}{n}{<-7> drmb6 <7> drmb7 + <8> drmb8 <9> drmb9 <10-12> drmb10 <12-14> drmb12 + <14-17> drmb14 <17-24> drmb17 <24-> drmb24 }{} + \DeclareFontShape{T1}{drm}{bx}{n}{<-7> drmbx6 <7> drmbx7 + <8> drmbx8 <9> drmbx9 <10-12> drmbx10 <12-14> drmbx12 + <14-17> drmbx14 <17-24> drmbx17 <24-> drmbx24 }{} + \DeclareFontShape{TS1}{drm}{m}{n}{<-7> drmsym7 + <8> drmsym8 <9> drmsym9 <10-12> drmsym10 <12-14> drmsym12 + <14-17> drmsym14 <17-24> drmsym17 <24-> drmsym24 }{} + \DeclareFontShape{LGR}{drm}{m}{n}{<-> drmgrk10 }{} +\fi % \end{macrocode} % Now, set the default text font as DRM unless |nodefault| % or |nodefaulttext| has been specified. Also redefine the @@ -2663,6 +2934,241 @@ }% }% % \end{macrocode} +% Now, we begin the decorative initials. These are designed +% using a common background written in \MP\ with a DRM +% figure superimposed, so a great deal of the code in this +% section is, in fact, \MP\ rather than \TeX\ or \MF. +% +% We begin by defining |\drmdecinit|, which takes five +% arguments: the width, the height, the color of the +% background, the color of the letter, and the letter +% itself. It includes a \MP\ macro, |along|, derived from +% \url{http://tex.stackexchange.com/questions/176665/define-a-pair-point-along-a-path-length-metapost}. +% \begin{macrocode} +\def\drmdecinitfontdefault{% + \def\drmdecinitfont{% + \unexpanded{\font\drminitfontcom=drm10} + }% +}% +\def\drmdecinitfont{% + \unexpanded{\font\drminitfontcom=drm10} % +}% +\def\drmdecinit#1#2#3#4#5{% + \begin{mpost} + primarydef pct along pat = + (arctime (pct * (arclength pat)) of pat) of pat + enddef; + w=#1; h=#2; + pen thinpen; thinpen = pencircle scaled (w/288); + pen medpen; medpen = pencircle scaled (w/144); + pen thickpen; thickpen = pencircle scaled (w/144 + w/288); + pen ththickpen; ththickpen = pencircle scaled (w/72); + pen thththickpen; thththickpen = pencircle scaled (w/36); + leaflen = w/6.5; + leafletlen = w/20; + leafletwid = w/40; + leafletgap = w/40; + pen leafpen; leafpen = pencircle xscaled leafletlen + yscaled leafletwid; + pen sideleafpen; sideleafpen = pencircle yscaled leafletlen + xscaled leafletwid rotated -35; + def border = + pickup thththickpen; + draw top lft (0,h)--top rt(w,h)--bot rt(w,0)--bot + lft(0,0)--cycle withcolor #3; + pickup ththickpen; + draw (top lft (0,h)--top rt(w,h)--bot rt(w,0)--bot + lft(0,0)--cycle) scaled 0.95 shifted (0.025w,0.025h) + withcolor #3; + enddef; + def leaf(expr p,s,r,t) = + path leafpath; + leafpath = ((p shifted (leafletlen/2,0)).. + (p shifted (0,leafletwid/2)).. + (p shifted (-leafletlen/2,0)).. + (p shifted (0,-leafletwid/2))..cycle) + rotatedaround (p,s); + if t = 0: + fill leafpath withcolor r; + elseif t = 1: + fill leafpath reflectedabout + ((w/2,h),(w/2,0)) withcolor r; + elseif t = 2: + fill leafpath reflectedabout + ((0,h/2),(w,h/2)) withcolor r; + elseif t = 3: + fill leafpath reflectedabout + ((0,h/2),(w,h/2)) reflectedabout ((w/2,h),(w/2,0)) + withcolor r; + fi + enddef; + def branch(expr p,s,b) = + pickup thickpen; + pair t; t = p rotatedaround (p,s); + pair u; u = point 1.0 along (t{dir (s+90)}.. + t shifted (0.3leaflen,leaflen) rotatedaround (t,s)); + pair q; q = (t shifted (1.4leafletwid,0)) rotatedaround (t,s); + pair v; v = (q shifted (0.3leaflen,leaflen)) rotatedaround (q,s); + pair r; r = (t shifted (-1.4leafletwid,0)) rotatedaround (t,s); + pair a; a = (r shifted (0.3leaflen,leaflen)) rotatedaround (r,s); + if b = 0: + draw (t{dir (s+90)}..u) withcolor #3; + elseif b = 1: + draw (t{dir (s+90)}..u) reflectedabout ((w/2,h),(w/2,0)) + withcolor #3; + elseif b = 2: + draw (t{dir (s+90)}..u) reflectedabout ((0,h/2),(w,h/2)) + withcolor #3; + elseif b = 3: + draw (t{dir (s+90)}..u) reflectedabout ((0,h/2),(w,h/2)) + reflectedabout ((w/2,h),(w/2,0)) withcolor #3; + fi + leaf((point 0.15 along (q{dir (s+90)}..v)),s,#3,b); + leaf((point 0.45 along (q{dir (s+90)}..v)),s,#3,b); + leaf((point 0.75 along (q{dir (s+90)}..v)),s,#3,b); + leaf((point 0.15 along (r{dir (s+90)}..a)),s,#3,b); + leaf((point 0.45 along (r{dir (s+90)}..a)),s,#3,b); + leaf((point 0.75 along (r{dir (s+90)}..a)),s,#3,b); + leaf((point 0.98 along (t{dir (s+90)}..u)),s+60,white,b); + leaf((point 1.00 along (t{dir (s+90)}..u)),s+60,#3,b); + enddef; + def football(expr p) = + pickup thinpen; + draw (z26..z30..z31..z26..z32..z33..cycle) + rotatedaround ((w/2,h/2),p) withcolor #3; + pickup ththickpen; + draw (z20..z24..z21) rotatedaround ((w/2,h/2),p) + withcolor white; + draw (z21..z25..z20) rotatedaround ((w/2,h/2),p) + withcolor white; + draw (z20..tension 1.4..z22..z23..tension 1.5..z20) + rotatedaround ((w/2,h/2),p) withcolor white; + draw (z21..tension 1.4..z22..z23..tension 1.5..z21) + rotatedaround ((w/2,h/2),p) withcolor white; + pickup medpen; + draw (z20..z24..z21) rotatedaround ((w/2,h/2),p) + withcolor #3; + draw (z21..z25..z20) rotatedaround ((w/2,h/2),p) + withcolor #3; + draw (z20..tension 1.4..z22..z23..tension 1.5..z20) + rotatedaround ((w/2,h/2),p) withcolor #3; + draw (z21..tension 1.4..z22..z23..tension 1.5..z21) + rotatedaround ((w/2,h/2),p) withcolor #3; + fill (z34..z36..z35..z37..cycle) rotatedaround + ((w/2,h/2),p) withcolor #3; + fill (z38..z40..z39..z41..cycle) rotatedaround + ((w/2,h/2),p) withcolor #3; + fill (z42..z44..z43..z45..cycle) rotatedaround + ((w/2,h/2),p) withcolor #3; + enddef; + border; + z0 = (w-3.3leafletwid-(w/11),h-leaflen-(w/144)); + z1 = (w/2,2h/3);%h-leafletwid-2pt); + z2 = z0 reflectedabout ((w/2,h),(w/2,0)); + z3 = (2w/3,h/2);%w-leafletwid-2pt,h/2); + z4 = z0 reflectedabout ((w,h/2),(0,h/2)); + z5 = z1 reflectedabout ((0,h/2),(w,h/2)); + z6 = z4 reflectedabout ((w/2,h),(w/2,0)); + z7 = z3 reflectedabout ((w/2,h),(w/2,0)); + pickup thickpen; + draw z0{dir -120}..{left}z1{left}..{dir 120}z2 withcolor #3; + draw z0{dir -120}..{down}z3{down}..{dir -60}z4 withcolor #3; + draw z4{dir 120}..{left}z5{left}..{dir -120}z6 withcolor #3; + draw z6{dir 60}..{up}z7{up}..{dir 120}z2 withcolor #3; + branch(z0,-30,0); + branch(z0,-30,1); + branch(z0,-30,2); + branch(z0,-30,3); + z10 = (w/2,h-leafletwid-(w/72)); + z11 = z10 rotatedaround ((w/2,h/2),90); + z12 = z10 rotatedaround ((w/2,h/2),180); + z13 = z10 rotatedaround ((w/2,h/2),270); + path greatcirc; greatcirc = z10..z11..z12..z13..cycle; + pickup thththickpen; + draw greatcirc withcolor white; + pickup ththickpen; + draw greatcirc withcolor #3; + z20 = z2 shifted (0,-leafletlen); + z21 = z6 shifted (0,leafletlen); + z22 = z11 shifted (leafletlen,0); + z23 = z7 shifted (-leafletlen,0); + z24 = 0.25[z11,z7]; + z25 = 0.75[z11,z7]; + z26 = 0.5[z11,z7]; + z27 = 0.25[z2,z6]; + z28 = 0.5[z2,z6]; + z29 = 0.75[z2,z6]; + z30 = 0.5[z11,z2]; + z31 = 0.5[z7,z2]; + z32 = 0.5[z6,z11]; + z33 = 0.5[z6,z7]; + z34 = z26 shifted (-leafletlen,0); + z35 = z26 shifted (leafletlen,0); + z36 = z26 shifted (0,leafletwid); + z37 = z26 shifted (0,-leafletwid); + z38 = z27 shifted (-0.8leafletwid,0); + z39 = z27 shifted (0.8leafletwid,0); + z40 = z27 shifted (0,0.8leafletlen); + z41 = z27 shifted (0,-0.8leafletlen); + z42 = z29 shifted (-0.8leafletwid,0); + z43 = z29 shifted (0.8leafletwid,0); + z44 = z29 shifted (0,0.8leafletlen); + z45 = z29 shifted (0,-0.8leafletlen); + football(0); + football(90); + football(180); + football(270); + z50 = z1 shifted (0,-leafletwid); + z51 = z3 shifted (-leafletwid,0); + z52 = z5 shifted (0,leafletwid); + z53 = z7 shifted (leafletwid,0); + z54 = 0.4[(w/2,h/2),(0,h)]; + z55 = 0.4[(w/2,h/2),(w,h)]; + z56 = 0.4[(w/2,h/2),(w,0)]; + z57 = 0.4[(w/2,h/2),(0,0)]; + pickup thickpen; + draw z50..z51..z52..z53..cycle withcolor #3; + pickup medpen; + draw z50{left}..z54 withcolor #3; + draw z50{right}..z55 withcolor #3; + draw z51{up}..z55 withcolor #3; + draw z51{down}..z56 withcolor #3; + draw z52{right}..z56 withcolor #3; + draw z52{left}..z57 withcolor #3; + draw z53{down}..z57 withcolor #3; + draw z53{up}..z54 withcolor #3; + z60 = z50 shifted (0,-leafletwid); + z61 = z51 shifted (-leafletwid,0); + z62 = z52 shifted (0,leafletwid); + z63 = z53 shifted (leafletwid,0); + z64 = (w/2,h/2) shifted (0,leafletlen); + z65 = (w/2,h/2) shifted (leafletlen,0); + z66 = (w/2,h/2) shifted (0,-leafletlen); + z67 = (w/2,h/2) shifted (-leafletlen,0); + z68 = 0.5[z64,z65]; + z69 = 0.5[z65,z66]; + z70 = 0.5[z66,z67]; + z71 = 0.5[z67,z64]; + z72 = 0.5[z60,z61]; + z73 = 0.5[z61,z62]; + z74 = 0.5[z62,z63]; + z75 = 0.5[z63,z60]; + z76 = 0.2[z71,z75]; + z77 = point 0.4 along (z63{up}..{right}z60); + z78 = point 0.6 along (z63{up}..{right}z60); + z79 = 0.6[z63,z76]; + pickup thinpen; + path innerbord; innerbord = + z60{z64-z60}..z71..{z63-z67}z63{up}..{right}z60; + draw innerbord withcolor #3; + draw innerbord rotatedaround ((w/2,h/2),90) withcolor #3; + draw innerbord rotatedaround ((w/2,h/2),180) withcolor #3; + draw innerbord rotatedaround ((w/2,h/2),270) withcolor #3; + label(btex {\drmdecinitfont at#2\unexpanded{\drminitfontcom} #5} etex,(w/2,h/2)) + withcolor #4; + \end{mpost} +} +% \end{macrocode} % And that's the end. Thanks for reading, % folks; please email me with any suggestions or improvements. % |