0

Compiling this simple code to apply a particular Style Set locally:

\documentclass{article}
\usepackage{fontspec}
\usepackage[italian]{babel}
\babelfont{rm}[Numbers={Proportional,OldStyle},RawFeature=+calt]{EBGaramond}
\newfontfamily\myfont[Numbers={Proportional,OldStyle},RawFeature={+calt,+ss06}]{EBGaramond}

\begin{document}

Q \textsc{Q} \textsc{q}

\myfont{Q  \textsc{Q} \textsc{q}}

\end{document}

I receive:

Package babel Info: The current font is not a babel standard family:
(babel)             EBGaramond:mode=node;script=latn;language=dflt;+pnum;+onum;
+calt,+ss06;
(babel)             There is nothing intrinsically wrong with this warning, and

(babel)             you can ignore it altogether if you do not need these
(babel)             families. But if they are used in the document, you should 
be
(babel)             aware 'babel' will no set Script and Language for them, so
(babel)             you may consider defining a new family with \babelfont.

How should I correct \newfontfamily?

Thank you

1
  • The message explain what to do: “you may consider defining a new family with \babelfont“. It also explains that “There is nothing intrinsically wrong with this warning“. If the result is fine, then your settings are also fine. Commented Feb 25, 2022 at 14:51

2 Answers 2

2

In this case, you can switch to the standard font and add the font feature. You seem to want the command to change the text within brackets, but what the \myfont command actually does is change the font to EB Garamond stylistic set 6 from that point on. So, here is a demo of how to do it three different ways:

  • A \textswash command, like \textsc or \textsf
  • A \swashstyle command, like \scshape or \sffamily
  • Commands \Qswash for a capital sqashed Q and \qswash for a small-caps swashed Q
\documentclass{article}
\usepackage[italian]{babel}
\usepackage{fontspec}

\babelfont{rm}[Numbers={Proportional,OldStyle},RawFeature=+calt]{EBGaramond}
\newcommand\swashstyle{\rmfamily\addfontfeature{StylisticSet=6}}
\DeclareTextFontCommand\textswash{\swashstyle}
\newcommand\Qswash{\textswash{Q}}
\newcommand\qswash{\textswash{\scshape q}}

\begin{document}

\noindent Q \textsc{Q} \textsc{q} \\
\textswash{Q  \textsc{Q} \textsc{q}} \\
\Qswash \textsc{\Qswash} \qswash \\
{\swashstyle Q \textsc{Q} \textsc{q}}

\end{document}

You could also ignore the warning. Like the message says, it’s harmless.

0

EDIT: looking at p. 25-26 of babel's documentation, I've found this way:

\documentclass{article}
\usepackage{fontspec}
\usepackage[italian]{babel}
\babelfont{rm}[Numbers={Proportional,OldStyle},RawFeature=+calt]{EB Garamond}
\babelfont{myfont}[Numbers={Proportional,OldStyle},RawFeature={+calt,+ss06}]{EB Garamond}

\begin{document}

Q \textsc{Q} \textsc{q}

\textmyfont{Q} {\myfontfamily \textsc{Q} \textsc{q}}

\end{document}

Another way: use polyglossia instead of babel. Then, use \addfontfeature to activate the +ss06 feature.

\documentclass{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{italian}
\setmainfont[Numbers={Proportional,OldStyle},RawFeature={+calt}]{EB Garamond}

\begin{document}

Q \textsc{Q} \textsc{q}

{\addfontfeature{RawFeature=+ss06} Q  \textsc{Q} \textsc{q}}

\end{document}

enter image description here

3
  • In fact I used EB Garamond because it is a free font, but I need the code to activate other SS in another font. In this case various and more numerous forms of Cyrillic glyphs, so I thought that defining a font was more convenient than redefining several glyphs ... I don't find, in babel manual, how define a new font which is the same, but only with a different feature :(
    – user41063
    Commented Feb 25, 2022 at 15:38
  • @user41063 In my first example I defined twice the same font, with different features. I guess you can do the same with another opentype font, defining different names. Or am I not understanding your issue? By the way, I've no experience with babel. Also \addfontfeature of my 2nd example may be of use (you could define shorthands). I don't know if it's compatible with babel, but perhaps you can switch to polyglossia... Commented Feb 25, 2022 at 19:44
  • Sorry, you're right. I didn't realize that the correct string is \textmyfont, not \myfont. Moreover, there was an error in the lookuo. Now all works fine, thank you
    – user41063
    Commented Feb 26, 2022 at 2:08

You must log in to answer this question.

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