1

I have a .otf font that I intended to use with xelatex. Since the italics were set as a different family, I had 2 different fonts: the same in straight version and in a italic version. Now, with Fontforge I set up in "PS Names" field the same name as the family, and in "Names TTF" family and subfamily (putting here Italic and Bold Italic), as I think I had done successfully for a couple of other fonts. However during the compilation I receive

LaTeX Font Warning: Font shape `TU/StempelGaramondLTPro(0)/m/it' undefined
(Font) using `TU/StempelGaramondLTPro(0)/m/n' instead on input line 33.

LaTeX Font Warning: Font shape `TU/StempelGaramondLTPro(1)/m/it' undefined
(Font) using `TU/StempelGaramondLTPro(1)/m/n' instead on input line 50.

and the text ignores italics. What else do I have to fix in the font? Moreover, I do not know what the TU that appears in the messages refers to

thanx s

1
  • show your header where you define the fonts ...
    – user2478
    Commented Sep 28, 2018 at 18:49

2 Answers 2

2

You have to do nothing with the fonts internally, fontspec will find all font styles automatically:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Stempel Garamond LT Std}
\begin{document}
roman \textit{italic} \textbf{bold} \textbf{\textit{bold italic}}
\end{document}

Running with xelatex produces a pdf with the embedded fonts:

------------------------------------ ----------------- ---------------- --- --- --- ---------
HJSNNY+StempelGaramondLTStd-Roman-Identity-H CID Type 0C       Identity-H       yes yes yes      5  0
ICDNFX+StempelGaramondLTStd-Italic-Identity-H CID Type 0C       Identity-H       yes yes yes      7  0
ALSBZD+StempelGaramondLTStd-Bold-Identity-H CID Type 0C       Identity-H       yes yes yes      9  0
SNVUYL+StempelGaramondLTStd-BoldIt-Identity-H CID Type 0C       Identity-H       yes yes yes     11  0

enter image description here

Your otfinfo should output something like this:

voss@shania:~/.fonts/Stempel_Garamond_LT_Std$ otfinfo -i StempelGaramondLTStd-Italic.otf 
Family:              Stempel Garamond LT Std
Subfamily:           Italic
Full name:           StempelGaramondLTStd-Italic
PostScript name:     StempelGaramondLTStd-Italic

Instead of the symbolic font names, one can also use the file names which is mandatory if the font files are not in a system or TeX font directory:

\usepackage{fontspec}
\setmainfont{StempelGaramondLTStd}[
  UprightFont=*-Roman,
  ItalicFont=*-Italic,
  BoldFont=*-Bold,
  BoldItalicFont=*-BoldIt,
  Extension=.otf,
  Path=/home/voss/.fonts/Stempel_Garamond_LT_Std/]%  CHANGE to your path
0

With file names, now working! Thanx!! It's strange, for all my added files are in /usr/local/share/fonts/opentype/ and all they work fine, so I'm sure they are in a correct directory (I added it in /etc/fonts/conf.d/09-texlive.conf). In any case almost all now seems to work, save lining number. If I try

    \documentclass[a4paper,11pt]{article}
    \usepackage{fontspec}
    \setmainfont{StempelGaramondLTPro}[
      UprightFont=*-Roman,
      ItalicFont=*-Italic,
      BoldFont=*-Bold,
      BoldItalicFont=*-BoldIt,
      Ligatures=TeX,
      Numbers=OldStyle,
      Extension=.otf,
      Path= /usr/local/share/fonts/opentype/StempelGaramondPro/]
    \usepackage{polyglossia}
    \setmainlanguage[babelshorthands=true]{italian}
    \newrobustcmd\lining[1]{{\addfontfeature{Numbers=Lining}#1}}

    \begin{document}
    \lining{1 2 3 4 5 6 7 8 9 0}
    \end{document}
I receive:
* fontspec warning: "icu-feature-not-exist-in-font"
* 
* OpenType feature 'Numbers=Uppercase' (lnum) not available for font
* 'StempelGaramondLTPro-Roman' with script 'Latin' and language 'Default'.

but lining number exist into the font: enter image description here

2
  • Make sure to add the lnum feature rather than just the absence of onum. You could instead use RawFeature = -onum to turn OldStyle off and get the default.
    – Davislor
    Commented Sep 28, 2018 at 20:33
  • By the way, I’d encourage you to ask your follow-up question separately, not at the end of an answer.
    – Davislor
    Commented Sep 28, 2018 at 20:33

You must log in to answer this question.

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