TL/DR
I understand this is a perverse question, but—is it possible, in fontspec/XeLaTeX|LuaLaTeX, to separately scale uppercase and lowercase letters of a monospace typewriter font to achieve the effect of having
- lowercase letters scaled to "MatchLowercase", and
- uppercase letters to "MatchUppercase",
so that the cap-to-x-height ratio matches the main font.
I understand that this would destroy kerning calculations in a normal font, but for monospace, it seems reasonably straightforward to horizontally stack non-overlapping boxes. (Though I suspect this may create eye-soreness for initial-case words where simple stacking will create extra space between the uppercase first letter and the lowercase tail: W·ord
.)
Bonus for suggesting a monospace typewriter font that harmonises with EB Garamond.
Longform
I'm using XeLaTeX at the moment, but I have a lot of branches so the document compiles with LuaLaTeX as well. I'm using fontspec.
I'm writing a document with lots of code and I'm using EB Garamond for the body (and Garamond-Math.otf
for math). I've had a heck of a time finding a monospace/typewriter font that looks good with garamond.
I've settled on IBM Plex Mono:
\setmonofont{IBMPlexMono}%
[
, Path = {…}
, UprightFont = *-Regular.otf
, ItalicFont = *-Italic.otf
, BoldFont = *-Bold.otf
, BoldItalicFont = *-BoldItalic.otf
, Scale=MatchLowercase
]
though I welcome recommendations, especially those that have fairly broad unicode support for UTF in comments.
Given the fixed choice of IBM Plex Mono, my problem is that the cap-to-x-height ratio between EB Garamond and Plex are so different that it looks a little strange with inline code when I scale by MatchLowercase.