3

I am not sure if this is the right place to ask about this but you guys are usually both nice and knowledgable so I will give it a try.

The percentage symbol in EB Garamond looks terrible. Consider this MWE:

\documentclass{memoir}
\usepackage{ebgaramond}

\begin{document} The 70,% limit is a\ldots \end{document}

enter image description here

I mean for example I might expect it to be two zeroes in EB Garamond font but clearly it is not:

It really stands out and looks like a completely different style to me... (Could it be that this is some sort of placeholder symbol that was forgotten about?)

Nevertheless, can something be done?

jonalv
  • 11,466
  • 2
    IMHO it is two zeros, but not of the old style numbers but of the tabular numbers → https://fonts.google.com/specimen/EB+Garamond?preview.text=The%2070%25%20Limit – cabohah Nov 13 '23 at 09:52
  • 2
    Using a tall % next to old style numbers set to x height may always look a bit odd, you could use per cent see for example https://tex.stackexchange.com/questions/97723/what-is-the-correct-way-of-writing-a-percentage-next-to-oldstylenums – David Carlisle Nov 13 '23 at 10:27
  • If you compile with lualatex, using fontspec package, with OpenType EBgaramond, you can do some custom tweaking. The size of individual characters can be tweaked using the ScaleAgain=value pseudo-feature, and the width can be stretched or shrunk using the FakeStretch=value pseudo-feature. And of course you can use \raisebox to move things up or down, and \kern to adjust their relative horizontal positions. – rallg Nov 22 '23 at 18:17

2 Answers2

7

Following up on my comment, ebgaramond does indeed have a % for text numerals:

\documentclass{article}

\usepackage[papersize={5.5in,8.5in},margin=0.6in]{geometry} \usepackage{fontspec}

\newfontface{\ebg}{EBGaramond-Regular}[Numbers=OldStyle]

\begin{document}

\thispagestyle{empty}

\ebg 75% 75\XeTeXglyph3046 \end{document}

text numeral percent

sgmoye
  • 8,586
  • Just to clarify, is this a purely XeTeX solution or can it be done with say LuaLaTeX also? – jonalv Nov 28 '23 at 15:00
  • Good question. XeTeXglyph is unknown to LuaLaTeX, of course. The post https://tex.stackexchange.com/questions/211575/access-a-glyph-on-fontspec-using-a-gid-glyph-id does define a similar function \LuaTeXglyph which accomplishes the same thing. – sgmoye Nov 28 '23 at 17:24
4

For a solution which works with all engines you could tinker a percent sign by using 0 and a bold \textfractionsolidus:

\documentclass{article}

\usepackage{ebgaramond} \usepackage[T1]{fontenc}% for \textfractionsoliduns with pdfTeX

\makeatletter \newcommand{\mypercent}{% \mbox{% \check@mathfonts \setbox\z@=\hbox{\fontsize\sf@size\z@\selectfont0}% \setbox\tw@=\hbox{\fontsize\sf@size\z@\bfseries\textfractionsolidus}% \raise\dimexpr\ht\tw@-\ht\z@\relax\copy\z@\box\tw@\box\z@ }% } \makeatother

\begin{document}

\Large 15,% vs.\ 15,\mypercent\par \normalsize 15,% vs.\ 15,\mypercent\par \scriptsize 15,% vs.\ 15,\mypercent\par

\end{document}

enter image description here

If you want to use this by default, then I'd suggest something like

\NewCommandCopy{\percent}{\%}
\DeclareRobustCommand*{\%}{...}

However, be warned that this will break copy/pasting from a PDF. On the other hand, you won't need to restore the original definition in hyperkinks and bookmarks, since hyperref already does that.

campa
  • 31,130
  • A number of fonts with large glyph complements have percent and perthousand glyphs (also currency glyphs) that are formed (scaled and redrawn) to harmonize better with x-height (also known as old-style) numerals, which your output uses. You could take a look to see if ebgaramond has them. – sgmoye Nov 13 '23 at 11:51