summaryrefslogtreecommitdiff
path: root/fonts/doublestroke
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /fonts/doublestroke
Initial commit
Diffstat (limited to 'fonts/doublestroke')
-rw-r--r--fonts/doublestroke/README125
-rw-r--r--fonts/doublestroke/Udsrom.fd9
-rw-r--r--fonts/doublestroke/Udsss.fd9
-rw-r--r--fonts/doublestroke/dsdoc.pdfbin0 -> 100533 bytes
-rw-r--r--fonts/doublestroke/dsdoc.tex347
-rw-r--r--fonts/doublestroke/dsfont.sty9
-rw-r--r--fonts/doublestroke/dsrom.mf42
-rw-r--r--fonts/doublestroke/dsrom10.mf75
-rw-r--r--fonts/doublestroke/dsrom10.pfbbin0 -> 17014 bytes
-rw-r--r--fonts/doublestroke/dsrom10.tfmbin0 -> 452 bytes
-rw-r--r--fonts/doublestroke/dsrom12.mf75
-rw-r--r--fonts/doublestroke/dsrom12.pfbbin0 -> 17091 bytes
-rw-r--r--fonts/doublestroke/dsrom12.tfmbin0 -> 452 bytes
-rw-r--r--fonts/doublestroke/dsrom8.mf75
-rw-r--r--fonts/doublestroke/dsrom8.pfbbin0 -> 17066 bytes
-rw-r--r--fonts/doublestroke/dsrom8.tfmbin0 -> 452 bytes
-rw-r--r--fonts/doublestroke/dsromo.mf157
-rw-r--r--fonts/doublestroke/dsromu.mf982
-rw-r--r--fonts/doublestroke/dsss10.mf75
-rw-r--r--fonts/doublestroke/dsss10.pfbbin0 -> 12746 bytes
-rw-r--r--fonts/doublestroke/dsss10.tfmbin0 -> 460 bytes
-rw-r--r--fonts/doublestroke/dsss12.mf75
-rw-r--r--fonts/doublestroke/dsss12.pfbbin0 -> 12760 bytes
-rw-r--r--fonts/doublestroke/dsss12.tfmbin0 -> 468 bytes
-rw-r--r--fonts/doublestroke/dsss8.mf75
-rw-r--r--fonts/doublestroke/dsss8.pfbbin0 -> 12663 bytes
-rw-r--r--fonts/doublestroke/dsss8.tfmbin0 -> 452 bytes
-rw-r--r--fonts/doublestroke/dstroke.map6
28 files changed, 2136 insertions, 0 deletions
diff --git a/fonts/doublestroke/README b/fonts/doublestroke/README
new file mode 100644
index 0000000000..833b276510
--- /dev/null
+++ b/fonts/doublestroke/README
@@ -0,0 +1,125 @@
+
+Doublestroke Font V1.111 27th of August, 2002
+------------------------
+
+This font is based on the Computer Modern Roman family of fonts
+by D. E. Knuth. It is useful for typesetting the mathematical
+symbols for the natural numbers (N), whole numbers (Z),
+rational numbers (Q), real numbers (R) and complex numbers (C).
+
+
+License
+-------
+
+You may use and distribute these fonts as you like.
+You may modify these fonts as long as you do not
+rename the files to one of those names that
+Donald E. Knuth chose for the Computer Modern fonts.
+(And seriously, who would want to do that?)
+
+
+How to Install
+--------------
+
+1. If a previous version of this font is installed, remove all
+the files, especially the font files that were generated by
+Metafont after the first installation.
+
+2. Depending on how you obtained this package it might be
+necessary to unpack/uncompress an archive. Now the files
+
+ dsrom12.pfb dsss10.mf dsss8.tfm
+dsdoc.pdf dsrom12.tfm dsss10.pfb dstroke.map
+dsdoc.tex dsrom8.mf dsss10.tfm readme
+dsfont.sty dsrom8.pfb dsss12.mf Udsrom.fd
+dsrom10.mf dsrom8.tfm dsss12.pfb Udsss.fd
+dsrom10.pfb dsrom.mf dsss12.tfm
+dsrom10.tfm dsromo.mf dsss8.mf
+dsrom12.mf dsromu.mf dsss8.pfb
+
+should be present.
+
+3. Make sure you have TeX, LaTeX (with NFSS), and Metafont
+installed. Make sure that cmbase.mf is accessible by Metafont.
+
+4. Move the files to their destination.
+
+The files are and are needed by
+ *.tfm TeX font metric files TeX
+ *.fd font defintions TeX
+ *.sty style files TeX
+ *.mf Metafont sources Metafont
+
+The exact location where the files belong depends on your
+installation. As a first approximation, install them
+near other files with the same extension.
+
+5. Verify the installation by generating the documentation.
+Run `latex dsdoc' and have a look at the file dsdoc.dvi which
+contains the documentation and usage samples.
+
+6. If you want to use the PostScript fonts, you have to make
+them known to dvips and/or PDFTeX. The details of
+this process depend on your system installation,
+typically using the mapping information from the
+file dstroke.map and following further instructions
+contained in the main manual.
+
+7. After reading the examples in the file dsdoc you can
+use the fonts in your own documents.
+
+
+
+After the Installation
+----------------------
+
+Do not worry, most installations complete without any problems.
+However, if the procedure described above does not work, I suggest
+the following actions:
+ - If LaTeX complains about a missing input file, check whether
+ the files *.fd and *.sty are accessible and readable.
+ - If LaTeX complains about a missing font, check the
+ placement of the files *.tfm .
+ - If LaTeX issues strange errors, you might have an old version
+ of LaTeX or NFSS. Try using the fonts with low-level font
+ commands instead of dsfont.sty and check the next item, too.
+ - If LaTeX issues strange errors, the files might have been
+ corrupted during transmission. Conversions of CR, LF, and
+ so on might cause this problem.
+ - If the previewer or the printer driver complains about missing
+ fonts and does not automatically call Metafont to generate
+ these font, either adapt your installation or generate
+ the fonts by hand. Depending on your installation you
+ must run something like
+ mf '\mode=localfont; input dsrom10'
+ for each of the fonts.
+ - If Metafont is called and complains about missing source
+ files, check whether these (*.mf) are placed correctly.
+ - If Metafont is called and complains about strange paths
+ or about paths that do not intersect, you are probably
+ generating the font at a lower resolution than 100 dpi.
+ There is little you can do except ignoring the errors or
+ telling Metafont to do so. Please report such errors only
+ if they occur at resolutions above 100 dpi.
+ - If the previewer or the printer driver complains about missing
+ characters, check whether you have deleted all files from
+ previous versions of this font.
+ - If the previewer or the printer driver complains about a
+ checksum error, check whether you have deleted all files from
+ previous versions of this font.
+
+If that does not help and your friendly TeXnician is unavailable,
+drop me a mail. I will try to help you, if time permits.
+
+I am always glad to hear about improvements and bug reports,
+general comments are appreciated, too.
+
+Olaf Kummer
+
+Universitaet Hamburg
+Fachbereich Informatik -- Arbeitsbereich TGI
+Vogt-Koelln-Strasse 30
+22527 Hamburg (Germany)
+
+mailto:kummer@informatik.uni-hamburg.de
+http://www.informatik.uni-hamburg.de/TGI/mitarbeiter/wimis/kummer.html
diff --git a/fonts/doublestroke/Udsrom.fd b/fonts/doublestroke/Udsrom.fd
new file mode 100644
index 0000000000..565af299ca
--- /dev/null
+++ b/fonts/doublestroke/Udsrom.fd
@@ -0,0 +1,9 @@
+\ProvidesFile{Udsrom.fd}
+ [1995/08/01 v0.1 Double stroke roman font definitions]
+\DeclareFontFamily{U}{dsrom}{}
+\DeclareFontShape{U}{dsrom}{m}{n}{
+ <-10> dsrom8
+ <10-12> dsrom10
+ <12-> dsrom12
+}{}
+\endinput
diff --git a/fonts/doublestroke/Udsss.fd b/fonts/doublestroke/Udsss.fd
new file mode 100644
index 0000000000..303b3a2bab
--- /dev/null
+++ b/fonts/doublestroke/Udsss.fd
@@ -0,0 +1,9 @@
+\ProvidesFile{Udsss.fd}
+ [1995/08/01 v0.1 Double stroke sans serif font definitions]
+\DeclareFontFamily{U}{dsss}{}
+\DeclareFontShape{U}{dsss}{m}{n}{
+ <-10> dsss8
+ <10-12> dsss10
+ <12-> dsss12
+}{}
+\endinput
diff --git a/fonts/doublestroke/dsdoc.pdf b/fonts/doublestroke/dsdoc.pdf
new file mode 100644
index 0000000000..5f2dc6390d
--- /dev/null
+++ b/fonts/doublestroke/dsdoc.pdf
Binary files differ
diff --git a/fonts/doublestroke/dsdoc.tex b/fonts/doublestroke/dsdoc.tex
new file mode 100644
index 0000000000..9c6b3b4e9b
--- /dev/null
+++ b/fonts/doublestroke/dsdoc.tex
@@ -0,0 +1,347 @@
+\documentclass[a4paper]{article}
+\usepackage{dsfont}
+
+% We need both the roman and the sans serif version of
+% the font in this document for example purposes.
+% Do not do this at home, unless you really know why.
+% Chances are you will not end up with a
+% masterpiece of digital typography.
+\DeclareMathAlphabet{\varmathds}{U}{dsss}{m}{n}
+
+\newcommand{\MF}{\textsf{Metafont}}
+
+\begin{document}
+
+\title{\bf The Doublestroke Font V1.111}
+
+\author{Olaf Kummer}
+
+\maketitle
+
+\section{Introduction}
+
+This font is useful for typesetting the mathematical
+symbols for the natural numbers ($\mathds{N}$),
+whole numbers ($\mathds{Z}$), rational numbers ($\mathds{Q}$),
+real numbers ($\mathds{R}$), complex numbers ($\mathds{C}$),
+and a couple of others which are sometimes needed.
+
+The easiest possibility to represent these sets using
+\TeX{} is to use boldface, where you get $\mathbf{N}$
+after entering \verb:$\mathbf{N}$:.
+
+Then one can assemble the glyphs from
+other ones. For example the expression \verb:$\mathrm{I\!N}$:
+yields $\mathrm{I\!N}$.
+
+The calligraphic symbol $\mathcal{N}$ generated by
+\verb:$\mathcal{N}$: is another option.
+
+But if none of the above suits your needs or
+personal taste, you should use a special font. These fonts
+are known as the blackboard bold fonts. There is a
+well-known font distributed by the AMS as
+\texttt{amsyb}, but the fonts
+\texttt{bbold} by Alain Jeffery and \texttt{bbm} by
+Gilles F.~Robert are viable options, too.
+
+And there is this font, too, which was designed
+to be as similar to the Computer Modern family of fonts
+by Donald E.~Knuth as possible. Which of these options you
+prefer is a matter of personal taste, so read on to find
+out whether you like this font.
+
+
+\section{License}
+
+You may use and distribute these fonts as you like.
+You may modify these fonts as long as you do not
+rename the files to one of those names that
+Donald E.~Knuth chose for the Computer Modern fonts.
+(And seriously, who would want to do that?)
+
+
+\section{Installation}
+
+Here are the instructions to install the doublestroke package.
+
+\begin{enumerate}
+\item If a previous version of this font is installed, remove all
+the files, especially the font files that were generated by
+\MF{} after the first installation.
+
+\item Depending on how you obtained this package it might be
+necessary to unpack/uncompress an archive. Now the files
+\begin{verbatim}
+dsdoc.dvi dsrom12.pfb dsss10.mf dsss8.tfm
+dsdoc.ps dsrom12.tfm dsss10.pfb dstroke.map
+dsdoc.tex dsrom8.mf dsss10.tfm readme
+dsfont.sty dsrom8.pfb dsss12.mf Udsrom.fd
+dsrom10.mf dsrom8.tfm dsss12.pfb Udsss.fd
+dsrom10.pfb dsrom.mf dsss12.tfm
+dsrom10.tfm dsromo.mf dsss8.mf
+dsrom12.mf dsromu.mf dsss8.pfb
+\end{verbatim}
+should be present.
+
+\item Make sure that you have \TeX, \LaTeX{} (with NFSS), and \MF{}
+installed. Make sure that \texttt{cmbase.mf} is accessible by \MF.
+
+\item Move the files to their destination.
+
+\begin{tabular}{lll}
+The files & are & and are needed by \\[1ex]
+\texttt{*.tfm} & font metric files & \TeX \\
+\texttt{*.fd} & font defintions & \TeX \\
+\texttt{*.sty} & style files & \TeX \\
+\texttt{*.mf} & \MF sources & \MF \\
+\texttt{*.pfb} & PostScript fonts & \TeX \\
+\texttt{*.map} & font map files & \texttt{dvips}, PDF\TeX
+\end{tabular}
+
+The exact location where the files belong depends on your
+installation. As a first approximation, install them
+near other files with the same extension.
+
+Unlike previous versions of this font, no pregenerated
+fonts at 300\,dpi are included, because
+these fonts should always be generated with the proper
+\MF{} mode. The metric files are included, however, because
+they do not depend on the printer.
+
+\item Verify the installation by generating this documentation
+file from its source \texttt{dsdoc.tex}. The resulting file
+\texttt{dsdoc.dvi} should be identical to this text.
+
+\item If you want to use the PostScript fonts, you have to make
+ them known to \texttt{dvips} and/or PDF\TeX. The details of
+ this process depend on your system installation. For example,
+ if you are working in a Unix-style environment with a recent
+ \TeX\ installation, you can configure \texttt{dvips} by setting
+ the environment variable \texttt{DVIPSRC} to point to a
+ configuration file \texttt{myconfig}, which would look as
+ follows:
+\begin{verbatim}
+p +dstroke.map
+\end{verbatim}
+ This will tell \texttt{dvips} to load the font map file.
+ PDF\TeX\ looks for a configuration file called
+ \texttt{pdftex.cfg}, into which you should put the line
+\begin{verbatim}
+map +dstroke.map
+\end{verbatim}
+ for it to find the PostScript fonts.
+
+ Note that for this to work, all files need to be put into their
+ appropriate places. If you are unsure about where to put
+ things, consult your system administrator or the manual of your
+ \TeX\ system.
+\end{enumerate}
+
+You have probably done all of the above, because you are reading
+this documentation. But maybe you got this documentation from
+somewhere else and ran into trouble during the installation.
+In this case try the following:
+
+\begin{itemize}
+\item If \LaTeX{} complains about a missing input file, check whether
+ the files \texttt{*.fd} and \texttt{*.sty} are accessible and readable.
+\item If \LaTeX{} complains about a missing font, check the
+ placement of the files \texttt{*.tfm}.
+\item If \LaTeX{} issues strange errors, you might have an old version
+ of \LaTeX{} or NFSS. Try using the fonts with low-level font
+ commands instead of dsfont.sty and check the next item, too.
+\item If \LaTeX{} issues strange errors, the files might have been
+ corrupted during transmission. Conversions of CR, LF, and
+ so on might cause this problem.
+\item If the previewer or the printer driver complains about missing
+ fonts and does not automatically call \MF{} to generate
+ these font, either adapt your installation or generate
+ the fonts by hand. Depending on your installation you
+ must run something like
+\begin{verbatim}
+mf '\mode=localfont; input dsrom10'
+\end{verbatim}
+ for each of the fonts.
+\item If \MF{} is called and complains about missing source
+ files, check whether these (\texttt{*.mf}) are placed
+ correctly.
+\item If \MF{} is called and complains about strange paths
+ or about paths that do not intersect, you are probably
+ generating the font at a lower resolution than 100\,dpi.
+ There is little you can do except ignoring the errors or
+ telling \MF{} to do so. Please report such errors only
+ if they occur at resolutions above 100\,dpi.
+\item If the previewer or the printer driver complains about missing
+ characters, check whether you have deleted all files from
+ previous versions of this font.
+\item If the previewer or the printer driver complains about a
+ checksum error, check whether you have deleted all files from
+ previous versions of this font.
+\end{itemize}
+
+If that does not help and your friendly \TeX nician is unavailable,
+drop me a mail. I will try to help you, if time permits.
+
+
+\section{Usage}
+
+You can use the fonts with all versions of \TeX{} and \LaTeX,
+if you apply the low-level command \verb:\font:.
+For example we can write
+\begin{verbatim}
+\font\dsrom=dsrom10
+$$\hbox{\dsrom N}=\{0,1,2,\ldots\}$$
+$$\hbox{\dsrom ABCDEFGHIJKLMNOPQRSTUVWXYZ}$$
+\bye
+\end{verbatim}
+to obtain
+\[\mathds{N}=\{0,1,2,\ldots\}\]
+\[\mathds{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\]
+using \TeX{} alone.
+If \LaTeX{} and NFSS are available as suggested in the installation
+section, you can use the style \texttt{dsfont} for an easier and more
+flexible approach. The style provides a single command \verb:\mathds:
+which can be used in math mode to typeset a doublestroke symbol.
+It use is similar to that of \verb:\mathbb: from the
+AMS package. For example
+\begin{verbatim}
+\documentclass{article}
+\usepackage{dsfont}
+\begin{document}
+\[\mathds{N}=\{0,1,2,\ldots\}\]
+\[\mathds{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\]
+\end{document}
+\end{verbatim}
+will again result in
+\[\mathds{N}=\{0,1,2,\ldots\}\]
+\[\mathds{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\]
+as we have already done in \TeX. The uppercase letters shown here
+are the most common, but there are a few others in use.
+\begin{verbatim}
+\[\mathds{1}\;\mathds{h}\;\mathds{k}\]
+\end{verbatim}
+results in
+\[\mathds{1}\;\mathds{h}\;\mathds{k}\]
+Why are the other lowercase letters and numerals missing? Well,
+they would be ugly if treated in the same way as the uppercase
+letters. Hence I considered the beauty of each individual letter
+more important than the completeness of the whole character set.
+Using \verb:\mathds{a}: we can get the letter $\mathds{a}$.
+This is the way the letter $\mathds{A}$ looked in previous versions
+of this font. It is provided in case somebody likes the old
+version better. The two other letters $\mathds{V}$ and $\mathds{W}$
+have changed significantly, too, but there will be nobody who
+prefers the old glyphs, I think.
+
+Let us look at some examples.
+\begin{verbatim}
+\[\mathds{N}\subset\mathds{Z}\subset\mathds{Q}
+ \subset\mathds{R}\subset\mathds{C}\]
+\[\{a_i\}_{i\in\mathds{N}}\textrm{~where~}a_i\in\mathds{C}\]
+\[\forall x\in\mathds{X}:\exists s\in\mathds{S}:
+ x\circ t\in\mathds{T}^\mathds{1}\]
+\end{verbatim}
+After running \LaTeX{} we get
+\[\mathds{N}\subset\mathds{Z}\subset\mathds{Q}
+ \subset\mathds{R}\subset\mathds{C}\]
+\[(a_i)_{i\in\mathds{N}}\textrm{~where~}a_i\in\mathds{R}\]
+\[\forall x\in\mathds{X}:\exists s\in\mathds{S}:
+ x\circ s\in\mathds{T}^\mathds{1}\]
+We can see that the font can occur in subscripts
+or superscripts without any problems.
+The last formula shows the possibility to use the
+doublestroke font for custom defined objects. Some caution is
+required here. Usually it is best to stick to those symbols
+whose usage is common, like the natural numbers $\mathds{N}$ etc.
+But there are reasons to use own glyphs, of course.
+
+Some people prefer a sans serif doublestroke font. This can be
+accomplished by a minimal change of the \TeX{} source.
+\begin{verbatim}
+\documentclass{article}
+\usepackage[sans]{dsfont}
+\begin{document}
+\[\mathds{N}=\{0,1,2,\ldots\}\]
+\[\mathds{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\]
+\end{document}
+\end{verbatim}
+Did you spot the change? The result is
+\[\varmathds{N}=\{0,1,2,\ldots\}\]
+\[\varmathds{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\]
+In this document I had to use both fonts for example purposes.
+Do not do this at home, unless you really know why.
+I discourage the simultaneous use of serif and
+sans serif doublestroke fonts in a single document, because
+it results in confused readers.
+
+
+\section{Changes}
+
+\subsection*{Changes in Version 1.0}
+
+\begin{itemize}
+\item The characters $\mathds{1}$, $\mathds{h}$, and $\mathds{k}$
+were added.
+
+\item The characters $\mathds{A}$, $\mathds{V}$, and $\mathds{W}$
+were completely redone.
+
+\item For several characters the size of the serifs was adjusted.
+
+\item Several characters were made more robust at low resolutions.
+In order to achieve this goal, the appearance of the letter
+$\mathds{S}$ had to be changed for some extreme parameter settings.
+
+\item The sans serif version of the font was added. The metaness
+required to generate a sans serif font was already present
+in the earlier version. The style file was rewritten to allow
+a choice between the two fonts.
+
+\item 8-point fonts for subscripts were added.
+
+\item The pregenerated fonts were removed from the distribution.
+
+\item This document was written.
+\end{itemize}
+
+
+\subsection*{Changes in Version 1.1}
+
+\begin{itemize}
+\item The license section was added.
+\end{itemize}
+
+
+\subsection*{Changes in Version 1.11}
+
+\begin{itemize}
+\item Documentation bugs were corrected
+\end{itemize}
+
+
+\subsection*{Changes in Version 1.111}
+
+\begin{itemize}
+\item PostScript versions of the fonts were added. These were
+ generated from the \MF\ sources using the \texttt{mftrace}
+ program by Han-Wen Nienhuys.
+\end{itemize}
+
+
+\section{Thanks}
+
+Thanks go to D.~E.~Knuth who gave \TeX, \MF, and
+Computer Modern to the world.
+Marco Kuhlmann added the PostScript version of the fonts
+and commented on the installation process.
+J\"urgen Vollmer provided some
+ideas that were used in this documentation file.
+Han-Wen Nienhuys created \texttt{mftrace}, which was
+required for creating PostScript versions of this font.
+Reinhard Zierke did not only provide the most complete
+\TeX{} installation I can imagine, but also
+motivated this improved version of the font.
+
+
+\end{document}
diff --git a/fonts/doublestroke/dsfont.sty b/fonts/doublestroke/dsfont.sty
new file mode 100644
index 0000000000..8be042232c
--- /dev/null
+++ b/fonts/doublestroke/dsfont.sty
@@ -0,0 +1,9 @@
+\ProvidesPackage{dsfont}
+ [1995/08/01 v0.1 Double stroke roman fonts]
+
+\def\ds@whichfont{dsrom}
+\DeclareOption{sans}{\def\ds@whichfont{dsss}}
+\ProcessOptions\relax
+
+\DeclareMathAlphabet{\mathds}{U}{\ds@whichfont}{m}{n}
+\endinput
diff --git a/fonts/doublestroke/dsrom.mf b/fonts/doublestroke/dsrom.mf
new file mode 100644
index 0000000000..444039164d
--- /dev/null
+++ b/fonts/doublestroke/dsrom.mf
@@ -0,0 +1,42 @@
+% The Computer Modern Roman family of fonts (by D. E. Knuth, 1979--1985)
+% Modified for Double Stroke Characters (by Olaf Kummer, 1995)
+
+% This file was renamed from {\tt roman.mf} to {\tt dsrom.mf}
+% and modified for double stroke characters by Olaf Kummer, 1995.
+% The parameters doublestroke_curvedist and doublestroke_twist
+% were added by Olaf Kummer, 1996.
+% Version 1.0
+
+mode_setup; font_setup;
+
+% New parameters
+if unknown doublestroke_thin#: doublestroke_thin#:=cap_hair#; fi
+if unknown doublestroke_thick#: doublestroke_thick#:=cap_stem#; fi
+if unknown doublestroke_dist#: doublestroke_dist#:=0.9cap_stem#; fi
+if unknown doublestroke_curvedist#: doublestroke_curvedist#:=1.1cap_stem#; fi
+
+if unknown doublestroke_twist:
+ boolean doublestroke_twist; doublestroke_twist:=serifs;
+fi
+
+% Calculate new parameters
+define_whole_blacker_pixels(doublestroke_thick,doublestroke_thin);
+define_whole_pixels(doublestroke_dist,doublestroke_curvedist);
+
+% Add new macros
+
+% Fit stroke to curve
+def curve_stroke(suffix @)(expr xpos,width,patha,pathb) =
+x@1l=x@2l=xpos=x@1r-width=x@2r-width;
+y@1l=y@1r=2h; y@2l=y@2r=-h;
+z@3=(patha)intersectionpoint(z@1l..z@2l);
+z@4=(pathb)intersectionpoint(z@1l..z@2l);
+z@5=(pathb)intersectionpoint(z@1r..z@2r);
+z@6=(patha)intersectionpoint(z@1r..z@2r);
+fill z@3--z@4--z@5--z@6--cycle;
+enddef;
+
+input dsromu; % upper case (majuscules)
+input dsromo; % other characters
+
+bye.
diff --git a/fonts/doublestroke/dsrom10.mf b/fonts/doublestroke/dsrom10.mf
new file mode 100644
index 0000000000..6518af9e8f
--- /dev/null
+++ b/fonts/doublestroke/dsrom10.mf
@@ -0,0 +1,75 @@
+% Double Stroke Computer Modern Roman 10 point
+if unknown cmbase: input cmbase fi
+
+font_identifier:="DSROM"; font_size 10pt#;
+
+u#:=20/36pt#; % unit width
+width_adj#:=0pt#; % width adjustment for certain characters
+serif_fit#:=0pt#; % extra sidebar near lowercase serifs
+cap_serif_fit#:=5/36pt#; % extra sidebar near uppercase serifs
+letter_fit#:=0pt#; % extra space added to all sidebars
+
+body_height#:=270/36pt#; % height of tallest characters
+asc_height#:=250/36pt#; % height of lowercase ascenders
+cap_height#:=246/36pt#; % height of caps
+fig_height#:=232/36pt#; % height of numerals
+x_height#:=155/36pt#; % height of lowercase without ascenders
+math_axis#:=90/36pt#; % axis of symmetry for math symbols
+bar_height#:=87/36pt#; % height of crossbar in lowercase e
+comma_depth#:=70/36pt#; % depth of comma below baseline
+desc_depth#:=70/36pt#; % depth of lowercase descenders
+
+crisp#:=0pt#; % diameter of serif corners
+tiny#:=8/36pt#; % diameter of rounded corners
+fine#:=7/36pt#; % diameter of sharply rounded corners
+thin_join#:=7/36pt#; % width of extrafine details
+hair#:=9/36pt#; % lowercase hairline breadth
+stem#:=25/36pt#; % lowercase stem breadth
+curve#:=30/36pt#; % lowercase curve breadth
+ess#:=27/36pt#; % breadth in middle of lowercase s
+flare#:=33/36pt#; % diameter of bulbs or breadth of terminals
+dot_size#:=38/36pt#; % diameter of dots
+cap_hair#:=11/36pt#; % uppercase hairline breadth
+cap_stem#:=32/36pt#; % uppercase stem breadth
+cap_curve#:=37/36pt#; % uppercase curve breadth
+cap_ess#:=35/36pt#; % breadth in middle of uppercase s
+rule_thickness#:=.4pt#; % thickness of lines in math symbols
+
+dish#:=1/36pt#; % amount erased at top or bottom of serifs
+bracket#:=20/36pt#; % vertical distance from serif base to tangent
+jut#:=28/36pt#; % protrusion of lowercase serifs
+cap_jut#:=37/36pt#; % protrusion of uppercase serifs
+beak_jut#:=10/36pt#; % horizontal protrusion of beak serifs
+beak#:=70/36pt#; % vertical protrusion of beak serifs
+vair#:=8/36pt#; % vertical diameter of hairlines
+notch_cut#:=10pt#; % maximum breadth above or below notches
+bar#:=11/36pt#; % lowercase bar thickness
+slab#:=11/36pt#; % serif and arm thickness
+cap_bar#:=11/36pt#; % uppercase bar thickness
+cap_band#:=11/36pt#; % uppercase thickness above/below lobes
+cap_notch_cut#:=10pt#; % max breadth above/below uppercase notches
+serif_drop#:=4/36pt#; % vertical drop of sloped serifs
+stem_corr#:=1/36pt#; % for small refinements of stem breadth
+vair_corr#:=1/36pt#; % for small refinements of hairline height
+apex_corr#:=0pt#; % extra width at diagonal junctions
+
+o#:=8/36pt#; % amount of overshoot for curves
+apex_o#:=8/36pt#; % amount of overshoot for diagonal junctions
+
+slant:=0; % tilt ratio $(\Delta x/\Delta y)$
+fudge:=1; % factor applied to weights of heavy characters
+math_spread:=0; % extra openness of math symbols
+superness:=1/sqrt2; % parameter for superellipses
+superpull:=1/6; % extra openness inside bowls
+beak_darkness:=11/30; % fraction of triangle inside beak serifs
+ligs:=2; % level of ligatures to be included
+
+square_dots:=false; % should dots be square?
+hefty:=false; % should we try hard not to be overweight?
+serifs:=true; % should serifs and bulbs be attached?
+monospace:=false; % should all characters have the same width?
+variant_g:=false; % should an italic-style g be used?
+low_asterisk:=false; % should the asterisk be centered at the axis?
+math_fitting:=false; % should math-mode spacing be used?
+
+generate dsrom % switch to the driver file
diff --git a/fonts/doublestroke/dsrom10.pfb b/fonts/doublestroke/dsrom10.pfb
new file mode 100644
index 0000000000..19811806d4
--- /dev/null
+++ b/fonts/doublestroke/dsrom10.pfb
Binary files differ
diff --git a/fonts/doublestroke/dsrom10.tfm b/fonts/doublestroke/dsrom10.tfm
new file mode 100644
index 0000000000..757d40c9ed
--- /dev/null
+++ b/fonts/doublestroke/dsrom10.tfm
Binary files differ
diff --git a/fonts/doublestroke/dsrom12.mf b/fonts/doublestroke/dsrom12.mf
new file mode 100644
index 0000000000..7dd0ece695
--- /dev/null
+++ b/fonts/doublestroke/dsrom12.mf
@@ -0,0 +1,75 @@
+% Double Stroke Computer Modern Roman 12 point
+if unknown cmbase: input cmbase fi
+
+font_identifier:="DSROM"; font_size 12pt#;
+
+u#:=23.5/36pt#; % unit width
+width_adj#:=0pt#; % width adjustment for certain characters
+serif_fit#:=0pt#; % extra sidebar near lowercase serifs
+cap_serif_fit#:=5.8/36pt#; % extra sidebar near uppercase serifs
+letter_fit#:=0pt#; % extra space added to all sidebars
+
+body_height#:=324/36pt#; % height of tallest characters
+asc_height#:=300/36pt#; % height of lowercase ascenders
+cap_height#:=295.2/36pt#; % height of caps
+fig_height#:=278.4/36pt#; % height of numerals
+x_height#:=186/36pt#; % height of lowercase without ascenders
+math_axis#:=108/36pt#; % axis of symmetry for math symbols
+bar_height#:=104.4/36pt#; % height of crossbar in lowercase e
+comma_depth#:=84/36pt#; % depth of comma below baseline
+desc_depth#:=84/36pt#; % depth of lowercase descenders
+
+crisp#:=0pt#; % diameter of serif corners
+tiny#:=8/36pt#; % diameter of rounded corners
+fine#:=7/36pt#; % diameter of sharply rounded corners
+thin_join#:=7.5/36pt#; % width of extrafine details
+hair#:=9.5/36pt#; % lowercase hairline breadth
+stem#:=28/36pt#; % lowercase stem breadth
+curve#:=33/36pt#; % lowercase curve breadth
+ess#:=30/36pt#; % breadth in middle of lowercase s
+flare#:=36/36pt#; % diameter of bulbs or breadth of terminals
+dot_size#:=42/36pt#; % diameter of dots
+cap_hair#:=11.5/36pt#; % uppercase hairline breadth
+cap_stem#:=35/36pt#; % uppercase stem breadth
+cap_curve#:=40/36pt#; % uppercase curve breadth
+cap_ess#:=38/36pt#; % breadth in middle of uppercase s
+rule_thickness#:=.44pt#; % thickness of lines in math symbols
+
+dish#:=1/36pt#; % amount erased at top or bottom of serifs
+bracket#:=24/36pt#; % vertical distance from serif base to tangent
+jut#:=33/36pt#; % protrusion of lowercase serifs
+cap_jut#:=41/36pt#; % protrusion of uppercase serifs
+beak_jut#:=11.4/36pt#; % horizontal protrusion of beak serifs
+beak#:=84/36pt#; % vertical protrusion of beak serifs
+vair#:=8.5/36pt#; % vertical diameter of hairlines
+notch_cut#:=12pt#; % maximum breadth above or below notches
+bar#:=12.5/36pt#; % lowercase bar thickness
+slab#:=12.5/36pt#; % serif and arm thickness
+cap_bar#:=12.5/36pt#; % uppercase bar thickness
+cap_band#:=12.5/36pt#; % uppercase thickness above/below lobes
+cap_notch_cut#:=12pt#; % max breadth above/below uppercase notches
+serif_drop#:=4.8/36pt#; % vertical drop of sloped serifs
+stem_corr#:=1/36pt#; % for small refinements of stem breadth
+vair_corr#:=1/36pt#; % for small refinements of hairline height
+apex_corr#:=0pt#; % extra width at diagonal junctions
+
+o#:=9/36pt#; % amount of overshoot for curves
+apex_o#:=9/36pt#; % amount of overshoot for diagonal junctions
+
+slant:=0; % tilt ratio $(\Delta x/\Delta y)$
+fudge:=1; % factor applied to weights of heavy characters
+math_spread:=-0.2; % extra openness of math symbols
+superness:=1/sqrt2; % parameter for superellipses
+superpull:=1/6; % extra openness inside bowls
+beak_darkness:=11/30; % fraction of triangle inside beak serifs
+ligs:=2; % level of ligatures to be included
+
+square_dots:=false; % should dots be square?
+hefty:=false; % should we try hard not to be overweight?
+serifs:=true; % should serifs and bulbs be attached?
+monospace:=false; % should all characters have the same width?
+variant_g:=false; % should an italic-style g be used?
+low_asterisk:=false; % should the asterisk be centered at the axis?
+math_fitting:=false; % should math-mode spacing be used?
+
+generate dsrom % switch to the driver file
diff --git a/fonts/doublestroke/dsrom12.pfb b/fonts/doublestroke/dsrom12.pfb
new file mode 100644
index 0000000000..03d4b896f7
--- /dev/null
+++ b/fonts/doublestroke/dsrom12.pfb
Binary files differ
diff --git a/fonts/doublestroke/dsrom12.tfm b/fonts/doublestroke/dsrom12.tfm
new file mode 100644
index 0000000000..0e2a5b072f
--- /dev/null
+++ b/fonts/doublestroke/dsrom12.tfm
Binary files differ
diff --git a/fonts/doublestroke/dsrom8.mf b/fonts/doublestroke/dsrom8.mf
new file mode 100644
index 0000000000..42d5817fbb
--- /dev/null
+++ b/fonts/doublestroke/dsrom8.mf
@@ -0,0 +1,75 @@
+% Double Stroke Computer Modern Roman 8 point
+if unknown cmbase: input cmbase fi
+
+font_identifier:="DSROM"; font_size 8pt#;
+
+u#:=17/36pt#; % unit width
+width_adj#:=0pt#; % width adjustment for certain characters
+serif_fit#:=0pt#; % extra sidebar near lowercase serifs
+cap_serif_fit#:=4.1/36pt#; % extra sidebar near uppercase serifs
+letter_fit#:=0pt#; % extra space added to all sidebars
+
+body_height#:=216/36pt#; % height of tallest characters
+asc_height#:=200/36pt#; % height of lowercase ascenders
+cap_height#:=196.8/36pt#; % height of caps
+fig_height#:=185.6/36pt#; % height of numerals
+x_height#:=124/36pt#; % height of lowercase without ascenders
+math_axis#:=72/36pt#; % axis of symmetry for math symbols
+bar_height#:=69.6/36pt#; % height of crossbar in lowercase e
+comma_depth#:=56/36pt#; % depth of comma below baseline
+desc_depth#:=56/36pt#; % depth of lowercase descenders
+
+crisp#:=0pt#; % diameter of serif corners
+tiny#:=8/36pt#; % diameter of rounded corners
+fine#:=7/36pt#; % diameter of sharply rounded corners
+thin_join#:=7/36pt#; % width of extrafine details
+hair#:=9/36pt#; % lowercase hairline breadth
+stem#:=22/36pt#; % lowercase stem breadth
+curve#:=25.5/36pt#; % lowercase curve breadth
+ess#:=23/36pt#; % breadth in middle of lowercase s
+flare#:=27/36pt#; % diameter of bulbs or breadth of terminals
+dot_size#:=32/36pt#; % diameter of dots
+cap_hair#:=9.5/36pt#; % uppercase hairline breadth
+cap_stem#:=26.5/36pt#; % uppercase stem breadth
+cap_curve#:=30/36pt#; % uppercase curve breadth
+cap_ess#:=27/36pt#; % breadth in middle of uppercase s
+rule_thickness#:=.36pt#; % thickness of lines in math symbols
+
+dish#:=1/36pt#; % amount erased at top or bottom of serifs
+bracket#:=16/36pt#; % vertical distance from serif base to tangent
+jut#:=22/36pt#; % protrusion of lowercase serifs
+cap_jut#:=29/36pt#; % protrusion of uppercase serifs
+beak_jut#:=8.4/36pt#; % horizontal protrusion of beak serifs
+beak#:=56/36pt#; % vertical protrusion of beak serifs
+vair#:=8/36pt#; % vertical diameter of hairlines
+notch_cut#:=8pt#; % maximum breadth above or below notches
+bar#:=9.5/36pt#; % lowercase bar thickness
+slab#:=9.5/36pt#; % serif and arm thickness
+cap_bar#:=9.5/36pt#; % uppercase bar thickness
+cap_band#:=9.5/36pt#; % uppercase thickness above/below lobes
+cap_notch_cut#:=8pt#; % max breadth above/below uppercase notches
+serif_drop#:=3.2/36pt#; % vertical drop of sloped serifs
+stem_corr#:=1/36pt#; % for small refinements of stem breadth
+vair_corr#:=1/36pt#; % for small refinements of hairline height
+apex_corr#:=0pt#; % extra width at diagonal junctions
+
+o#:=6/36pt#; % amount of overshoot for curves
+apex_o#:=6/36pt#; % amount of overshoot for diagonal junctions
+
+slant:=0; % tilt ratio $(\Delta x/\Delta y)$
+fudge:=1; % factor applied to weights of heavy characters
+math_spread:=.4; % extra openness of math symbols
+superness:=1/sqrt2; % parameter for superellipses
+superpull:=1/6; % extra openness inside bowls
+beak_darkness:=11/30; % fraction of triangle inside beak serifs
+ligs:=2; % level of ligatures to be included
+
+square_dots:=false; % should dots be square?
+hefty:=false; % should we try hard not to be overweight?
+serifs:=true; % should serifs and bulbs be attached?
+monospace:=false; % should all characters have the same width?
+variant_g:=false; % should an italic-style g be used?
+low_asterisk:=false; % should the asterisk be centered at the axis?
+math_fitting:=false; % should math-mode spacing be used?
+
+generate dsrom % switch to the driver file
diff --git a/fonts/doublestroke/dsrom8.pfb b/fonts/doublestroke/dsrom8.pfb
new file mode 100644
index 0000000000..a725a492a7
--- /dev/null
+++ b/fonts/doublestroke/dsrom8.pfb
Binary files differ
diff --git a/fonts/doublestroke/dsrom8.tfm b/fonts/doublestroke/dsrom8.tfm
new file mode 100644
index 0000000000..e4c57278aa
--- /dev/null
+++ b/fonts/doublestroke/dsrom8.tfm
Binary files differ
diff --git a/fonts/doublestroke/dsromo.mf b/fonts/doublestroke/dsromo.mf
new file mode 100644
index 0000000000..bcb15fc65f
--- /dev/null
+++ b/fonts/doublestroke/dsromo.mf
@@ -0,0 +1,157 @@
+% Double Stroke Roman others:
+% These letters were originally coded by D. E. Knuth in November, 1979,
+% inspired by the Monotype faces used in {\sl The Art of Computer Programming}.
+% Sans serif designs by Richard Southall were added in April, 1982.
+% The programs were revised for the new \MF\ conventions in 1985.
+
+% This file {\tt dsromo.mf} was compiled from various Computer
+% Modern sources and modified for double stroke characters by
+% Olaf Kummer, 1996.
+% Version 1.0
+
+cmchar "The numeral 1";
+beginchar("1",11u#,fig_height#,0);
+italcorr fig_height#*slant-.5u#;
+adjust_fit(0,0);
+pickup tiny.nib;
+pos1(cap_stem,0); pos2(cap_stem,0);
+pos11(doublestroke_thin,0); pos12(doublestroke_thin,0);
+lft x1l=lft x2l=w-rt x11r;
+y11=y1; lft x11l=rt x1r+doublestroke_dist;
+y12=y2; lft x12l=rt x2r+doublestroke_dist;
+top y1=h+o; bot y2=0;
+filldraw stroke z1e--z2e; % stem
+filldraw stroke z11e--z12e; % stroke
+z13=whatever[z11,z12]; z14=whatever[z1,z2];
+y13=y14=top y11-slab;
+fill top z11--top z1--z14--z13--cycle; % top closure
+if not serifs: save slab; slab=bar; fi
+nodish_serif(2,1,a,1/3,min(2u,lft x2l-1.5u),
+ b,0,min(2u,w-1.25u-rt x2r)+doublestroke_dist); % left serif
+nodish_serif(12,11,c,0,min(2u,lft x2l-1.5u)+doublestroke_dist,
+ d,1/3,min(2u,w-1.25u-rt x2r)); % stroke serif
+pickup crisp.nib; pos3(slab,-90); pos4(bar,-90);
+top y3l=h+o; top y4l=if monospace: .75 else: .85 fi\\ h+o;
+lft x4=max(1u,tiny.lft x1l-2.75u);
+tiny.rt x1r=lft x3+.25[tiny,hair];
+erase fill z3l{x4l-x3l,3(y4l-y3l)}...z4l{left}
+ --(x4l,h+o+1)--(x3l,h+o+1)--cycle; % erase excess at top
+filldraw stroke z3e{x4e-x3e,3(y4e-y3e)}..z4e{left}; % point
+penlabels(1,2,3,4); endchar;
+
+
+cmchar "A variant of letter A";
+beginchar("a",14.5u#,cap_height#,0);
+adjust_fit(cap_serif_fit#,cap_serif_fit#);
+numeric left_stem,right_stem,outer_jut,alpha;
+right_stem=cap_stem-stem_corr;
+left_stem=min(cap_hair if hefty: -3stem_corr fi,right_stem);
+outer_jut=.8cap_jut;
+y11=y1=y4=0; y12=y2=y3=h+0.4*apex_o;
+x11l=w-x4r=l+letter_fit+outer_jut+.5u;
+alpha=diag_ratio(2,left_stem+doublestroke_thick+doublestroke_dist,
+ y2-y11,x4r-x11l-apex_corr);
+penpos1(alpha*left_stem,0); penpos2(alpha*left_stem,0);
+penpos3(alpha*right_stem,0); penpos4(alpha*right_stem,0);
+penpos11(alpha*doublestroke_thick,0); penpos12(alpha*doublestroke_thick,0);
+x1l=x11r+alpha*doublestroke_dist;
+x2l=x12r+alpha*doublestroke_dist;
+x2l-x1l=x4r-x3r;
+x3r=x2r+apex_corr;
+z0=whatever[z1r,z2r]=whatever[z3l,z4l];
+if y0<h-cap_notch_cut: y0:=h-cap_notch_cut;
+ fill z0+.5right{down}...{z4-z3}diag_end(3l,4l,1,1,4r,3r)
+ --diag_end(4r,3r,1,1,2l,1l)--diag_end(2l,1l,1,1,1r,2r){z2-z1}
+ ...{up}z0+.5left--cycle; % left and right diagonals
+else:
+ fill z0--diag_end(0,4l,1,1,4r,3r)--diag_end(4r,3r,1,1,2l,1l)
+ --diag_end(2l,1l,1,1,1r,0)--cycle; fi % left and right diagonals
+fill diag_end(12l,11l,1,1,11r,12r)
+ --diag_end(11r,12r,1,1,12l,11l)--cycle; % stroke
+penpos5(whatever,angle(z2-z1)); z5=whatever[z1,z2];
+penpos6(whatever,angle(z3-z4)); z6=whatever[z3,z4]; y6=y5;
+if hefty: y5r else: y5 fi =5/12y0;
+y5r-y5l=y6r-y6l=cap_band; penstroke z5e--z6e; % bar line
+if serifs: numeric inner_jut; pickup tiny.nib;
+ prime_points_inside(1,2); prime_points_inside(4,3);
+ prime_points_inside(11,12);
+ if rt x1'r+cap_jut+.5u+1<=lft x4'l-cap_jut: inner_jut=cap_jut;
+ else: rt x1'r+inner_jut+.5u+1=lft x4'l-inner_jut; fi
+ nodish_serif(1',2,a,0,outer_jut+doublestroke_dist,
+ b,1/2,inner_jut)(dark); % left serif
+ nodish_serif(11',12,e,1/3,outer_jut,
+ f,0,inner_jut+doublestroke_dist)(dark); % stroke serif
+ nodish_serif(4',3,c,1/2,inner_jut,d,1/3,outer_jut); % right serif
+ z13=whatever[z11,z12]; x14=x2;
+ y13=y14=y12-slab;
+ fill z12--z2--z14--z13--cycle; fi % top closure
+penlabels(0,1,2,3,4,5,6); endchar;
+
+cmchar "The letter h";
+beginchar("h",11.25u#+doublestroke_thin#,asc_height#,0);
+italcorr .5[bar_height#,x_height#]*slant-serif_fit#+.5stem#-2u#;
+adjust_fit(serif_fit#+stem_shift#,serif_fit#-stem_shift#);
+pickup tiny.nib; pos1(stem,0); pos2(stem,0);
+pos3(stem,0); pos11(doublestroke_thin,0); pos12(doublestroke_thin,0);
+lft x1l=hround(2.5u-.5stem); x1l=x2l;
+lft x11l-rt x1r=lft x12l-rt x2r=doublestroke_dist; x3=w-x1;
+top y1=top y11=h; bot y2=bot y12=0;
+filldraw stroke z1e--z2e; % left stem
+filldraw stroke z11e--z12e; % stroke
+h_stroke(12,a,3,4); % arch and right stem
+if serifs: serif(1,2,b,1/3,-jut); % upper left serif
+ serif(11,12,i,0,-jut-doublestroke_dist); % upper stroke serif
+ numeric inner_jut; pickup tiny.nib;
+ if rt x12r+jut+.5u+1<=lft x4l-jut: inner_jut=jut;
+ else: rt x12r+jut+.5u+1=lft x4l-inner_jut; fi
+ nodish_serif(2,1,c,1/3,jut,d,0,jut+doublestroke_dist); % lower left serif
+ nodish_serif(12,11,g,0,jut+doublestroke_dist,h,1/3,jut); % lower left stroke serif
+ nodish_serif(4,3,e,1/3,inner_jut,f,1/3,jut); fi % lower right serif
+penlabels(1,2,3,4); endchar;
+
+cmchar "The letter k";
+beginchar("k",10.75u#+doublestroke_thin#,asc_height#,0);
+italcorr x_height#*slant-.2u#;
+adjust_fit(serif_fit#,serif_fit#); pickup tiny.nib;
+numeric right_jut,stem[],alpha[];
+stem1=stem2=max(tiny.breadth,hround(fudged.stem-stem_corr));
+stem3=max(tiny.breadth,hround(fudged.hair if hefty:-\\4stem_corr fi));
+stem4=max(tiny.breadth,hround(fudged.stem-3stem_corr));
+if serifs: right_jut=.6jut; else: right_jut=.4tiny; fi
+pos1(stem1,0); pos2(stem2,0);
+pos21(doublestroke_thin,0); pos22(doublestroke_thin,0);
+top y1=top y21=h; bot y2=bot y22=0;
+lft x1l=lft x2l=hround(2.5u-.5stem1);
+lft x21l-rt x1r=lft x22l-rt x2r=doublestroke_dist;
+top y3=x_height; rt x3r=hround(r-letter_fit-.7u-right_jut)+eps;
+bot y6=0; rt x6r=hround(r-letter_fit-.3u-right_jut)+eps;
+x4=x11=x21; y4=.7bar_height; y11=y3;
+alpha1=diag_ratio(1,.5(stem3-tiny),y3-y4,x3r-x4);
+alpha2=diag_ratio(1,.5(stem4-tiny),y11-y6,x6r-x21);
+penpos3(alpha1*(stem3-tiny),0); penpos4(whatever,-90);
+z5=.5[z5l,z5r]; penpos6(alpha2*(stem4-tiny),0);
+forsuffixes $=l,r: y3'$=x_height; y6'$=0; z4$=z3'$+whatever*(z3-z4);
+ z5$=z6'$+whatever*(z11-z6)=whatever[z3,z4]; endfor
+z3'r=z3r+penoffset z3-z4 of currentpen+whatever*(z3-z4);
+% we have also |z3'l=z3l+penoffset z4-z3 of currentpen+whatever*(z3-z4)|;\]
+z6'r=z6r+penoffset z11-z6 of currentpen+whatever*(z11-z6);
+z6'l=z6l+penoffset z6-z11 of currentpen+whatever*(z11-z6);
+fill z4r--diag_end(4r,3'r,1,.5,3'l,4l)--z4l--cycle; % upper diagonal
+fill z5l--diag_end(5l,6'l,.5,1,6'r,5r)--z5r--cycle; % lower diagonal
+filldraw stroke z1e--z2e; % stem
+filldraw stroke z21e--z22e; % stroke
+if serifs: numeric inner_jut;
+ if rt x2r+jut+.5u+1<=lft x6l-jut: inner_jut=jut;
+ else: rt x2r+inner_jut+.5u+1=lft x6l-inner_jut; fi
+ serif(1,2,a,1/3,-jut); % upper stem serif
+ serif(21,22,j,0,-jut-doublestroke_dist); % upper stroke serif
+ nodish_serif(2,1,b,1/3,jut,c,0,inner_jut+doublestroke_dist); % lower stem serif
+ nodish_serif(22,21,h,0,jut+doublestroke_dist,i,1/3,inner_jut); % lower stroke serif
+ nodish_serif(3,4,d,2/3,1.4jut,e,1/2,right_jut)(dark); % upper diagonal serif
+ nodish_serif(6,5,f,1/2,inner_jut,g,1/3,right_jut)(dark);fi % lower diagonal serif
+penlabels(0,1,2,3,4,5,6,11); endchar;
+
+
+
+
+
diff --git a/fonts/doublestroke/dsromu.mf b/fonts/doublestroke/dsromu.mf
new file mode 100644
index 0000000000..cc9c234d9e
--- /dev/null
+++ b/fonts/doublestroke/dsromu.mf
@@ -0,0 +1,982 @@
+% Double Stroke Roman upper case:
+% These letters were originally coded by D. E. Knuth in November, 1979,
+% inspired by the Monotype faces used in {\sl The Art of Computer Programming}.
+% Sans serif designs by Richard Southall were added in April, 1982.
+% The programs were revised for the new \MF\ conventions in 1985.
+
+% This file was renamed from {\tt romanu.mf} to {\tt dsromu.mf}
+% and modified for double stroke characters by Olaf Kummer, 1995.
+% The shapes of the letters A, V, and W were improved by Olaf Kummer, 1996.
+% Version 1.0
+
+% Character codes \0101 through \0132 are generated.
+
+cmchar "The letter A";
+beginchar("A",14.5u#,cap_height#,0);
+adjust_fit(cap_serif_fit#,cap_serif_fit#);
+numeric left_stem,right_stem,outer_jut,alpha;
+right_stem=cap_stem-stem_corr;
+left_stem=min(cap_hair if hefty: -3stem_corr fi,right_stem);
+outer_jut=.8cap_jut; x1l=w-x12r=l+letter_fit+outer_jut+.5u; y1=y4=y12=0;
+x2-x1=x12-x11; x3r=x2r+apex_corr; y2=y3=y11=h+0.4apex_o;
+alpha=diag_ratio(2,left_stem+doublestroke_dist+doublestroke_thin,
+ y2-y1,x12r-x1l-apex_corr);
+x3r+alpha*doublestroke_dist=x11l; x4r+alpha*doublestroke_dist=x12l;
+penpos1(alpha*left_stem,0); penpos2(alpha*left_stem,0);
+penpos3(alpha*right_stem,0); penpos4(alpha*right_stem,0);
+penpos11(alpha*doublestroke_thin,0); penpos12(alpha*doublestroke_thin,0);
+z0=whatever[z1r,z2r]=whatever[z3l,z4l];
+if y0<h-cap_notch_cut: y0:=h-cap_notch_cut;
+ fill z0+.5right{down}...{z4-z3}diag_end(3l,4l,1,1,4r,3r)
+ --diag_end(4r,3r,1,1,2l,1l)--diag_end(2l,1l,1,1,1r,2r){z2-z1}
+ ...{up}z0+.5left--cycle; % left and right diagonals
+else: fill z0--diag_end(0,4l,1,1,4r,3r)--diag_end(4r,3r,1,1,2l,1l)
+ --diag_end(2l,1l,1,1,1r,0)--cycle; fi % left and right diagonals
+fill stroke z11e--z12e; % stroke
+penpos5(whatever,angle(z2-z1)); z5=whatever[z1,z2];
+penpos6(whatever,angle(z3-z4)); z6=whatever[z3,z4]; y6=y5;
+if hefty: y5r else: y5 fi =5/12y0;
+y5r-y5l=y6r-y6l=cap_band; penstroke z5e--z6e; % bar line
+if serifs: numeric inner_jut; pickup tiny.nib;
+ prime_points_inside(1,2); prime_points_inside(4,3);
+ prime_points_inside(12,11);
+ if rt x1'r+cap_jut+.5u+1<=lft x4'l-cap_jut: inner_jut=cap_jut;
+ else: rt x1'r+inner_jut+.5u+1=lft x4'l-inner_jut; fi
+ dish_serif(1',2,a,1/2,outer_jut,b,.6,inner_jut)(dark); % left serif
+ dish_serif(4',3,c,1/2,inner_jut,d,0,outer_jut+doublestroke_dist);
+ dish_serif(12',11,e,0,inner_jut+doublestroke_dist,f,1/3,outer_jut); % right serif
+ z13=whatever[z11,z12]; x14=x2;
+ y13=y14=y11-slab;
+ fill z11--z3--z14--z13--cycle; fi % top closure
+penlabels(0,1,2,3,4,5,6); endchar;
+
+cmchar "The letter B";
+beginchar("B",13.5u#,cap_height#,0);
+italcorr .75cap_height#*slant-.5u#;
+adjust_fit(cap_serif_fit#,0);
+numeric left_stem,right_curve,middle_weight;
+left_stem=cap_stem-hround 2stem_corr; middle_weight=.6vair+.5;
+pickup tiny.nib; pos1(left_stem,0); pos2(left_stem,0);
+lft x1l=lft x2l=hround max(2u,3u-.5left_stem); top y1=h; bot y2=0;
+filldraw stroke z1e--z2e; % stem
+pos21(doublestroke_thin,0); pos22(doublestroke_thin,0);
+lft x21l=lft x22l=rt x1r+doublestroke_dist; y21=y1; y22=y2;
+filldraw stroke z21e--z22e; % stroke
+penpos3(cap_band,90); penpos4(cap_band,90);
+penpos6(middle_weight,-90); penpos7(middle_weight,-90);
+penpos8(middle_weight,90); penpos9(middle_weight,90);
+penpos5(right_curve-stem_corr,0); penpos10(right_curve,0);
+penpos11(cap_band,-90); penpos12(cap_band,-90);
+z3r=top z21; y4=y3; y5=.5[y4,y6]; y6=y7; y7l-y8l=vair;
+z12r=bot z22; y11=y12; y10=.5[y11,y9]; y8=y9; .5[y7l,y8l]=.52h;
+x4=x6; x9=x11=x4+.5u; x7=x8=x21; x9l:=x4+.25u;
+x5r=hround(w-1.5u); x10r=hround(w-u);
+if serifs: right_curve=cap_curve-stem_corr; x4=.5[x1,w-1.5u];
+else: right_curve=cap_curve-3stem_corr; x4=.5[x1,w-2.5u];
+ x4l:=x4l-.5u; x9l:=x9l-.5u; fi
+x6l:=x6l-.5u; x11l:=x11l-.5u;
+fill stroke z3e..super_arc.e(4,5) & super_arc.e(5,6)..z7e; % upper lobe
+fill stroke z8e..super_arc.e(9,10) & super_arc.e(10,11)..z12e; % lower lobe
+if serifs: nodish_serif(1,2,a,1/3,cap_jut,b,0,.5cap_jut+doublestroke_dist); % upper serif
+ nodish_serif(21,22,e,0,cap_jut+doublestroke_dist,f,1/3,.5cap_jut); % upper stroke serif
+ nodish_serif(2,1,c,1/3,cap_jut,d,0,.5cap_jut+doublestroke_dist); % lower serif
+ nodish_serif(22,21,g,0,cap_jut+doublestroke_dist,h,1/3,.5cap_jut); fi % lower stroke serif
+math_fit(0,.5ic#); penlabels(1,2,3,4,5,6,7,8,9,10,11,12); endchar;
+
+cmchar "The letter C";
+if serifs: beginchar("C",13u#,cap_height#,0);
+ italcorr cap_height#*slant-.5u#;
+ adjust_fit(0,0);
+ pickup fine.nib; pos1(cap_hair,0); pos2(cap_band,90);
+ pos3(cap_curve,180); pos4(cap_band,270); pos5(hair,360);
+ rt x1r=rt x5r=hround(w-u); lft x3r=hround u; x2=x4=.55[x3,x1];
+ top y2r=h+o; bot y4r=-o; y3=.5[y2,y4];
+ bot y1=min(vround max(.6h,x_height-.5vair),bot y2l-eps);
+ y5=max(good.y .95(h-y1),y4l+eps);
+ (x2l',y2l)=whatever[z2r,z1l]; x2l:=min(x2l',x2l+.5u);
+ (x4l',y4l)=whatever[z4r,z5l]; x4l:=min(x4l',x4l+.5u);
+ filldraw stroke z1e{x2-x1,10(y2-y1)}
+ ...pulled_arc.e(2,3) & pulled_arc.e(3,4)...{up}z5e; % arc
+ curve_stroke(s,rt x3l+doublestroke_curvedist,doublestroke_thin,
+ z1r{x2-x1,10(y2-y1)}...pulled_arc.r(2,3),
+ pulled_arc.r(3,4)...{up}z5r); % stroke
+ pos6(.3[fine.breadth,cap_hair],0); x6r=x1r; top y6=h+o;
+ x1r-x1'=2cap_curve-fine; y1'=y1;
+ path upper_arc; upper_arc=z1{x2-x1,10(y2-y1)}..z2{left};
+ numeric t; t=xpart(upper_arc intersectiontimes (z6l--z1'));
+ filldraw z1r--z6r--z6l--subpath(t,0) of upper_arc--cycle; % barb
+else: beginchar("C",11.5u#,cap_height#,0);
+ italcorr cap_height#*slant-.5u#;
+ adjust_fit(0,0);
+ pickup fine.nib; pos1(1.2flare,80); pos2(slab,90);
+ pos3(cap_curve,180); pos4(slab,270); pos5(flare,275);
+ rt x1r=hround(w-1.1u); x2=x4=.5w+1.25u;
+ lft x3r=hround max(u,2u-.5cap_curve); rt x5r=hround(w-.9u);
+ top y1r=vround .95h+o; top y2r=h+o; y3=.5h;
+ bot y4r=-o; bot y5r=vround .08h-o; y5l:=good.y y5l; x5l:=good.x x5l;
+ filldraw stroke rterm.e(2,1,right,.9,4) & super_arc.e(2,3)
+ & super_arc.e(3,4) & term.e(4,5,right,.8,4); % arc and terminals
+ curve_stroke(s,rt x3l+doublestroke_curvedist,doublestroke_thin,
+ rterm.r(2,1,right,.9,4) & super_arc.r(2,3),
+ super_arc.l(3,4) & term.l(4,5,right,.8,4)); fi % stroke
+math_fit(-.3cap_height#*slant-.5u#,.5ic#);
+penlabels(1,1',2,3,4,5,6); endchar;
+
+cmchar "The letter D";
+beginchar("D",14u#,cap_height#,0);
+italcorr .7cap_height#*slant-.5u#;
+adjust_fit(cap_serif_fit#,0);
+pickup tiny.nib; pos1(cap_stem',0); pos2(cap_stem',0);
+lft x1l=lft x2l=hround max(2u,3u-.5cap_stem'); top y1=h; bot y2=0;
+filldraw stroke z1e--z2e; % stem
+penpos11(doublestroke_thin-tiny,0); penpos12(doublestroke_thin-tiny,0);
+lft x11l=lft x12l=rt x1r+doublestroke_dist; y11=y1; y12=y2;
+filldraw stroke z11e--z12e; % stroke
+penpos3(cap_band,90); penpos4(cap_band,90);
+penpos5(cap_curve-stem_corr,0);
+penpos6(cap_band,-90); penpos7(cap_band,-90);
+z3r=top z11; y4=y3; y5=.51[y4,y6]; y6=y7;
+z7r=bot z12; x4=x6=.53w+.25u; x5r=hround(w-u);
+x4l:=x6l:=x4-.25cap_curve;
+fill stroke z3e..pulled_arc.e(4,5) & pulled_arc.e(5,6)..z7e; % lobe
+if serifs: nodish_serif(1,2,a,1/3,cap_jut,b,0,.5cap_jut); % upper serif
+ nodish_serif(11,12,e,0,cap_jut,f,1/3,.5cap_jut); % upper stroke serif
+ nodish_serif(2,1,c,1/3,cap_jut,d,0,.5cap_jut); % lower serif
+ nodish_serif(12,11,g,0,cap_jut,h,1/3,.5cap_jut); fi % lower stroke serif
+math_fit(0,ic#-.5u#); penlabels(1,2,3,4,5,6,7); endchar;
+
+cmchar "The letter E";
+beginchar("E",13u#-width_adj#,cap_height#,0);
+italcorr cap_height#*slant-beak_jut#-.5u#;
+adjust_fit(cap_serif_fit#,0);
+h:=vround(h-stem_corr);
+pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
+lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); top y1=h; bot y2=0;
+filldraw stroke z1e--z2e; % stem
+pos21(doublestroke_thin,0); pos22(doublestroke_thin,0);
+lft x21l=lft x22l=rt x1r+doublestroke_dist; y21=y1; y22=y2;
+filldraw stroke z21e--z22e; % stroke
+pickup crisp.nib; pos3(slab,90); pos4(hair,0);
+top y3r=h; x3=x21; rt x4r=hround(w-u); y4=good.y(y3l-beak)-eps;
+arm(3,4,e,beak_darkness,beak_jut); % upper arm and beak
+pos5(cap_bar,-90); pos6(hair,0);
+top y5l=vround(.52[y22,y21]+.5cap_bar); x5=x21;
+pos0(cap_bar,90); pos7(hair,0);
+z0=z5; x6=x7; y6-y5l=y0l-y7;
+if serifs: rt x6r=hround(w-4.4u+.5hair); y6=good.y(y5l+.6beak)+eps;
+ rt x9r=hround(w-.5u);
+else: rt x6r=hround(w-1.5u); y6=y5l+eps; rt x9r=hround(w-.75u); fi
+arm(5,6,f,beak_darkness,0); arm(0,7,g,beak_darkness,0); % middle arm and serif
+pos8(slab if not serifs:+2stem_corr fi,-90); pos9(hair,0);
+bot y8r=0; x8=x22; y9=good.y(y8l+7/6beak)+eps;
+arm(8,9,h,beak_darkness,1.5beak_jut); % lower arm and beak
+if serifs: nodish_serif(1,2,a,1/3,cap_jut,b,0,.5cap_jut+doublestroke_dist); % upper serif
+ nodish_serif(21,22,i,0,cap_jut+doublestroke_dist,j,1/3,.5cap_jut); % upper stroke serif
+ nodish_serif(2,1,c,1/3,cap_jut,d,0,.5cap_jut+doublestroke_dist); % lower serif
+ nodish_serif(22,21,k,0,cap_jut+doublestroke_dist,l,1/3,.5cap_jut); fi % lower stroke serif
+math_fit(0,.5ic#); penlabels(0,1,2,3,4,5,6,7,8,9); endchar;
+
+cmchar "The letter F";
+beginchar("F",12.5u#-width_adj#,cap_height#,0);
+italcorr cap_height#*slant-beak_jut#-.25u#;
+adjust_fit(cap_serif_fit#,0);
+h:=vround(h-stem_corr);
+pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
+lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); top y1=h; bot y2=0;
+filldraw stroke z1e--z2e; % stem
+pos21(doublestroke_thin,0); pos22(doublestroke_thin,0);
+lft x21l=lft x22l=rt x1r+doublestroke_dist; y21=y1; y22=y2;
+filldraw stroke z21e--z22e; % stroke
+pickup crisp.nib; pos3(slab,90); pos4(hair,0);
+top y3r=h; x3=x21; rt x4r=hround(w-.75u); y4=good.y(y3l-beak)-eps;
+arm(3,4,e,beak_darkness,beak_jut); % upper arm and beak
+pos5(cap_bar,-90); pos6(hair,0);
+top y5l=vround(.5[y22,y21]+.5cap_bar); x5=x21;
+pos0(cap_bar,90); pos7(hair,0);
+z0=z5; x6=x7; y6-y5l=y0l-y7;
+if serifs: rt x6r=hround(w-4u+.5hair); y6=good.y(y5l+.6beak)+eps;
+ rt x9r=hround(w-.5u);
+else: rt x6r=hround(w-1.5u); y6=y5l+eps; rt x9r=hround(w-.75u); fi
+arm(5,6,f,beak_darkness,0); arm(0,7,g,beak_darkness,0); % middle arm and serif
+if serifs: nodish_serif(1,2,a,1/3,cap_jut,b,0,.5cap_jut+doublestroke_dist); % upper serif
+ nodish_serif(21,22,i,0,cap_jut+doublestroke_dist,j,1/3,.5cap_jut); % upper stroke serif
+ nodish_serif(2,1,c,1/3,cap_jut,d,0,1.25cap_jut+doublestroke_dist); % lower serif
+ nodish_serif(22,21,k,0,cap_jut+doublestroke_dist,l,1/3,1.25cap_jut); fi % lower stroke serif
+math_fit(0,ic#-2.5u#); penlabels(0,1,2,3,4,5,6,7,8,9); endchar;
+
+cmchar "The letter G";
+if serifs: beginchar("G",14u#,cap_height#,0);
+ italcorr cap_height#*slant-1.5u#-.5cap_serif_fit#;
+ adjust_fit(0,.5cap_serif_fit#);
+ pickup tiny.nib; pos0(cap_stem,0); pos7(cap_stem,0);
+ rt x0r=hround(w-2u); y0=good.y(.1[bar_height,x_height]+1); x7=x0;
+ pickup fine.nib;
+ if hefty: bot y7=0; pos5(cap_stem,0); x5=x0; top y5=tiny.top y0;
+ else: pos5(cap_hair,0); pos8(cap_stem,0);
+ y7=.5bar_height; z5l=z8l; z8=z7; x9=x8r; bot y9=0;
+ filldraw z8l{down}..{4(x9-x8),y9-y8}z9--z8r--cycle; fi % spur
+ pos1(cap_hair,0); pos2(cap_band,90);
+ pos3(cap_curve,180); pos4(cap_band,270);
+ rt x1r=hround(w-2u); lft x3r=hround u; x2=x4=.55[x3,x1];
+ top y2r=h+o; bot y4r=-o; y3=.5[y2,y4];
+ bot y1=min(vround max(.6h,x_height-.5vair),bot y2l-eps);
+ (x2l',y2l)=whatever[z2r,z1l]; x2l:=min(x2l',x2l+.5u);
+ (x4l',y4l)=whatever[z4r,z5l]; x4l:=min(x4l',x4l+.5u);
+ filldraw stroke z1e{x2-x1,10(y2-y1)}
+ ...pulled_arc.e(2,3) & pulled_arc.e(3,4)...z5e{up}; % arc
+ curve_stroke(s,rt x3l+doublestroke_curvedist,doublestroke_thin,
+ z1r{x2-x1,10(y2-y1)}...pulled_arc.r(2,3),
+ pulled_arc.r(3,4)...{up}z5r); % stroke
+ pos6(.3[fine.breadth,cap_hair],0); x6r=x1r; top y6=h+o;
+ x1r-x1'=2cap_curve-fine; y1'=y1;
+ path upper_arc; upper_arc=z1{x2-x1,10(y2-y1)}..z2{left};
+ numeric t; t=xpart(upper_arc intersectiontimes (z6l--z1'));
+ filldraw z1r--z6r--z6l--subpath(t,0) of upper_arc--cycle; % barb
+ pickup tiny.nib; filldraw stroke z0e--z7e; % stem
+ nodish_serif(0,7,a,1/3,max(cap_jut,2.25u),b,1/3,1.25u); % serif
+ math_fit(-.3cap_height#*slant-.5u#,ic#);
+else: beginchar("G",12u#,cap_height#,0);
+ italcorr cap_height#*slant-.5u#;
+ adjust_fit(0,0);
+ pickup fine.nib; pos1(1.2flare,80); pos2(slab,90);
+ pos3(cap_curve,180); pos4(slab,270); pos5(flare,270);
+ rt x1r=hround(w-1.35u); x2=x4=.5w+u;
+ lft x3r=hround max(u,2u-.5cap_curve); rt x5l=hround(w-1.2u);
+ top y1r=vround .93h+o; top y2r=h+o; y3=.5h;
+ bot y4r=-o; bot y5r=vround .07h-o;
+ filldraw stroke rterm.e(2,1,right,.9,4)&super_arc.e(2,3)
+ & super_arc.e(3,4) & term.e(4,5,right,1,4); % arc and terminals
+ curve_stroke(s,rt x3l+doublestroke_curvedist,doublestroke_thin,
+ rterm.r(2,1,right,.9,4) & super_arc.r(2,3),
+ super_arc.l(3,4) & term.l(4,5,right,1,4)); % stroke
+ pos0(stem,0); pos7(stem,0);
+ z7r=z5r; x0=x7; top y0=1+vround .35[bar_height,x_height];
+ filldraw stroke z0e--z7e; % stem
+ pos8(cap_bar,90); pos9(cap_bar,90);
+ z0r=z9r; y8=y9; lft x8=hround x4;
+ filldraw stroke z8e--z9e; % bar
+ math_fit(-.3cap_height#*slant-.5u#,.5ic#); fi
+penlabels(0,1,1',2,3,4,5,6,7,8,9); endchar;
+
+cmchar "The letter H";
+beginchar("H",14.5u#+width_adj#,cap_height#,0);
+italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
+adjust_fit(cap_serif_fit#,cap_serif_fit#);
+pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
+pos3(cap_stem,0); pos4(cap_stem,0);
+pos21(doublestroke_thin,0); pos22(doublestroke_thin,0);
+lft x21l=lft x22l=rt x1r+doublestroke_dist; y21=y1; y22=y2;
+lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); x3=x4=w-x1;
+top y1=top y3=h; bot y2=bot y4=0;
+filldraw stroke z1e--z2e; % left stem
+filldraw stroke z3e--z4e; % right stem
+filldraw stroke z21e--z22e; % stroke
+penpos5(cap_bar,90); penpos6(cap_bar,90);
+x5=x21; x6=x3; y5=y6=.52h;
+fill stroke z5e--z6e; % bar
+if serifs: numeric inner_jut;
+ if rt x21r+cap_jut+.5u+1<=lft x3l-cap_jut: inner_jut=cap_jut;
+ else: rt x21r+inner_jut+.5u+1=lft x3l-inner_jut; fi
+ nodish_serif(1,2,a,1/3,cap_jut,b,0,inner_jut+doublestroke_dist); % upper left serif
+ nodish_serif(21,22,i,0,cap_jut+doublestroke_dist,j,1/3,inner_jut); % upper stroke serif
+ nodish_serif(2,1,c,1/3,cap_jut,d,0,inner_jut+doublestroke_dist); % lower left serif
+ nodish_serif(22,21,k,0,cap_jut+doublestroke_dist,l,1/3,inner_jut); % lower stroke serif
+ nodish_serif(3,4,e,1/3,inner_jut,f,1/3,cap_jut); % upper right serif
+ nodish_serif(4,3,g,1/3,inner_jut,h,1/3,cap_jut); fi % lower right serif
+math_fit(0,.5ic#); penlabels(1,2,3,4,5,6); endchar;
+
+cmchar "The letter I";
+beginchar("I",max(7.5u#,4u#+2cap_stem#),cap_height#,0);
+italcorr cap_height#*slant-.25u#;
+adjust_fit(cap_serif_fit#,cap_serif_fit#);
+pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
+pos11(doublestroke_thin,0); pos12(doublestroke_thin,0);
+lft x1l=lft x2l=w-rt x11r;
+top y1=h; bot y2=0;
+y11=y1; lft x11l=rt x1r+doublestroke_dist;
+y12=y2; lft x12l=rt x2r+doublestroke_dist;
+filldraw stroke z1e--z2e; % stem
+filldraw stroke z11e--z12e; % stroke
+if serifs: nodish_serif(1,2,a,1/3,1.05cap_jut,b,0,1.05cap_jut+doublestroke_dist); % upper serif
+ nodish_serif(11,12,e,0,1.05cap_jut+doublestroke_dist,f,1/3,1.05cap_jut); % upper stroke serif
+ nodish_serif(2,1,c,1/3,1.05cap_jut,d,0,1.05cap_jut+doublestroke_dist); % lower serif
+ nodish_serif(12,11,g,0,1.05cap_jut+doublestroke_dist,h,1/3,1.05cap_jut); fi % lower stroke serif
+math_fit(0,.5ic#); penlabels(1,2); endchar;
+
+cmchar "The letter J";
+beginchar("J",10.5u#,cap_height#,0);
+italcorr cap_height#*slant-cap_serif_fit#
+ +.75cap_jut#-2.5u#+min(.5cap_stem#,u#);
+adjust_fit(0,cap_serif_fit#);
+pickup tiny.nib; pos1(cap_stem',0); pos2(cap_stem',0);
+pos11(doublestroke_thin,0); pos12(doublestroke_thin,0);
+top y1=h; rt x11r=hround(w-2u); x2=x1; y2=.21h;
+y11=y1; lft x11l=rt x1r+doublestroke_dist;
+y12=y2; lft x12l=rt x2r+doublestroke_dist;
+if serifs: pos3(vair,-90); pos4(cap_hair,-180);
+ pos13(vair,-90); y13=y3; lft x13l=rt x3r+doublestroke_dist;
+ pos5(flare+(cap_stem-stem),-180);
+ bot y3r=-o; x3=.5[x4,x2]; y5=1/6h; rt x5l=hround 2.75u; z5r=z4r;
+ filldraw stroke z1e--z2e&super_arc.e(2,3); % stem and arc
+ filldraw stroke z11e--z12e&super_arc.e(12,13)&z13e--z3e; % stroke
+ nodish_serif(1,2,a,1/3,1.3cap_jut,b,0,.75cap_jut+doublestroke_dist); % serif
+ nodish_serif(11,12,c,0,1.3cap_jut+doublestroke_dist,d,1/3,.75cap_jut); % stroke serif
+ pickup tiny.nib; bulb(3,4,5); % bulb
+else: filldraw stroke z1e--z2e; % stem
+ filldraw stroke z11e--z12e; % stroke stem
+ pickup fine.nib; pos3(cap_stem',0); z3=z2;
+ pos4(flare,angle(6.5u,-h)); pos5(1.1flare,-100);
+ bot y4r=-o; x4r=.5[x5r,x3r]; lft x5r=hround.75u; bot y5r=vround.06h-o;
+ filldraw stroke z3e{down}....term.e(4,5,left,1,4); % arc and terminal
+ pos13(doublestroke_thin,0); z13=z12;
+ filldraw stroke z13e{down}....{left}z4e; fi % stroke arc
+math_fit(0,.5ic#-.5u#); penlabels(1,2,3,4,5); endchar;
+
+cmchar "The letter K";
+beginchar("K",14.5u#,cap_height#,0);
+italcorr cap_height#*slant-.5u#;
+adjust_fit(cap_serif_fit#,cap_serif_fit#);
+numeric right_jut,stem[],alpha[];
+if serifs: right_jut=.6cap_jut;
+else: right_jut=.4tiny; fi
+pickup tiny.nib; pos1(fudged.cap_stem,0); pos2(fudged.cap_stem,0);
+lft x1l=lft x2l=hround max(2u,3u-.5fudged.cap_stem); top y1=h; bot y2=0;
+filldraw stroke z1e--z2e; % stem
+pos21(doublestroke_thin,0); pos22(doublestroke_thin,0);
+lft x21l=lft x22l=rt x1r+doublestroke_dist; y21=y1; y22=y2;
+filldraw stroke z21e--z22e; % stroke
+stem2=max(tiny.breadth,fudged.cap_stem-3stem_corr);
+stem1=max(tiny.breadth,fudged.hair if hefty:-3stem_corr fi);
+top y3=h; rt x3r=hround(r-letter_fit-u-right_jut);
+bot y6=0; rt x6r=hround(r-letter_fit-.75u-right_jut);
+x4=x21; y4=1/3h;
+alpha1=diag_ratio(1,.5(stem1-tiny),y3-y4,x3r-x4);
+penpos3(alpha1*(stem1-tiny),0); penpos4(whatever,-90);
+alpha2=diag_ratio(1,.5(stem2-tiny),y21-y6,x6r-x21);
+penpos6(alpha2*(stem2-tiny),0);
+forsuffixes $=l,r: y3'$=h; y6'$=0; z4$=z3'$+whatever*(z3-z4);
+ z5$=z6'$+whatever*(z21-z6)=whatever[z3,z4]; endfor
+z5=.5[z5l,z5r];
+z3'r=z3r+penoffset z3-z4 of currentpen+whatever*(z3-z4);
+% we have also |z3'l=z3l+penoffset z4-z3 of currentpen+whatever*(z3-z4)|;\]
+z6'r=z6r+penoffset z21-z6 of currentpen+whatever*(z21-z6);
+z6'l=z6l+penoffset z6-z21 of currentpen+whatever*(z21-z6);
+fill z4r--diag_end(4r,3'r,1,.5,3'l,4l)--z4l--cycle; % upper diagonal
+fill z5l--diag_end(5l,6'l,.5,1,6'r,5r)--z5r--cycle; % lower diagonal
+if serifs: numeric inner_jut;
+ if rt x22r+cap_jut+.5u+1<=lft x6l-cap_jut: inner_jut=cap_jut;
+ else: rt x22r+cap_jut+.5u+1=lft x6l-inner_jut; fi
+ nodish_serif(1,2,a,1/3,cap_jut,b,0,cap_jut+doublestroke_dist); % upper stem serif
+ nodish_serif(21,22,i,0,cap_jut+doublestroke_dist,j,1/3,cap_jut); % upper stroke serif
+ nodish_serif(2,1,c,1/3,cap_jut,d,0,cap_jut+doublestroke_dist); % lower stem serif
+ nodish_serif(22,21,k,0,cap_jut+doublestroke_dist,l,1/3,cap_jut); % lower stroke serif
+ nodish_serif(3,4,e,2/3,1.2cap_jut,f,1/2,right_jut)(dark); % upper diagonal serif
+ nodish_serif(6,5,g,1/2,inner_jut,h,1/3,right_jut)(dark);fi % lower diagonal serif
+math_fit(0,.5ic#); penlabels(1,2,3,4,5,6); endchar;
+
+cmchar "The letter L";
+beginchar("L",12u#-width_adj#,cap_height#,0);
+adjust_fit(cap_serif_fit#,0);
+pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
+lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); top y1=h; bot y2=0;
+filldraw stroke z1e--z2e; % stem
+pos21(doublestroke_thin,0); pos22(doublestroke_thin,0);
+lft x21l=lft x22l=rt x1r+doublestroke_dist; y21=y1; y22=y2;
+filldraw stroke z21e--z22e; % stroke
+pickup crisp.nib; pos3(slab,-90); pos4(hair,0);
+bot y3r=0; x3=x22; y4=y3l+7/6beak+eps; rt x4r=hround(w-.75u);
+arm(3,4,e,1.2beak_darkness,beak_jut); % lower arm and beak
+if serifs: nodish_serif(1,2,a,1/3,cap_jut,b,0,1.25cap_jut); % upper serif
+ nodish_serif(21,22,f,0,cap_jut,g,1/3,1.25cap_jut); % upper stroke serif
+ nodish_serif(2,1,c,1/3,cap_jut,d,0,.5cap_jut); % lower serif
+ nodish_serif(22,21,h,0,cap_jut,j,1/3,.5cap_jut); fi % lower stroke serif
+math_fit(0,u#); penlabels(1,2,3,4); endchar;
+
+cmchar "The letter M";
+beginchar("M",17.5u#+width_adj#,cap_height#,0);
+italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
+adjust_fit(cap_serif_fit#,cap_serif_fit#);
+numeric stem[]; % thicknesses of the four strokes
+stem1=hround(fudged.hair+stem_corr);
+stem2=hround(fudged.cap_stem-4stem_corr);
+stem3=hround(fudged.hair-stem_corr);
+stem4=hround(fudged.cap_stem-3stem_corr);
+if stem4<stem1: stem4:=stem1; fi
+pickup tiny.nib; pos1(stem1,0); pos2(stem1,0);
+pos3(stem4,0); pos4(stem4,0);
+pos11(doublestroke_thick,0); pos12(doublestroke_thick,0);
+x1=x2; x3=x4;
+top y1=top y3=h; bot y2=bot y4=0;
+lft x1l=rt x11r+doublestroke_dist;
+x11l=w-x3r; x12=x11; y11=y1; y12=y2;
+rt x3r=hround min(w-2u,w-3u+.5stem4);
+filldraw stroke z1e--z2e; % left stem
+filldraw stroke z3e--z4e; % right stem
+filldraw stroke z11e--z12e; % stroke
+penpos5(stem2,0); penpos6(stem2,0); penpos7(stem3,0); penpos8(stem3,0);
+x5l=x1; x6l=x7l; x8=lft x3l; x6-x5=x8-x7; y5=y8=h; y6=y7;
+if hefty: y6=if monospace: vround 1/3h else: o fi;
+ numeric upper_notch,lower_notch;
+ upper_notch=h-cap_notch_cut; lower_notch=y6+cap_notch_cut;
+ x1'=rt x1r; z1'=whatever[z5l,z6l]; x3'=lft x3l; z3'=whatever[z7r,z8r];
+ z0=whatever[z5r,z6r]=whatever[z7l,z8l];
+ fill z5l..
+ if y1'<upper_notch: {right}(x1'+1,upper_notch){down}... fi
+ {z6-z5}diag_in(5l,6l,1,6r)..diag_out(7l,1,7r,8r){z8-z7}
+ if y3'<upper_notch: ...{up}(x3'-1,upper_notch){right} fi
+ ..z8r--diag_out(8r,1,8l,7l){z7-z8}
+ if y0<=lower_notch: ..{z7-z8}z0{z5-z6}..
+ else: ...{down}(x0+.5,lower_notch)--(x0-.5,lower_notch){up}... fi
+ {z5-z6}diag_in(6r,5r,1,5l)--cycle; % diagonals
+else: y6=0; z0=whatever[z5r,z6r]=whatever[z7l,z8l];
+ fill z5l..{z6-z5}diag_in(5l,6l,1,6r)..diag_out(7l,1,7r,8r){z8-z7}
+ ..z8r--diag_out(8r,1,8l,7l){z7-z8}..{z7-z8}z0{z5-z6}
+ ..{z5-z6}diag_in(6r,5r,1,5l)--cycle; fi % diagonals
+if serifs: serif(1,2,a,0,-cap_jut-doublestroke_dist); % upper left serif
+ serif(11,12,g,1/3,-cap_jut); % upper stroke serif
+ nodish_serif(2,1,b,0,cap_jut+doublestroke_dist,c,1/3,cap_jut)(dark); % lower left serif
+ nodish_serif(12,11,h,1/3,cap_jut,i,0,cap_jut+doublestroke_dist)(dark); % lower stroke serif
+ serif(3,4,d,1/3,cap_jut); % upper right serif
+ nodish_serif(4,3,e,1/3,cap_jut,f,1/3,cap_jut); fi % lower right serif
+math_fit(0,max(.5ic#-.5u#,0));
+penlabels(0,1,1',2,3,3',4,5,6,7,8); endchar;
+
+cmchar "The letter N";
+beginchar("N",14.5u#+width_adj#,cap_height#,0);
+italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
+adjust_fit(cap_serif_fit#,cap_serif_fit#);
+numeric thin_stem; thin_stem=hround(fudged.hair+stem_corr);
+pickup tiny.nib; pos1(thin_stem,0); pos2(thin_stem,0);
+pos3(thin_stem,0); pos4(thin_stem,0);
+pos11(doublestroke_thick,0); pos12(doublestroke_thick,0);
+pickup tiny.nib; top y1=top y3=h; bot y2=bot y4=0;
+x1=x2; x3=x4;
+lft x1l=rt x11r+doublestroke_dist;
+x11l=w-x3r; x12=x11;
+y11=y1; y12=y2;
+rt x3r=hround min(w-2u,w-3u+.5fudged.cap_stem);
+filldraw stroke z1e--z2e; % left stem
+filldraw stroke z3e--z4e; % right stem
+filldraw stroke z11e--z12e; % stroke
+if hefty: penpos5(fudged.cap_stem,0); penpos6(fudged.cap_stem,0);
+ x5l=x1; x6r=x4; y5=h; y6=0;
+ numeric upper_notch,lower_notch;
+ upper_notch=h-cap_notch_cut; lower_notch=cap_notch_cut;
+ x1'=rt x1r; z1'=whatever[z5l,z6l]; x4'=lft x4l; z4'=whatever[z5r,z6r];
+ fill z5l..
+ if y1'<upper_notch: {right}(x1'+1,upper_notch){down}... fi
+ {z6-z5}diag_in(5l,6l,1,6r)--z6r..
+ if y4'>lower_notch: {left}(x4'-1,lower_notch){up}... fi
+ {z5-z6}diag_in(6r,5r,1,5l)--cycle; % diagonal
+else: penpos5(whatever,0); penpos6(whatever,90);
+ z5l=z1l; z6l=z4l;
+ z7=z6l+(max(eps,cap_stem-3stem_corr-tiny),0) rotated (angle(z5l-z6l)-90);
+ z5r=z7+whatever*(z5l-z6l); z6r=z7+whatever*(z5l-z6l);
+ filldraw stroke z5e..z6e; fi % diagonal
+if serifs: if hefty: serif(1,2,a,0,-cap_jut-doublestroke_dist); % upper left serif
+ serif(11,12,g,1/3,-cap_jut); % upper stroke serif
+ else: serif(5,6,a,0,-cap_jut-doublestroke_dist); % upper left serif
+ serif(11,12,g,1/3,-cap_jut); fi % upper stroke serif
+ nodish_serif(2,1,b,0,cap_jut+doublestroke_dist,c,1/3,cap_jut)(dark); % lower left serif
+ nodish_serif(12,11,h,1/3,cap_jut,i,0,cap_jut+doublestroke_dist)(dark); % lower stroke serif
+ nodish_serif(3,4,e,1/2,cap_jut,f,1/2,cap_jut)(dark); fi % upper right serif
+math_fit(0,max(.5ic#-.5u#,0)); penlabels(1,1',2,3,4,4',5,6,7); endchar;
+
+cmchar "The letter O";
+beginchar("O",14u#-width_adj#,cap_height#,0);
+italcorr .7cap_height#*slant-.5u#;
+adjust_fit(0,0);
+penpos1(vair',90); penpos3(vround(vair+1.5vair_corr),-90);
+penpos2(cap_curve,180); penpos4(cap_curve,0);
+if monospace: x2r=hround 1.5u;
+ interim superness:=sqrt superness; % make |"O"|, not |"0"|
+else: x2r=hround u; fi
+x4r=w-x2r; x1=x3=.5w; y1r=h+o; y3r=-o;
+y2=y4=.5h-vair_corr; y2l:=y4l:=.52h;
+penstroke pulled_super_arc.e(1,2)(.5superpull)
+ & pulled_super_arc.e(2,3)(.5superpull)
+ & pulled_super_arc.e(3,4)(.5superpull)
+ & pulled_super_arc.e(4,1)(.5superpull) & cycle; % bowl
+curve_stroke(s,rt x2l+doublestroke_curvedist,doublestroke_thin,
+ pulled_super_arc.r(4,1)(.5superpull)
+ & pulled_super_arc.r(1,2)(.5superpull),
+ pulled_super_arc.r(2,3)(.5superpull)
+ & pulled_super_arc.r(3,4)(.5superpull)); % stroke
+math_fit(-.3cap_height#*slant-.5u#,ic#-.5u#); penlabels(1,2,3,4); endchar;
+
+cmchar "The letter P";
+beginchar("P",13u#,cap_height#,0);
+italcorr .75cap_height#*slant-.5u#;
+adjust_fit(cap_serif_fit#,0);
+pickup tiny.nib; penpos1(cap_stem-tiny,0); penpos2(cap_stem-tiny,0);
+lft x1l=hround max(2u,3u-.5cap_stem); top y1=h; bot y2=0; x1l=x2l;
+filldraw stroke z1e--z2e; % stem
+pos21(doublestroke_thin,0); pos22(doublestroke_thin,0);
+lft x21l=lft x22l=rt x1r+doublestroke_dist; y21=y1; y22=y2;
+filldraw stroke z21e--z22e; % stroke
+penpos3(cap_band,90); penpos4(cap_band,90);
+penpos5(cap_curve if hefty:-3stem_corr fi,0);
+penpos6(.5[vair,cap_band],-90); penpos7(.5[vair,cap_band],-90);
+z3r=top z21; y4=y3; y5=.5[y4l,y6l]; y6=y7;
+x7=x22; y7l=vround .5h; x4=x6=.5w+.75u; x5r=hround(w-u);
+x4l:=x6l:=x4-.25cap_curve;
+fill stroke z3e..pulled_arc.e(4,5) & pulled_arc.e(5,6)..z7e; % lobe
+if serifs: nodish_serif(1,2,a,1/3,cap_jut,b,0,.5cap_jut+doublestroke_dist); % upper serif
+ nodish_serif(21,22,e,0,cap_jut+doublestroke_dist,f,1/3,.5cap_jut); % upper stroke serif
+ nodish_serif(2,1,c,1/3,cap_jut,d,0,cap_jut+doublestroke_dist); % lower stroke serif
+ nodish_serif(22,21,g,0,cap_jut+doublestroke_dist,h,1/3,cap_jut); fi % lower serif
+math_fit(0,ic#-2.5u#); penlabels(0,1,2,3,4,5,6,7); endchar;
+
+cmchar "The letter Q";
+beginchar("Q",14u#-width_adj#,cap_height#,comma_depth#);
+italcorr .7cap_height#*slant-.5u#;
+adjust_fit(0,0);
+numeric light_curve; light_curve=cap_curve-hround stem_corr;
+penpos1(vair',90); penpos3(vair',-90);
+penpos2(light_curve,180); penpos4(light_curve,0);
+if monospace: x2r=hround 1.5u;
+ interim superness:=sqrt superness; % make |"Q"| like |"O"|
+else: x2r=hround u; fi
+x4r=w-x2r; x1=x3=.5w; y1r=h+o; y2=y4=.5h-vair_corr; y3r=-o;
+penstroke pulled_super_arc.e(1,2)(.5superpull)
+ & pulled_super_arc.e(2,3)(.5superpull)
+ & pulled_super_arc.e(3,4)(.5superpull)
+ & pulled_super_arc.e(4,1)(.5superpull) & cycle; % bowl
+curve_stroke(s,rt x2l+doublestroke_curvedist,doublestroke_thin,
+ pulled_super_arc.r(4,1)(.5superpull)
+ & pulled_super_arc.r(1,2)(.5superpull),
+ pulled_super_arc.r(2,3)(.5superpull)
+ & pulled_super_arc.r(3,4)(.5superpull)); % stroke
+pickup tiny.nib;
+if hefty: penpos5(1.2(.5[cap_bar,light_curve]),0); penpos6(1.2light_curve,0);
+ x5=.5w; x6r=hround(w-1.5u);
+ y5=vround .28h; y6=-d;
+ fill diag_end(6r,5r,.25,1,5l,6l)--diag_end(5l,6l,.5,1,6r,5r)--cycle; % tail
+else: pos3'(vair,270); pos5(vair,180); pos6(vair,90);
+ pos7(cap_curve,85); penpos8(eps,180);
+ z3'=z3; x6=x3; top y6r=vround(.2h+.5vair);
+ lft x5r=hround(.5w-1.25u-.5vair); y5=.5[y3,y6];
+ bot y7l=-d; x7l=2/3[x6,x8]; y8=0; rt x8=hround(x4r+.1u);
+ filldraw stroke z3'e{left}...z5e{up}...z6e{right}
+ ..z7e{right}...z8e{up}; fi % tail
+math_fit(-.3cap_height#*slant-.5u#,ic#);
+penlabels(1,2,3,4,5,6,7,8); endchar;
+
+cmchar "The letter R";
+beginchar("R",if serifs: 13u#+.5max(2u#,cap_curve#)
+ else:13.5u#-.5width_adj# fi,cap_height#,0);
+italcorr .75cap_height#*slant- if serifs: 1.75 else: .5 fi\\ u#;
+adjust_fit(cap_serif_fit#,0);
+pickup tiny.nib; pos1(cap_stem',0); pos2(cap_stem',0);
+lft x1l=lft x2l=hround max(2u,3u-.5cap_stem'); top y1=h; bot y2=0;
+filldraw stroke z1e--z2e; % stem
+pos21(doublestroke_thin,0); pos22(doublestroke_thin,0);
+lft x21l=lft x22l=rt x1r+doublestroke_dist; y21=y1; y22=y2;
+filldraw stroke z21e--z22e; % stroke
+penpos3(cap_band,90); penpos4(cap_band,90);
+penpos5(cap_curve if hefty:-3stem_corr fi,0);
+penpos6(vair,-90); penpos7(vair,-90);
+z3r=top z21; y4=y3; y5=.5[y4l,y6l]; y6=y7;
+x7=x22; y7l=vround(.5h+.5vair); x4=x6;
+if serifs: x4=.5w-.5u; x5r=hround(w-2.25u);
+else: x4=.5w+.5u; x5r=hround(w-u); fi
+x4l:=x6l:=x4-.125cap_curve;
+fill stroke z3e..pulled_arc.e(4,5) & pulled_arc.e(5,6)..z7e; % lobe
+if serifs: pos6'(vair,-90); pos0(cap_stem,180);
+ pos8(cap_curve,180); pos9(vair,-90); pos10(hair,0);
+ z6'=z6; lft x0r=lft x8r=hround(x5-2/3u-.5cap_curve);
+ y8=1/3[y2,y7]; y0=3/5[y2,y7]; x9=.5[x8l,x10r];
+ bot y9r=-o; rt x10r=hround(w-.05u); y10=1/4[y2,y7];
+ filldraw stroke z6'e{right}..z0e---z8e....z9e{right}..z10e{up}; % tail
+ nodish_serif(1,2,a,1/3,cap_jut,b,0,.5cap_jut+doublestroke_dist); % upper serif
+ nodish_serif(21,22,e,0,cap_jut+doublestroke_dist,f,1/3,.5cap_jut); % upper stroke serif
+ nodish_serif(2,1,c,1/3,cap_jut,d,0,cap_jut+doublestroke_dist); % lower serif
+ nodish_serif(22,21,g,0,cap_jut+doublestroke_dist,h,1/3,cap_jut); % lower stroke serif
+else: penpos8(cap_stem-2stem_corr,0); penpos9(cap_stem,0);
+ x8=x6+.5u; y8=y6; x9r=hround(w-.5u); y9=0;
+ fill z8l--diag_end(8l,9l,.5,1,9r,8r)--z8r--cycle; fi % tail
+math_fit(0,.75ic#); penlabels(0,1,2,3,4,5,6,7,8,9,10); endchar;
+
+cmchar "The letter S";
+beginchar("S",10u#,cap_height#,0);
+italcorr cap_height#*slant-u#;
+adjust_fit(0,0);
+numeric theta; theta=90-angle(50u,h); slope:=-h/50u; % angle at middle
+numeric s_slab; s_slab=if serifs:slab else:vround .2[slab,cap_stem] fi;
+numeric ess'; ess'=max(fine.breadth,cap_ess);
+pickup fine.nib; pos2(max(fine.breadth,s_slab-vround vair_corr),-90);
+pos0(ess',theta); pos7(s_slab,-90);
+x2+x7=2x0=w; x7-x2=if serifs: u else: 0 fi; top y2l=h+o; bot y7r=-o;
+y0=.52h; lft x3l=hround u; rt x6r=hround(w-u);
+x3r-x3l=x6r-x6l=hround .5[s_slab,ess']-fine;
+ellipse_set(2l,3l,4l,0l); ellipse_set(2r,3r,4r,0r); y3=y3r;
+ellipse_set(7l,6l,5l,0l); ellipse_set(7r,6r,5r,0r); y6=y6r;
+filldraw stroke super_arc.e(2,3) & z3e{down}
+ ..z4e---z5e..z6e{down} & super_arc.e(6,7); % main stroke
+if serifs: pos1(hair,180); pos8(hair,180);
+ rt x1l=hround(w-1.5u); lft x8r=hround u;
+ bot y1=vround 2/3h+1; top y8=vround 1/3h-1;
+ filldraw stroke z1e{x2-x1,10(y2-y1)}....{left}z2e; % upper arc
+ filldraw stroke z7e{left}....{up}z8e; % lower arc
+ if rt x3r+2doublestroke_curvedist+doublestroke_thin>lft x6l:
+ curve_stroke(s,x0-0.5doublestroke_thin,doublestroke_thin,
+ z1l{x2-x1,10(y2-y1)}....{left}z2l & super_arc.l(2,3),
+ super_arc.r(6,7) & z7r{left}....{up}z8r); % stroke
+ else:
+ curve_stroke(s,rt x3r+doublestroke_curvedist,doublestroke_thin,
+ z1l{x2-x1,10(y2-y1)}....{left}z2l & super_arc.l(2,3),
+ z3l{down}..z4l---z5l..z6l{down}); % left stroke
+ curve_stroke(t,lft x6l-doublestroke_curvedist,-doublestroke_thin,
+ super_arc.r(6,7) & z7r{left}....{up}z8r,
+ z3r{down}..z4r---z5r..z6r{down}); % right stroke
+ fi
+ path upper_arc, lower_arc;
+ upper_arc=z1{x2-x1,10(y2-y1)}....{left}z2;
+ lower_arc=z7{left}....{up}z8;
+ pos10(.3[fine.breadth,cap_hair],0); pos9(.3[fine.breadth,cap_hair],0);
+ x10r=x1l; top y10=top y2l; x9l=x8r; bot y9=bot y7r;
+ x1l-x1'=x8'-x8r=1.6cap_curve-fine; y1'=y1; y8'=y8;
+ numeric t; t=xpart(upper_arc intersectiontimes(z10l--z1'));
+ filldraw z1l--z10r--z10l--subpath(t,0) of upper_arc--cycle; % upper barb
+ t:=xpart(lower_arc intersectiontimes(z9r--z8'));
+ filldraw z8r--z9l--z9r--subpath(t,1) of lower_arc--cycle; % lower barb
+else: pos1(1.2flare,-100); pos8(1.2flare,-100);
+ x1l=good.x(x1l+w-1.75u-rt x1); lft x8r=hround .8u;
+ top y1l=vround .93h+o; bot y8r=vround .1h-o;
+ filldraw stroke term.e(2,1,right,.9,4); % upper arc and terminal
+ filldraw stroke term.e(7,8,left,1,4); % lower arc and terminal
+ if rt x3r+2doublestroke_curvedist+doublestroke_thin>lft x6l:
+ curve_stroke(s,x0-0.5doublestroke_thin,doublestroke_thin,
+ (reverse(term.l(2,1,right,.9,4))) & super_arc.l(2,3),
+ super_arc.r(6,7) & term.r(7,8,left,1,4)); % stroke
+ else:
+ curve_stroke(s,rt x3r+doublestroke_curvedist,doublestroke_thin,
+ (reverse(term.l(2,1,right,.9,4))) & super_arc.l(2,3),
+ z3l{down}..z4l---z5l..z6l{down}); % left stroke
+ curve_stroke(t,lft x6l-doublestroke_curvedist,-doublestroke_thin,
+ super_arc.r(6,7) & term.r(7,8,left,1,4),
+ z3r{down}..z4r---z5r..z6r{down}); fi % right stroke
+ fi
+math_fit(0,.5ic#); penlabels(0,1,1',2,3,4,5,6,7,8,8',9,10); endchar;
+
+cmchar "The letter T";
+beginchar("T",13.5u#-width_adj#,cap_height#,0);
+italcorr cap_height#*slant-beak_jut#-.25u#;
+adjust_fit(0,0);
+h:=vround(h-2stem_corr);
+pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
+pos21(doublestroke_thin,0); pos22(doublestroke_thin,0);
+lft x1l=lft x2l=w-rt x21r;
+top y1=h; bot y2=0;
+lft x21l=lft x22l=rt x1r+doublestroke_dist; y21=y1; y22=y2;
+filldraw stroke z1e--z2e; % stem
+filldraw stroke z21e--z22e; % stroke
+pickup crisp.nib; pos3(slab,90); pos4(hair,0);
+top y3r=h; x3=x1; rt x4r=hround(w-.65u); y4=good.y(y3l-beak)-eps;
+arm(3,4,e,beak_darkness,.7beak_jut); % right arm and beak
+pos5(hair,180); x5=w-x4; y5=y4;
+pos6(slab,90); top y6r=h; x6=x21;
+arm(6,5,f,beak_darkness,-.7beak_jut); % left arm and beak
+if serifs: nodish_serif(2,1,c,1/3,1.05cap_jut,
+ d,0,1.05cap_jut+doublestroke_dist); % lower serif
+ nodish_serif(22,21,g,0,1.05cap_jut+doublestroke_dist,
+ h,1/3,1.05cap_jut); % lower stroke serif
+ nodish_serif(1,2,a,1/3,.5cap_jut,
+ b,0,.5cap_jut+doublestroke_dist); % upper bracketing
+ nodish_serif(21,22,i,0,.5cap_jut+doublestroke_dist,
+ j,1/3,.5cap_jut); fi % upper stroke bracketing
+math_fit(-.75cap_height#*slant,ic#-2.5u#); penlabels(1,2,3,4,5,6); endchar;
+
+cmchar "The letter U";
+beginchar("U",14u#+.5width_adj#,cap_height#,0);
+italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
+if monospace: adjust_fit(cap_serif_fit#-.5u#,cap_serif_fit#-.5u#)
+else: adjust_fit(cap_serif_fit#,cap_serif_fit#) fi;
+pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
+pos2'(cap_stem,180); z2'=z2;
+pos3(cap_band,-90);
+pos4(cap_hair,0); pos5(cap_hair,0);
+x1=x2; x3=.5[x1,x5]; x4=x5; x1l=w-x5r;
+top y1=top y5=h; y2=y4=1/3h; bot y3r=-o;
+lft x1l=hround max(2u,3u-.5cap_stem);
+filldraw stroke z1e--z2e; % left stem
+filldraw stroke pulled_arc.e(2',3)
+ & pulled_arc.e(3,4)&z4e--z5e; % arc and right stem
+z21=0.5[z21l,z21r]; z22=0.5[z22l,z22r]; z23=0.5[z23l,z23r];
+y21l=y21r=y1; lft x22l=lft x21l=rt x1r+doublestroke_dist;
+y22r=y22l=-h; rt x22r=rt x21r=lft x22l+doublestroke_thin;
+z23l=(pulled_arc.r(2',3) & pulled_arc.r(3,4))intersectionpoint(z21l..z22l);
+z23r=(pulled_arc.r(2',3) & pulled_arc.r(3,4))intersectionpoint(z21r..z22r);
+filldraw stroke z21e--z23e; % stroke
+if serifs: nodish_serif(1,2,a,1/3,cap_jut,b,0,cap_jut+doublestroke_dist); % left serif
+ nodish_serif(21,23,e,0,cap_jut+doublestroke_dist,f,1/3,cap_jut); % stroke serif
+ nodish_serif(5,4,c,1/2,cap_jut,d,1/2,cap_jut)(dark); fi % right serif
+math_fit(-cap_serif_fit#-.3cap_height#*slant-min(cap_height#*slant,u#),
+ max(.5ic#-.5u#,0)); penlabels(1,2,3,4,5); endchar;
+
+cmchar "The letter V";
+beginchar("V",14u#,cap_height#,0);
+italcorr cap_height#*slant+.25u#;
+adjust_fit(cap_serif_fit#,cap_serif_fit#);
+numeric left_stem,right_stem,outer_jut,alpha;
+left_stem=cap_stem-stem_corr;
+right_stem=min(cap_hair if hefty:-2stem_corr fi,left_stem);
+outer_jut=.75cap_jut; x1l=w-x4r=l+letter_fit+outer_jut+.25u;
+y1=y4=y11=h; y2=y3=y12=-0.4*apex_o;
+if doublestroke_twist:
+ alpha=diag_ratio(2,left_stem,y11-y12,x4r-x1l);
+else:
+ alpha=diag_ratio(2,left_stem+doublestroke_dist+right_stem,
+ y11-y12,x4r-x1l-apex_corr);
+fi
+penpos1(alpha*left_stem,0); penpos2(alpha*left_stem,0);
+penpos3(alpha*right_stem,0); penpos4(alpha*right_stem,0);
+penpos11(alpha*doublestroke_thin,0); penpos12(alpha*doublestroke_thin,0);
+x12-x11=x4-x3;
+if doublestroke_twist:
+ x2r=x3r;
+else:
+ x12l+apex_corr=x3l;
+fi
+x1r+alpha*doublestroke_dist=x11l; x2r+alpha*doublestroke_dist=x12l;
+z0=whatever[z11r,z12r]=whatever[z3l,z4l];
+if doublestroke_twist:
+ z15=whatever[z11l,z12l]=whatever[z3l,z4l];
+ z16=whatever[z1r,z2r]=whatever[z3l,z4l];
+ fill z16--diag_end(16,4l,1,1,4r,3r)--diag_end(4r,3r,1,1,2l,1l)
+ --diag_end(2l,1l,1,1,1r,16)--cycle; % stroke and right diagonal
+ fill z15--diag_end(15,11l,1,1,11r,0)
+ --z0--cycle; % left diagonal
+else:
+ fill z0--diag_end(0,4l,1,1,4r,3r)--diag_end(4r,3r,1,1,12l,11l)
+ --diag_end(12l,11l,1,1,11r,0)--cycle; % left and right diagonals
+ fill diag_end(2l,1l,1,1,1r,2r)
+ --diag_end(1r,2r,1,1,2l,1l)--cycle; % stroke
+fi
+if serifs: numeric inner_jut; pickup tiny.nib;
+ prime_points_inside(1,2); prime_points_inside(4,3);
+ prime_points_inside(11,12);
+ if rt x11'r+cap_jut+.5u+1<=lft x4'l-cap_jut: inner_jut=cap_jut;
+ else: rt x11'r+inner_jut+.5u+1=lft x4'l-inner_jut; fi
+ nodish_serif(1',2,a,1/3,outer_jut,
+ b,0,inner_jut+alpha*doublestroke_dist); % left serif
+ nodish_serif(11',12,e,0,outer_jut+alpha*doublestroke_dist,
+ f,1/2,inner_jut); % left stroke serif
+ nodish_serif(4',3,c,.6,inner_jut,d,1/2,outer_jut)(dark); % right serif
+ if not doublestroke_twist:
+ z13=whatever[z11,z12]; z14=whatever[z1,z2];
+ y13=y14=y12+slab;
+ fill z12--z2--z14--z13--cycle; fi % bottom closure
+ fi
+math_fit(.75u#-cap_height#*slant,ic#-4u#); penlabels(0,1,2,3,4); endchar;
+
+cmchar "The letter W";
+beginchar("W",19u#,cap_height#,0);
+italcorr cap_height#*slant+.25u#;
+adjust_fit(cap_serif_fit#,cap_serif_fit#);
+numeric stem[],outer_jut,upper_notch,alpha,mid_corr;
+outer_jut=.7cap_jut; x1l=w-x8r=l+letter_fit+outer_jut+.25u;
+stem1=fudged.cap_stem-stem_corr;
+stem4=min(fudged.hair if hefty:-2stem_corr fi,stem1);
+stem2=stem4 if hefty:-2stem_corr fi;
+stem3=stem1 if hefty:-2stem_corr fi;
+mid_corr=if monospace or hefty:-apex_corr else: 1/3jut fi;
+y1=y8=y11=h; y2=y3=y12=-0.4*apex_o; y6=y7=-if doublestroke_twist:0.4 fi apex_o;
+if doublestroke_twist:
+ alpha=diag_ratio(4,stem1,y1-y2,x8r-x1l+mid_corr-2apex_corr);
+else:
+ alpha=diag_ratio(4,stem1+stem2-stem3+stem4+doublestroke_dist,
+ y1-y2,x8r-x1l+mid_corr-2apex_corr);
+fi
+penpos1(alpha*stem1,0); penpos2(alpha*stem1,0);
+penpos3(alpha*stem2,0); penpos4(alpha*stem2,0);
+penpos5(alpha*stem3,0); penpos6(alpha*stem3,0);
+penpos7(alpha*stem4,0); penpos8(alpha*stem4,0);
+penpos11(alpha*doublestroke_thin,0); penpos12(alpha*doublestroke_thin,0);
+x11l=x1r+alpha*doublestroke_dist; x12l=x2r+alpha*doublestroke_dist;
+x12-x11=x4-x3=x6-x5=x8-x7;
+if doublestroke_twist:
+ x2r=x3r; x6r=x7r;
+else:
+ x12l+apex_corr=x3l; x6l+apex_corr=x7l;
+fi
+y4=y5=if monospace: vround .6 fi\\ h;
+x4l-x1l=floor(x4l-x1l+.5(x5r+mid_corr-x4r)); % |x5r+mid_corr| $\approx$ |x4r|
+z45=whatever[z3r,z4r]=whatever[z5l,z6l];
+z67=whatever[z5r,z6r]=whatever[z7l,z8l]; upper_notch=y4-cap_notch_cut;
+if doublestroke_twist:
+ z23=whatever[z11r,z12r]=whatever[z3l,z4l];
+ z15=whatever[z11l,z12l]=whatever[z3l,z4l];
+ z16=whatever[z1r,z2r]=whatever[z3l,z4l];
+ fill diag_end(1l,2l,1,1,3r,4r){z4-z3}...z45&z45
+ ...{z6-z5}diag_end(5l,6l,1,1,7r,8r)--diag_end(7r,8r,1,1,8l,7l){z7-z8}
+ ...z67&z67...{z5-z6}special_diag_end(6,5,4,3){z3-z4}...z16&z16
+ ...{z1-z2}diag_end(2r,1r,1,1,1l,2l)--cycle; % Stroke and diagonals
+ fill z15--diag_end(15,11l,1,1,11r,23)
+ --z23--cycle; % left stem
+else:
+ z23=whatever[z11r,z12r]=whatever[z3l,z4l];
+ fill diag_end(11l,12l,1,1,3r,4r){z4-z3}...z45&z45
+ ...{z6-z5}diag_end(5l,6l,1,1,7r,8r)--diag_end(7r,8r,1,1,8l,7l){z7-z8}
+ ...z67&z67...{z5-z6}special_diag_end(6,5,4,3){z3-z4}...z23&z23
+ ...{z11-z12}diag_end(12r,11r,1,1,11l,12l)--cycle; % Stroke and diagonals
+ fill diag_end(2r,1r,1,1,1l,2l)
+ --diag_end(1l,2l,1,1,2r,1r)--cycle; % left stem
+fi
+if serifs: numeric inner_jut[]; pickup tiny.nib;
+ prime_points_inside(1,2); prime_points_inside(5,6); prime_points_inside(8,7);
+ prime_points_inside(11,12);
+ if monospace: inner_jut1=inner_jut4=1.5cap_jut;
+ elseif hefty: inner_jut1=inner_jut4=cap_jut;
+ else: fill diag_end(6r,5r,1,1,5l,6l)--.9[z5l,z6l]
+ ..{z5-z6}.1[z5r,z6r]--cycle; % middle stem
+ inner_jut2=.7inner_jut1; inner_jut4=1.1inner_jut3;
+ if rt x11'r+cap_jut+.5u+1<=lft x5'l-.7cap_jut: inner_jut1=cap_jut;
+ else: rt x11'r+inner_jut1+.5u+1=lft x5'l-inner_jut2; fi
+ if rt x5'r+1.1cap_jut+.5u+1<=lft x8'l-1.21cap_jut: inner_jut3=cap_jut;
+ else: rt x5'r+inner_jut3+.5u+1=lft x8'l-inner_jut4; fi
+ nodish_serif(5',6,e,1/3,inner_jut2,f,1/2,inner_jut3); fi % middle serif
+ nodish_serif(1',2,a,1/3,outer_jut,
+ b,0,inner_jut1+alpha*doublestroke_dist); % left serif
+ nodish_serif(11',12,g,0,outer_jut+alpha*doublestroke_dist,
+ h,1/2,inner_jut1); % stroke serif
+ nodish_serif(8',7,c,.6,inner_jut4,d,1/2,outer_jut)(dark); % right serif
+ if not doublestroke_twist:
+ z13=whatever[z11,z12]; z14=whatever[z1,z2];
+ y13=y14=y12+slab;
+ fill z12--z2--z14--z13--cycle; fi % bottom closure
+ fi
+math_fit(.75u#-cap_height#*slant,ic#-2.5u#);
+penlabels(0,1,2,3,4,5,6,7,8,23,45,67); endchar;
+
+cmchar "The letter X";
+beginchar("X",15u#,cap_height#,0);
+italcorr cap_height#*slant-.25u#;
+adjust_fit(cap_serif_fit#,cap_serif_fit#);
+numeric stem[],outer_jut,xjut,alpha[];
+stem1=cap_stem-2stem_corr; stem2=min(cap_hair,stem1);
+outer_jut=.75cap_jut; xjut= if serifs: (stem1-stem2)/4 else: 0 fi;
+x2r=r-letter_fit-1u-outer_jut-xjut;
+x3l=l+letter_fit+.75u+outer_jut+xjut;
+y1=y2=h; y3=y4=0;
+y21=y1; y22=y4;
+x1l=l+letter_fit+.25u+outer_jut; x22r=r-letter_fit-.25u-outer_jut;
+alpha1=diag_ratio(1,stem1+doublestroke_dist,h,x22r-x1l);
+alpha2=diag_ratio(1,stem2,h,x2r-x3l);
+penpos1(alpha1*stem1,0); penpos4(alpha1*stem1,0);
+penpos21(alpha1*doublestroke_thin,0); penpos22(alpha1*doublestroke_thin,0);
+penpos3(alpha2*stem2,0); penpos2(alpha2*stem2,0);
+x21l=x1r+alpha1*doublestroke_dist; x4r+alpha1*doublestroke_dist=x22l;
+z31l=whatever[z2l,z3l]=whatever[z21,z22];
+z31r=whatever[z2r,z3r]=whatever[z21,z22];
+z32l=whatever[z2l,z3l]=whatever[z1,z4];
+z32r=whatever[z2r,z3r]=whatever[z1,z4];
+fill diag_end(4r,1r,.5,1,1l,4l)
+ --diag_end(1l,4l,.5,1,4r,1r)--cycle; % left diagonal
+fill diag_end(22r,21r,.5,1,21l,22l)
+ --diag_end(21l,22l,.5,1,22r,21r)--cycle; % stroke diagonal
+fill diag_end(2l,3l,.5,1,3r,2r)--z32r--z32l--cycle; % right diagonal, lower part
+fill diag_end(3r,2r,.5,1,2l,3l)--z31l--z31r--cycle; % right diagonal, upper part
+if serifs: numeric inner_jut[]; pickup tiny.nib;
+ prime_points_inside(1,4); prime_points_inside(2,3);
+ prime_points_inside(3,2); prime_points_inside(4,1);
+ prime_points_inside(21,22); prime_points_inside(22,21);
+ if rt x21'r+cap_jut+.5u+1<=lft x2'l-cap_jut-xjut: inner_jut1=cap_jut;
+ else: rt x21'r+inner_jut1+.5u+1=lft x2'l-inner_jut1-xjut; fi
+ if rt x3'r+cap_jut+.5u+1<=lft x22'l-cap_jut-xjut: inner_jut2=cap_jut;
+ else: rt x3'r+inner_jut2+.5u+1=lft x22'l-inner_jut2-xjut; fi
+ nodish_serif(1',4,a,1/3,outer_jut,
+ b,0,inner_jut1+doublestroke_dist); % upper left serif
+ nodish_serif(21',22,i,0,outer_jut+doublestroke_dist,
+ j,2/3,inner_jut1); % upper left stroke serif
+ nodish_serif(4',1,c,2/3,inner_jut2,
+ d,0,outer_jut+doublestroke_dist); % lower right serif
+ nodish_serif(22',21,k,0,inner_jut2+doublestroke_dist,
+ l,1/3,outer_jut); % lower right stroke serif
+ nodish_serif(2',3,e,2/3,inner_jut1+xjut,
+ f,1/2,outer_jut+xjut)(dark); % upper right serif
+ nodish_serif(3',2,g,1/2,outer_jut+xjut,
+ h,2/3,inner_jut2+xjut)(dark); fi % lower left serif
+math_fit(0,.5ic#); penlabels(0,1,2,3,4,12,13,24,34); endchar;
+
+cmchar "The letter Y";
+beginchar("Y",14u#,cap_height#,0);
+italcorr cap_height#*slant+.45u#;
+adjust_fit(cap_serif_fit#,cap_serif_fit#);
+numeric left_stem,right_stem,outer_jut,dy,alpha;
+left_stem=cap_stem-stem_corr;
+right_stem=min(cap_hair if hefty:-2stem_corr fi,left_stem);
+outer_jut=.75cap_jut;
+penpos6(left_stem,0); penpos16(doublestroke_thin,0);
+x6l=w-x16r; x6r+doublestroke_dist=x16l;
+x1l=w-x4r=l+letter_fit+outer_jut+.05u;
+penpos15(doublestroke_thin,0); x15=x16; y16=0; y15l=.4h; y1l=h;
+alpha=diag_ratio(1,left_stem+doublestroke_dist,y1l-y15l,x15l-x1l);
+penpos1(alpha*left_stem,0); penpos11(alpha*doublestroke_thin,0);
+penpos3(alpha*right_stem,0); penpos4(alpha*right_stem,0);
+penpos12(alpha*doublestroke_thin,0);
+x1r+alpha*doublestroke_dist=x11l;
+x3r=x15r; x12l=x15l;
+y6=y16; y1=y4=y11; y3=y12=y15;
+z1l-z2l=whatever*(z11-z12); z6l-z2l=whatever*(z15-z16);
+z1r-z2r=whatever*(z11-z12); z6r-z2r=whatever*(z15-z16);
+z2=0.5[z2l,z2r];
+z0=whatever[z11r,z12r]=whatever[z3l,z4l];
+if y0>y12+cap_notch_cut: y0:=y12+cap_notch_cut;
+ fill z0+.5right{up}...{z4-z3}diag_end(3l,4l,1,1,4r,3r)--z15r
+ --diag_end(15r,16r,1,1,16l,15l)--z15l--diag_end(12l,11l,1,1,11r,12r){z12-z11}
+ ...{down}z0+.5left--cycle; % diagonals and stroke
+else: fill z0--diag_end(0,4l,1,1,4r,3r)--z15r
+ --diag_end(15r,16r,1,1,16l,15l)--z15l
+ --diag_end(12l,11l,1,1,11r,0)--cycle; fi % diagonal and stroke
+fill z2r--diag_end(2r,6r,1,1,6l,2l)--z2l
+ --diag_end(2l,1l,1,1,1r,2r)--cycle; % stem
+if serifs: numeric inner_jut; pickup tiny.nib;
+ prime_points_inside(1,2); prime_points_inside(4,3); prime_points_inside(6,2);
+ prime_points_inside(11,12); prime_points_inside(16,15);
+ if rt x11'r+cap_jut+.5u+1<=lft x4'l-cap_jut: inner_jut=cap_jut;
+ else: rt x11'r+inner_jut+.5u+1=lft x4'l-inner_jut; fi
+ nodish_serif(1',2,a,1/3,outer_jut,b,0,inner_jut+doublestroke_dist); % upper left serif
+ nodish_serif(11',12,g,0,outer_jut+doublestroke_dist,h,1/2,inner_jut); % upper stroke serif
+ nodish_serif(4',3,c,.6,inner_jut,d,1/2,outer_jut)(dark); % upper right serif
+ nodish_serif(6',2,e,1/3,cap_jut,f,0,cap_jut+doublestroke_dist); % lower serif
+ nodish_serif(16',15,i,0,cap_jut+doublestroke_dist,j,1/3,cap_jut); fi % lower stroke serif
+math_fit(.5u#-cap_height#*slant,ic#-4u#);
+penlabels(0,1,2,3,4,5,6); endchar;
+
+cmchar "The letter Z";
+beginchar("Z",13.5u#,cap_height#,0);
+italcorr cap_height#*slant-.5u#;
+adjust_fit(0,0);
+numeric arm_thickness[],z_stem;
+if hefty: arm_thickness1=Vround(slab-vair_corr); arm_thickness2=slab;
+ z_stem=.8[vair,cap_stem];
+else: arm_thickness1=slab; arm_thickness2=vround(slab+vair_corr);
+ z_stem=.9[vair,cap_stem]; fi
+pickup tiny.nib; x3l=x4l=w-x1r=w-x2r; lft x3l=hround u;
+top y1=h; y2=min(y1,h-2/3arm_thickness1);
+bot y4=0; y3=max(y4,2/3arm_thickness2);
+y11=y1; y12=y2; y13=y3; y14=y4;
+numeric alpha; alpha=diag_ratio(1,
+ z_stem-tiny+doublestroke_dist+doublestroke_thin,y2-y3,x2r-x3l);
+penpos1(alpha*(doublestroke_thin-tiny),0); penpos2(alpha*(doublestroke_thin-tiny),0);
+penpos3(alpha*(z_stem-tiny),0); penpos4(alpha*(z_stem-tiny),0);
+penpos11(alpha*(z_stem-tiny),0); penpos12(alpha*(z_stem-tiny),0);
+penpos13(alpha*(doublestroke_thin-tiny),0); penpos14(alpha*(doublestroke_thin-tiny),0);
+rt x11r=lft x1l-alpha*doublestroke_dist; rt x12r=lft x2l-alpha*doublestroke_dist;
+lft x13l=rt x3r+alpha*doublestroke_dist; lft x14l=rt x4r+alpha*doublestroke_dist;
+pair delta; delta=penoffset z3-z2 of currentpen;
+fill top lft z11l--z12l+delta---z3l+delta..lft z3l---lft z4l..bot z4l
+ ---bot rt z4r--z3r-delta---z12r-delta..rt z12r---rt z11r..top z11r
+ ---cycle; % diagonal
+fill top lft z1l--z2l+delta---z13l+delta..lft z13l---lft z14l..bot z14l
+ ---bot rt z14r--z13r-delta---z2r-delta..rt z2r---rt z1r..top z1r
+ ---cycle; % diagonal
+pickup crisp.nib; pos5(arm_thickness1,90); pos6(hair,180);
+top y5r=h; x5=x1; lft x6r=hround 1.25u; y6=good.y(y5l-beak)-eps;
+arm(5,6,a,beak_darkness**.8,-.4beak_jut); % upper arm and beak
+pos7(arm_thickness2,-90); pos8(hair,0);
+bot y7r=0; x7=x4; rt x8r=hround(w-.9u); y8=good.y(y7l+1.2beak)+eps;
+arm(7,8,b,beak_darkness**.9,.6beak_jut); % lower arm and beak
+math_fit(0,.5ic#); penlabels(1,2,3,4,5,6,7,8); endchar;
+
diff --git a/fonts/doublestroke/dsss10.mf b/fonts/doublestroke/dsss10.mf
new file mode 100644
index 0000000000..c48409e26b
--- /dev/null
+++ b/fonts/doublestroke/dsss10.mf
@@ -0,0 +1,75 @@
+% Double Stroke Computer Modern Sans Serif 10 pt
+if unknown cmbase: input cmbase fi
+
+font_identifier:="CMSS"; font_size 10pt#;
+
+u#:=20/36pt#; % unit width
+width_adj#:=15/36pt#; % width adjustment for certain characters
+serif_fit#:=-7/36pt#; % extra sidebar near lowercase serifs
+cap_serif_fit#:=-10/36pt#; % extra sidebar near uppercase serifs
+letter_fit#:=0pt#; % extra space added to all sidebars
+
+body_height#:=270/36pt#; % height of tallest characters
+asc_height#:=250/36pt#; % height of lowercase ascenders
+cap_height#:=250/36pt#; % height of caps
+fig_height#:=236/36pt#; % height of numerals
+x_height#:=160/36pt#; % height of lowercase without ascenders
+math_axis#:=90/36pt#; % axis of symmetry for math symbols
+bar_height#:=79/36pt#; % height of crossbar in lowercase e
+comma_depth#:=45/36pt#; % depth of comma below baseline
+desc_depth#:=70/36pt#; % depth of lowercase descenders
+
+crisp#:=0pt#; % diameter of serif corners
+tiny#:=0pt#; % diameter of rounded corners
+fine#:=0pt#; % diameter of sharply rounded corners
+thin_join#:=17/36pt#; % width of extrafine details
+hair#:=28/36pt#; % lowercase hairline breadth
+stem#:=28/36pt#; % lowercase stem breadth
+curve#:=28/36pt#; % lowercase curve breadth
+ess#:=28/36pt#; % breadth in middle of lowercase s
+flare#:=25/36pt#; % diameter of bulbs or breadth of terminals
+dot_size#:=30/36pt#; % diameter of dots
+cap_hair#:=28/36pt#; % uppercase hairline breadth
+cap_stem#:=32/36pt#; % uppercase stem breadth
+cap_curve#:=32/36pt#; % uppercase curve breadth
+cap_ess#:=32/36pt#; % breadth in middle of uppercase s
+rule_thickness#:=.4pt#; % thickness of lines in math symbols
+
+dish#:=0pt#; % amount erased at top or bottom of serifs
+bracket#:=0pt#; % vertical distance from serif base to tangent
+jut#:=0pt#; % protrusion of lowercase serifs
+cap_jut#:=0pt#; % protrusion of uppercase serifs
+beak_jut#:=0pt#; % horizontal protrusion of beak serifs
+beak#:=.5/36pt#; % vertical protrusion of beak serifs
+vair#:=22/36pt#; % vertical diameter of hairlines
+notch_cut#:=18/36pt#; % maximum breadth above or below notches
+bar#:=21/36pt#; % lowercase bar thickness
+slab#:=23/36pt#; % serif and arm thickness
+cap_bar#:=22/36pt#; % uppercase bar thickness
+cap_band#:=20/36pt#; % uppercase thickness above/below lobes
+cap_notch_cut#:=25/36pt#; % max breadth above/below uppercase notches
+serif_drop#:=2/36pt#; % vertical drop of sloped serifs
+stem_corr#:=1/36pt#; % for small refinements of stem breadth
+vair_corr#:=1/36pt#; % for small refinements of hairline height
+apex_corr#:=5/36pt#; % extra width at diagonal junctions
+
+o#:=8/36pt#; % amount of overshoot for curves
+apex_o#:=0pt#; % amount of overshoot for diagonal junctions
+
+slant:=0; % tilt ratio $(\Delta x/\Delta y)$
+fudge:=.96; % factor applied to weights of heavy characters
+math_spread:=0; % extra openness of math symbols
+superness:=1/sqrt 2; % parameter for superellipses
+superpull:=1/20; % extra openness inside bowls
+beak_darkness:=0; % fraction of triangle inside beak serifs
+ligs:=2; % level of ligatures to be included
+
+square_dots:=true; % should dots be square?
+hefty:=true; % should we try hard not to be overweight?
+serifs:=false; % should serifs and bulbs be attached?
+monospace:=false; % should all characters have the same width?
+variant_g:=false; % should an italic-style g be used?
+low_asterisk:=false; % should the asterisk be centered at the axis?
+math_fitting:=false; % should math-mode spacing be used?
+
+generate dsrom % switch to the driver file
diff --git a/fonts/doublestroke/dsss10.pfb b/fonts/doublestroke/dsss10.pfb
new file mode 100644
index 0000000000..1118912923
--- /dev/null
+++ b/fonts/doublestroke/dsss10.pfb
Binary files differ
diff --git a/fonts/doublestroke/dsss10.tfm b/fonts/doublestroke/dsss10.tfm
new file mode 100644
index 0000000000..1eb4b28394
--- /dev/null
+++ b/fonts/doublestroke/dsss10.tfm
Binary files differ
diff --git a/fonts/doublestroke/dsss12.mf b/fonts/doublestroke/dsss12.mf
new file mode 100644
index 0000000000..742827ee96
--- /dev/null
+++ b/fonts/doublestroke/dsss12.mf
@@ -0,0 +1,75 @@
+% Double Stroke Computer Modern Sans Serif 12 pt
+if unknown cmbase: input cmbase fi
+
+font_identifier:="DSSS"; font_size 12pt#;
+
+u#:=23.5/36pt#; % unit width
+width_adj#:=17/36pt#; % width adjustment for certain characters
+serif_fit#:=-9/36pt#; % extra sidebar near lowercase serifs
+cap_serif_fit#:=-13/36pt#; % extra sidebar near uppercase serifs
+letter_fit#:=0pt#; % extra space added to all sidebars
+
+body_height#:=324/36pt#; % height of tallest characters
+asc_height#:=300/36pt#; % height of lowercase ascenders
+cap_height#:=300/36pt#; % height of caps
+fig_height#:=283/36pt#; % height of numerals
+x_height#:=192/36pt#; % height of lowercase without ascenders
+math_axis#:=108/36pt#; % axis of symmetry for math symbols
+bar_height#:=97/36pt#; % height of crossbar in lowercase e
+comma_depth#:=54/36pt#; % depth of comma below baseline
+desc_depth#:=84/36pt#; % depth of lowercase descenders
+
+crisp#:=0pt#; % diameter of serif corners
+tiny#:=0pt#; % diameter of rounded corners
+fine#:=0pt#; % diameter of sharply rounded corners
+thin_join#:=20/36pt#; % width of extrafine details
+hair#:=33/36pt#; % lowercase hairline breadth
+stem#:=33/36pt#; % lowercase stem breadth
+curve#:=33/36pt#; % lowercase curve breadth
+ess#:=33/36pt#; % breadth in middle of lowercase s
+flare#:=30/36pt#; % diameter of bulbs or breadth of terminals
+dot_size#:=35/36pt#; % diameter of dots
+cap_hair#:=33/36pt#; % uppercase hairline breadth
+cap_stem#:=37/36pt#; % uppercase stem breadth
+cap_curve#:=37/36pt#; % uppercase curve breadth
+cap_ess#:=37/36pt#; % breadth in middle of uppercase s
+rule_thickness#:=.44pt#; % thickness of lines in math symbols
+
+dish#:=0pt#; % amount erased at top or bottom of serifs
+bracket#:=0pt#; % vertical distance from serif base to tangent
+jut#:=0pt#; % protrusion of lowercase serifs
+cap_jut#:=0pt#; % protrusion of uppercase serifs
+beak_jut#:=0pt#; % horizontal protrusion of beak serifs
+beak#:=.6/36pt#; % vertical protrusion of beak serifs
+vair#:=26/36pt#; % vertical diameter of hairlines
+notch_cut#:=22/36pt#; % maximum breadth above or below notches
+bar#:=25/36pt#; % lowercase bar thickness
+slab#:=27/36pt#; % serif and arm thickness
+cap_bar#:=26/36pt#; % uppercase bar thickness
+cap_band#:=24/36pt#; % uppercase thickness above/below lobes
+cap_notch_cut#:=31/36pt#; % max breadth above/below uppercase notches
+serif_drop#:=2/36pt#; % vertical drop of sloped serifs
+stem_corr#:=1/36pt#; % for small refinements of stem breadth
+vair_corr#:=1/36pt#; % for small refinements of hairline height
+apex_corr#:=6/36pt#; % extra width at diagonal junctions
+
+o#:=9/36pt#; % amount of overshoot for curves
+apex_o#:=0pt#; % amount of overshoot for diagonal junctions
+
+slant:=0; % tilt ratio $(\Delta x/\Delta y)$
+fudge:=.98; % factor applied to weights of heavy characters
+math_spread:=-0.2; % extra openness of math symbols
+superness:=1/sqrt 2; % parameter for superellipses
+superpull:=1/20; % extra openness inside bowls
+beak_darkness:=0; % fraction of triangle inside beak serifs
+ligs:=2; % level of ligatures to be included
+
+square_dots:=true; % should dots be square?
+hefty:=true; % should we try hard not to be overweight?
+serifs:=false; % should serifs and bulbs be attached?
+monospace:=false; % should all characters have the same width?
+variant_g:=false; % should an italic-style g be used?
+low_asterisk:=false; % should the asterisk be centered at the axis?
+math_fitting:=false; % should math-mode spacing be used?
+
+generate dsrom % switch to the driver file
diff --git a/fonts/doublestroke/dsss12.pfb b/fonts/doublestroke/dsss12.pfb
new file mode 100644
index 0000000000..2d72e79e9b
--- /dev/null
+++ b/fonts/doublestroke/dsss12.pfb
Binary files differ
diff --git a/fonts/doublestroke/dsss12.tfm b/fonts/doublestroke/dsss12.tfm
new file mode 100644
index 0000000000..5e5942d10c
--- /dev/null
+++ b/fonts/doublestroke/dsss12.tfm
Binary files differ
diff --git a/fonts/doublestroke/dsss8.mf b/fonts/doublestroke/dsss8.mf
new file mode 100644
index 0000000000..f512d193bc
--- /dev/null
+++ b/fonts/doublestroke/dsss8.mf
@@ -0,0 +1,75 @@
+% Double Stroke Computer Modern Sans Serif 8 pt
+if unknown cmbase: input cmbase fi
+
+font_identifier:="DSSS"; font_size 8pt#;
+
+u#:=17/36pt#; % unit width
+width_adj#:=12/36pt#; % width adjustment for certain characters
+serif_fit#:=-6/36pt#; % extra sidebar near lowercase serifs
+cap_serif_fit#:=-8.5/36pt#; % extra sidebar near uppercase serifs
+letter_fit#:=0pt#; % extra space added to all sidebars
+
+body_height#:=216/36pt#; % height of tallest characters
+asc_height#:=200/36pt#; % height of lowercase ascenders
+cap_height#:=200/36pt#; % height of caps
+fig_height#:=189/36pt#; % height of numerals
+x_height#:=128/36pt#; % height of lowercase without ascenders
+math_axis#:=72/36pt#; % axis of symmetry for math symbols
+bar_height#:=63/36pt#; % height of crossbar in lowercase e
+comma_depth#:=37/36pt#; % depth of comma below baseline
+desc_depth#:=56/36pt#; % depth of lowercase descenders
+
+crisp#:=0pt#; % diameter of serif corners
+tiny#:=0pt#; % diameter of rounded corners
+fine#:=0pt#; % diameter of sharply rounded corners
+thin_join#:=15/36pt#; % width of extrafine details
+hair#:=25/36pt#; % lowercase hairline breadth
+stem#:=25/36pt#; % lowercase stem breadth
+curve#:=25/36pt#; % lowercase curve breadth
+ess#:=25/36pt#; % breadth in middle of lowercase s
+flare#:=22/36pt#; % diameter of bulbs or breadth of terminals
+dot_size#:=26/36pt#; % diameter of dots
+cap_hair#:=25/36pt#; % uppercase hairline breadth
+cap_stem#:=29/36pt#; % uppercase stem breadth
+cap_curve#:=29/36pt#; % uppercase curve breadth
+cap_ess#:=28/36pt#; % breadth in middle of uppercase s
+rule_thickness#:=.36pt#; % thickness of lines in math symbols
+
+dish#:=0pt#; % amount erased at top or bottom of serifs
+bracket#:=0pt#; % vertical distance from serif base to tangent
+jut#:=0pt#; % protrusion of lowercase serifs
+cap_jut#:=0pt#; % protrusion of uppercase serifs
+beak_jut#:=0pt#; % horizontal protrusion of beak serifs
+beak#:=.4/36pt#; % vertical protrusion of beak serifs
+vair#:=19/36pt#; % vertical diameter of hairlines
+notch_cut#:=16/36pt#; % maximum breadth above or below notches
+bar#:=18/36pt#; % lowercase bar thickness
+slab#:=20/36pt#; % serif and arm thickness
+cap_bar#:=19/36pt#; % uppercase bar thickness
+cap_band#:=17/36pt#; % uppercase thickness above/below lobes
+cap_notch_cut#:=22/36pt#; % max breadth above/below uppercase notches
+serif_drop#:=2/36pt#; % vertical drop of sloped serifs
+stem_corr#:=1/36pt#; % for small refinements of stem breadth
+vair_corr#:=1/36pt#; % for small refinements of hairline height
+apex_corr#:=4/36pt#; % extra width at diagonal junctions
+
+o#:=6/36pt#; % amount of overshoot for curves
+apex_o#:=0pt#; % amount of overshoot for diagonal junctions
+
+slant:=0; % tilt ratio $(\Delta x/\Delta y)$
+fudge:=.93; % factor applied to weights of heavy characters
+math_spread:=.4; % extra openness of math symbols
+superness:=1/sqrt 2; % parameter for superellipses
+superpull:=1/20; % extra openness inside bowls
+beak_darkness:=0; % fraction of triangle inside beak serifs
+ligs:=2; % level of ligatures to be included
+
+square_dots:=true; % should dots be square?
+hefty:=true; % should we try hard not to be overweight?
+serifs:=false; % should serifs and bulbs be attached?
+monospace:=false; % should all characters have the same width?
+variant_g:=false; % should an italic-style g be used?
+low_asterisk:=false; % should the asterisk be centered at the axis?
+math_fitting:=false; % should math-mode spacing be used?
+
+generate dsrom % switch to the driver file
diff --git a/fonts/doublestroke/dsss8.pfb b/fonts/doublestroke/dsss8.pfb
new file mode 100644
index 0000000000..babf1d2e54
--- /dev/null
+++ b/fonts/doublestroke/dsss8.pfb
Binary files differ
diff --git a/fonts/doublestroke/dsss8.tfm b/fonts/doublestroke/dsss8.tfm
new file mode 100644
index 0000000000..40752ab149
--- /dev/null
+++ b/fonts/doublestroke/dsss8.tfm
Binary files differ
diff --git a/fonts/doublestroke/dstroke.map b/fonts/doublestroke/dstroke.map
new file mode 100644
index 0000000000..809483e6ae
--- /dev/null
+++ b/fonts/doublestroke/dstroke.map
@@ -0,0 +1,6 @@
+dsrom12 dsrom12 <dsrom12.pfb
+dsrom10 dsrom10 <dsrom10.pfb
+dsrom8 dsrom8 <dsrom8.pfb
+dsss12 dsss12 <dsss12.pfb
+dsss10 dsss10 <dsss10.pfb
+dsss8 dsss8 <dsss8.pfb