5

I'd like to use in LuaLaTeX. Unfortunately it seems none of the most commonly used fonts and china2e from 1997 - the only package I found which supposedly supports this symbol - isn't even available in the latest TeXlive distro.

\documentclass{scrartcl}
\usepackage{microtype}

\begin{document} L B bar = U+2114 = ℔ \end{document}

When using TeX Gyre Bonum as main font via fontspec, I get the following error:

Gives: Missing character: There is no ℔ (U+2114) in font TeXGyreBonum:mode=node;language=dflt;+tlig;!

Now I am left with two options (I think, please correct me if there are more):

  1. find a way to make use of a 23 year old package (china2e)
  2. find a font which supports this exact symbol

How can I achieve either (I am leaning toward the second option, however)?

3 Answers3

17

Using the new tool in texlive albatross on the command with

albatross 0x2114

gives me quite a number of fonts on my system which has it. Including for example dejavu which is also in texlive:

\documentclass{scrartcl}
\usepackage{microtype}
\usepackage{fontspec}
\setmainfont{dejavusans}
\begin{document}
   L B bar = U+2114 = ℔
\end{document}

enter image description here

Ulrike Fischer
  • 327,261
12

You can take the symbol from any font that contains it. A good method of doing this that does not change the main font is to set the character active with \newunicodechar.

\documentclass{article}
\tracinglostchars=2
\usepackage{fontspec}
\usepackage{newcomputermodern}
\usepackage{newunicodechar}

\newfontfamily\symbolfont{Junicode}[Scale=MatchUppercase]

\newcommand\lbbar{{\symbolfont\symbol{"2114}}} \newunicodechar{^^^^2114}{\lbbar} % ℔

\begin{document} lb ℔ \end{document}

Junicode sample

Free fonts that contain this glyph include: Cardo, Code2000, DejaVu Sans, Everson Mono, FreeSerif, FreeSans, Junicode, Linux Libertine, Noto Sans, Noto Serif and Symbola. The Noto fonts are especially useful, since they come in many widths and weights, so it’s likely that at least one of them will match your other fonts.

Davislor
  • 44,045
7

You can use fontspec's fallback mechanism in LuaTeX to merge multiple fonts together. When a character is missing, it will automatically search this character in Noto Sans, where this character is present. You can set up more fallback fonts as well. In this way, you do not have to change the main font of your document.

\documentclass{scrartcl}
\usepackage{fontspec}
\usepackage{microtype}

\directlua{luaotfload.add_fallback("genericfallback", { "NotoSans:mode=node;" }) }

\setmainfont{TeX Gyre Bonum}[RawFeature={fallback=genericfallback}]

\begin{document} the brown fox jumped over the lazy dog ℔ \end{document}

Alan Xiang
  • 5,227