1

This is a follow-up question of this answer, which provides a FakeSlant-based method for providing bold italics for Iconsolata using XeLaTeX or LuaLaTeX (with fontspec).

The original method works, but when specifying Extension = .otf, or using iconsolata as the font name (because there is inconsolata.fontspec in the inconsolata-zi4 package), the fake slant for bold italics fails.

Consider the following MWE:

\documentclass{article}
\usepackage{fontspec}

% this works % \setmonofont{Inconsolatazi4}[ % AutoFakeSlant, % BoldItalicFeatures={FakeSlant}, % ]

% this does not work \setmonofont[ AutoFakeSlant, BoldItalicFeatures={FakeSlant}, ]{inconsolata}

% this does not work either % \setmonofont[ % UprightFont = -Regular, % BoldFont = -Bold, % AutoFakeSlant, % BoldItalicFeatures={FakeSlant}, % Extension=.otf % ]{Inconsolatazi4}

\begin{document} \ttfamily Regular \textbf{Bold} \textsl{Slanted} \textit{Italics} \textbf{\textsl{BoldSlanted}} \textbf{\textit{BoldItalics}} \end{document}

Not Working:

not working

Working:

working

1 Answers1

2

Inconsolatea has no Italics so it fallbacks to slanted:

\documentclass{article}
\usepackage{fontspec}

\setmonofont[ UprightFont = -Regular, BoldFont = -Bold, SlantedFont = -Regular, SlantedFeatures = {FakeSlant=0.2}, BoldSlantedFont = -Bold, BoldSlantedFeatures = {FakeSlant=0.2,RawFeature={embolden=2}}, Extension=.otf ]{Inconsolatazi4}

\begin{document} \ttfamily Regular \textbf{Bold} \textsl{Slanted} \textit{Italics} \textbf{\textsl{BoldSlanted}} \textbf{\textit{BoldItalics}} \end{document}

enter image description here

user187802
  • 16,850
  • Thank you for your prompt answer! Indeed, using BoldSlantedFeatures in addition to BoldItalicFeatures will address the issue, and also stop the warning of fallback. – Teddy van Jerry Feb 02 '24 at 15:12