5

Recently I started playing with the Inconsolata font in LuaLaTeX. At first I was using the font provided by package inconsolata:

\documentclass{article}
\usepackage{fontspec}
\setmonofont[StylisticSet=1]{inconsolata}

\begin{document}
\verb|l|
\end{document}

The StylisticSet=1 option substitutes the normal lowercase L with a rounded version that is easier to set apart from an uppercase i (called "shapely L" in the inconsolata package's doc).

But after that I found out that this package provides only an old version of the font, so I tried inconsolata-nerd-font instead:

\documentclass{article}
\usepackage{fontspec}
\setmonofont{Inconsolata Nerd Font}

\begin{document}
\verb|l|
\end{document}

The rendering is indeed better, especially the height of the monospaced font compared to the main one, but as far I as I could determine, there's no equivalent of the option mentioned above, so I found no way to get that "shapely L". All I get is the normal one.

Does anyone know of a way to get a more distinct lowercase L with this font?

11
  • 1
    @Mico This piece of information is in the description of the inconsolata-nerd-font package on CTAN: "that package provides a pretty old version of the font" (that meaning inconsolata). But even if it's not true, the inconsolata-nerd-font has a feature that I find useful (adapting height with the main font).
    – Miyase
    Commented Oct 15, 2023 at 7:26
  • 1
    @Mico I'm on macOS 14, but since I'm using fonts provided by packages that come with TeX Live, I didn't think the OS would play any role here, sorry.
    – Miyase
    Commented Oct 15, 2023 at 7:28
  • 1
    @Miyase - About the "useful feature" of the inconsolata-nerd-font package: it should be trivially easy to replicate it using fontspec's machinery. E.g, \setmainfont{<whatever>} followed by \setmonofont{inconsolata}[[StylisticSet=1, Scale=MatchLowercase] -- or, if you prefer, \setmonofont{inconsolata}[[StylisticSet=1, Scale=MatchUppercase].
    – Mico
    Commented Oct 15, 2023 at 10:15
  • 1
    @Mico Yes, but that would use the old font. I'm not sure that's bad but e.g. the new one apparently has a lot of new characters.
    – cfr
    Commented Oct 15, 2023 at 16:24
  • 1
    @Mico texdoc inconsolata-nerd-font has more detail re. differences in the new font, though it doesn't tell us whether those matter to the OP. If 'better rendering' depends on improvements to the font, that's obviously very different from its being just a question of the options provided by the new package.
    – cfr
    Commented Oct 15, 2023 at 16:32

1 Answer 1

3

inconsolata-nerd-font is a LaTeX package with documentation which includes tables for all font variants in the Inconsolata Nerd fonts, produced using unicodefonttable. I looked quickly and I couldn't see any glyph like the one produced by Inconsolata. So I suspected the l you want simply doesn't exist in this edition of the fonts. To be certain, I opened the font in FontForge. If you want to check, you could do the same, but quickly skimming through the glyphs threw up nothing like the earlier l as far as I could see.

You might try asking the authors to reinstate the character as a feature request, but there is nothing you can do (in the case of unicode as opposed to traditional 8-bit) fonts if the character isn't there. The only thing you could do would be to use the l from the older font, but that would be a very unsatisfactory solution and by no means straightforward with unicode fonts.

[Installing 8-bit fonts is different - the tools assume you have to combine characters from multiple fonts, because that's often how fonts were supplied. So you can pick and choose, but you lose kerning, for example, and obviously there's no support for truetype/opentype features.]

1
  • Thanks. I did check the tables in the doc, but not as thoroughly. As I searched here before posting my question, I saw various posts explaining how to substitute a character in a font with a character in another, but none of them seemed to be exactly what I needed, and I don't know enough to determine whether I could adapt them.
    – Miyase
    Commented Oct 15, 2023 at 7:30

You must log in to answer this question.

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