# LuaTeX: how to “steal” one glyph of other fonts and add it to the main fonts? “§” is missing!

You may have seen that the historical museum of Basel in remembrence of the first print of a bible edited by Erasmus of Rotterdam in the year 1516 published a font called «Erasmus MMXVI». You can download the fonts here.

It's a beautiful fonts and using LuaTeX you can easily access its features, see here:

\documentclass[parskip=half]{scrartcl}

\usepackage{fontspec}
\usepackage{polyglossia, microtype}
\setdefaultlanguage{german}
\setmainfont[Ligatures=TeX, RawFeature=+pnum]{ErasmusMMXVI}
\newfontfamily{\ErasmSupNum}[VerticalPosition=Superior]{ErasmusMMXVI}

\deffootnotemark{\ErasmSupNum\thefootnotemark}
\newfontfamily{\ErasmUpper}[LetterSpace=6.0]{ErasmusMMXVI}

\title{ERASMUS MMXVI}
\subtitle{OPEN-TYPE FEATURES}
\date{}

\begin{document}
\maketitle{}

Ligaturen: fi fl ff fleißig

Hochzahlen für Fußnoten\footnote{Ha!}

Superior: \textsuperscript{1234567890}

Proportional: 0123456789

\fontspec[RawFeature=+tnum]{ErasmusMMXVI}
Monospaced: 0123456789

\itshape

Ligaturen: fi fl ff ffi ffl fh tr

fleissig\\
fleissig (Style=Swash)}

Hochzahlen für Fußnoten\footnote{Ha!}

Superior: \textsuperscript{1234567890}

\fontspec[RawFeature=+pnum]{ErasmusMMXVI}
Proportional: 0123456789

\end{document}

% Local Variables:
% TeX-engine: luatex
% End:


See this screenshot:

Unfortunately, the section sign "§" is missing, which I need. Provided, I use LuaTeX to compile, is there any possibilty to use the "§" from another font, let's say Linux Biolinum?

I found this question here: Substitute one glyph for an alternate glyph of another stylistic set But the trouble there is to substitute the glyph from another style of the same fonts. Here in Erasmus MMXVI there is no § at all...

• Just in case you actually want the paragraph sign (as you write), it is called a pilcrow and is written "¶", not "§". The latter is the section sign. – wchargin Nov 29 '16 at 21:42
• @wchargin Thank you, you are right! In German language there is no pilcrow and the section sign is called "Paragraph". And the "§" ist used in juridical / legal context. – Keks Dose Nov 30 '16 at 7:19
• @wchargin The meanings of the symbols are inverted "in some European usage" according to Unicode. – svenper Feb 28 '18 at 21:38
• I had almost the same question. The Lua code in the answer might be modified to grab a glyph from a separate font. – svenper Feb 28 '18 at 21:40
• @svenper: How interesting! Thank you for letting me know. – wchargin Mar 1 '18 at 10:16

For example

\newfontfamily\LB{Linux Biolinum O}
\catcode\§=\active
\def§{{\LB\string§}}

• You are fast ! – Keks Dose Nov 29 '16 at 16:45
• But this only works for "§" in the text, but not, if used in a package I load (here: scrjura.sty). I admit, I did not ask that, though. – Keks Dose Nov 29 '16 at 16:51

Easy enough with newunicodechar:

\documentclass[parskip=half]{scrartcl}

\usepackage{fontspec}
\usepackage{polyglossia, microtype}
\usepackage{newunicodechar}

\setdefaultlanguage{german}
\setmainfont[Ligatures=TeX, RawFeature=+pnum]{ErasmusMMXVI}
\newfontfamily{\ErasmSupNum}[VerticalPosition=Superior]{ErasmusMMXVI}

\deffootnotemark{\ErasmSupNum\thefootnotemark}
\newfontfamily{\ErasmUpper}[LetterSpace=6.0]{ErasmusMMXVI}
\newfontfamily{\Biolinum}{Linux Biolinum O}

\newunicodechar{§}{{\Biolinum §}}

\title{ERASMUS MMXVI}
\subtitle{OPEN-TYPE FEATURES}
\date{}

\begin{document}
\maketitle{}

Paragraphenzeichen: § \textit{§}

Ligaturen: fi fl ff fleißig

Hochzahlen für Fußnoten\footnote{Ha!}

Superior: \textsuperscript{1234567890}

Proportional: 0123456789

\fontspec[RawFeature=+tnum]{ErasmusMMXVI}
Monospaced: 0123456789

\itshape

Ligaturen: fi fl ff ffi ffl fh tr

fleissig\\
fleissig (Style=Swash)}

Hochzahlen für Fußnoten\footnote{Ha!}

Superior: \textsuperscript{1234567890}

\fontspec[RawFeature=+pnum]{ErasmusMMXVI}
Proportional: 0123456789

\end{document}


What's the difference between this and the direct \def as an active character? Well, the \def is \protected, so no special care is needed in moving arguments, and no trickery with \string is needed.

A possibly better definition, that performs the substitution only if the glyph does not exist in the current font:

\newunicodechar{§}{\iffontchar\font§ §\else{\Biolinum §}\fi}


In order to cope with scrjura.sty, just add, after the \newunicodechar declaration,

\renewcommand*{\Clauseformat}[1]{§~#1}


This macro is the only place in scrjura.sty where \S is used.

• Sorry, I only realised now, that I need a solution for a package I'm loading (scrjura.sty), which writes sections as "§ 1 Content". My question pointed in the wrong way (mea culpa!). – Keks Dose Nov 29 '16 at 16:55
• @KeksDose I added the workaround. – egreg Nov 29 '16 at 17:00
• Yes, and the workaround works for your and Herberts solution as well. Thank you! – Keks Dose Nov 29 '16 at 17:18