9

The following minimal example gives the digits 0-9 in the font augie, which is a handwriting styled font. The problem is with the numbers 1 and 7. Ideally I would like to have the digits represented as shown in blue in the graphic below.

So the question is, how can one change the symbol for that one digit? Can we replace it with an appropriate digit from another font? In fact, is there another font which has numbers written in this way even?

enter image description here

\documentclass[12pt]{article}

\usepackage[T1]{fontenc}
\DeclareRobustCommand{\augiefamily}{%
\fontfamily{augie}\fontseries{m}\fontshape{n}\selectfont}
\DeclareTextFontCommand{\textaugie}{\augiefamily}  

\begin{document}
 
\begin{augiefamily}
0 1 2 3 4 5 6 7 8 9
\end{augiefamily}

\end{document}

2 Answers 2

12

As long as you were always willing to express visible numbers with a macro \numb{...}, you could construct your own versions of 1 and 7. While this may seem burdensome, people do it all the time when using packages like siunitx, so it is more of a habit than a burden.

The intermediate rule shows that the numbers 1 and 7 are not intrinsically changed...they can still be used for numerical arguments.

EDITED to handle both 10pt and 12pt reasonably well.

For xelatex or lualatex, use this:

\documentclass{article}
\usepackage{tokcycle,etoolbox,fontspec}
\setmainfont{augie}
\Characterdirective{\csname numb#1\endcsname}
\csdef{numb.}{.}
\csdef{numb0}{0}
\csdef{numb1}{\raisebox{.47ex}{\scriptsize/}\kern-.25ex1}
\csdef{numb2}{2}
\csdef{numb3}{3}
\csdef{numb4}{4}
\csdef{numb5}{5}
\csdef{numb6}{6}
\csdef{numb7}{{\ooalign{7\cr\small--}}}
\csdef{numb8}{8}
\csdef{numb9}{9}
\newcommand\numb[1]{\tokencyclexpress#1\endtokencyclexpress{}}
\begin{document}
\numb{2315.576}\\
\rule{10pt}{1.7pt}\\
\numb{.716}
\end{document}

For pdflatex, use this:

\documentclass{article}
\usepackage{tokcycle,etoolbox}
\usepackage{emerald}
\usepackage[T1]{fontenc}
\csdef{numb.}{.}
\csdef{numb0}{0}
\csdef{numb1}{\raisebox{.47ex}{\scriptsize/}\kern-.25ex1}
\csdef{numb2}{2}
\csdef{numb3}{3}
\csdef{numb4}{4}
\csdef{numb5}{5}
\csdef{numb6}{6}
\csdef{numb7}{{\ooalign{7\cr\small--}}}
\csdef{numb8}{8}
\csdef{numb9}{9}
\newcommand\numb[1]{\tokcycle{\csname numb##1\endcsname}{}{}{}{#1}}
\begin{document}
\ECFAugie
\numb{2315.576}\\
\rule{10pt}{1.7pt}\\
\numb{.716}
\end{document}

enter image description here

As shown in the pdflatex version of the MWE, if you wish to avoid specifying the \Characterdirective separately, which will also protect you if other token cycles are present in the document, you could specify \numb as follows, with the character directive "built in":

\newcommand\numb[1]{\tokcycle{\csname numb##1\endcsname}{}{}{}{#1}}
5
  • Many thanks. I like this idea, but when I run your code I get the error: Fatal Package fontspec Error: The fontspec package requires either XeTeX or (or what? is that a threat :) )
    – Geoff
    Commented Mar 14, 2021 at 10:18
  • @Geoff For me, in order to load the augie font, I have to compile with xelatex or lualatex, rather than pdflatex. Typically, to change fonts in those cases, I rely on fontspec. If you are able to get augie font without loading fontspec, then just remove it., Commented Mar 14, 2021 at 14:10
  • @Geoff Your question made me look to see if there was a pdflatex way to use augie, which I found. I edited my answer to show both lua/xe-latex approach, as well as pdflatex. Commented Mar 14, 2021 at 15:21
  • I once tried to install emerald and failed, yet stumbled upon this answer tex.stackexchange.com/a/248467/11162 that stated how augie can be used without anything extra. That's basically where my MWE comes from.
    – Geoff
    Commented Mar 14, 2021 at 16:31
  • I've got it working now. If you drop emerald and add your bits to my MWE then \numb works within augiefamily!
    – Geoff
    Commented Mar 14, 2021 at 16:35
11

There are several alternatives:

  • Check, whether the font provides alternative glyphs that can be enabled. (If the font has a OpenType version with this feature, switch to LuaTeX or XeTeX.)

    In case of font Augie: Alternative glyphs are not available.

  • If the font license allows it, load the font in a font editor (e.g., FontForge), modify the glyphs and save as a new font with new name. If the glyph bounding boxes are not changed, the metric files for LaTeX can be inherited from the original font.

    In case of the font Augie (FreeWare), this is forbidden (augie.ttf):

    enter image description here

  • At the TeX language level, the glyphs could be manually overlayed by TikZ code, an image, ... to add the missing line parts for the two glyphs. But this is clumsy, and a macro would be needed to access the composite glyphs (characters could be made active, but active digits is asking for trouble and therefore very likely not a very good idea).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .