LaTeX forum ⇒ Fonts & Character SetsSmall Caps don't work with the name "Nigel" Topic is solved

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
petersfreeman
Posts: 6
Joined: Wed Apr 28, 2021 9:40 am

Small Caps don't work with the name "Nigel"  Topic is solved

Postby petersfreeman » Sat Oct 09, 2021 7:40 am

Here is my problem. I am using the Garamond Libre font and have found that if the sequence "Nig" is being small capped as in "Nigel" but not "Anigelina" the "ig" is not small capped. Wierd!

% !TEX TS-program = xelatex
% !TeX encoding = UTF-8
% !TeX spellcheck = en_CA

\documentclass[]{article}

\usepackage[]{fontspec}

\setmainfont[]{Garamond Libre}

\begin{document}
	\textsc{Nigel}
	
	\textsc{Migel}
	
	\textsc{Nagel}
	
	\textsc{Nizel}
	
	\textsc{Nigal}
	
	\textsc{Nigelina, here I come}
	
	\textsc{Anigelina}
\end{document}

User avatar
Ijon Tichy
Posts: 565
Joined: Mon Dec 24, 2018 10:12 am

Postby Ijon Tichy » Sat Oct 09, 2021 2:16 pm

Seems to be a ligature problem with the font:
\documentclass[]{article}

\usepackage[]{fontspec}

\setmainfont{Garamond Libre}

\begin{document}
	\textsc{Ni\/gel}
	
	\textsc{Migel}
	
	\textsc{Nagel}
	
	\textsc{Nizel}
	
	\textsc{Ni\/gal}
	
	\textsc{Ni\kern 0pt gelina, here I come}
	
	\textsc{Anigelina}
\end{document}

User avatar
Stefan Kottwitz
Site Admin
Posts: 9787
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sat Oct 09, 2021 3:13 pm

Indeed,

\setmainfont[]{Garamond Libre}[Ligatures=NoRequired]


also changes that. Just for testing, I would not do that globally just because there's an issue with some specific word in small caps. I would use what Ijon said, I guess I would make a macro \Nigel for this if it occures several times in the document.

Also, there's a way with the microtype package:

\DisableLigatures{encoding = *, shape = sc*}


but that seems to work only with pdfLaTeX, not XeLaTeX.

Or how about this:

\documentclass[]{article}
\usepackage[]{fontspec}
\setmainfont[]{Garamond Libre}[SmallCapsFeatures= {RawFeature={+smcp,-rlig,-clig,-dlig,-hlig,-liga}}]
\begin{document}
	\textsc{Nigel fi ff fl ffl}
	Nigel fi ff fl ffl
\end{document}


You can see that ligatures are removed for small caps, while they are still used in regular text.

Stefan
LaTeX.org admin

User avatar
Ijon Tichy
Posts: 565
Joined: Mon Dec 24, 2018 10:12 am

Postby Ijon Tichy » Sat Oct 09, 2021 3:29 pm

To globally disable the ligatures for SmallCaps only use:
\documentclass[]{article}

\usepackage[]{fontspec}

\setmainfont{Garamond Libre}[SmallCapsFeatures={Ligatures=NoRequired}]

\begin{document}
	\textsc{Nigel}
	
	\textsc{Migel}
	
	\textsc{Nagel}
	
	\textsc{Nizel}
	
	\textsc{Nigal}
	
	\textsc{Nigelina, here I come}
	
	\textsc{Anigelina}
\end{document}

See Section 3, »Different features for different font shapes«, of the fontspec manual for more information.

User avatar
Stefan Kottwitz
Site Admin
Posts: 9787
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sat Oct 09, 2021 3:51 pm

Ijon's suggestion looks good, I would extend it a bit do prevent the other ligatures too, with small caps:

\documentclass[]{article}
\usepackage[]{fontspec}
\setmainfont[]{Garamond Libre}[SmallCapsFeatures= {Ligatures={NoRequired,NoCommon,NoDiscretionary,NoHistoric,NoContextual}}]
\begin{document}
	\textsc{Nigel fi ff fl ffl}
	Nigel fi ff fl ffl
\end{document}


Stefan
LaTeX.org admin

User avatar
Ijon Tichy
Posts: 565
Joined: Mon Dec 24, 2018 10:12 am

Postby Ijon Tichy » Sat Oct 09, 2021 4:14 pm

Yes, I've not tested, if the font provides any SmallCaps ligatures. If not, switching of all of them indeed would be a good idea.


Return to “Fonts & Character Sets”

Who is online

Users browsing this forum: No registered users and 2 guests