# fontspec, defining boldfont using diskfiles directly not possible?

I'm defining my mainfont using fontspec, providing an additional option for the italic fontshape:

\setmainfont[Path=C:/fonts/SabonNext/, ItalicFont = SabonNextLT-ItalicOsF.otf]{SabonNextLT-RegularOsF.otf} % Sabon next


It works perfectly, with the italic shape being the right one

However as soon as i try to define the BoldFont I run into troubles, and get the font-not-found error. I tried changing the filename to something simple and it didnt work, I tried the same for other fonts and got the same problem, defining italic font works perfectly, but boldfont is not possible to define:

preamble:

\setmainfont[Path=C:/fonts/SabonNext/, ItalicFont = SabonNextLT-ItalicOsF.otf, BoldFont = SabonNextLT-DemiOsF.otf]{SabonNextLT-RegularOsF.otf} % Sabon next


part of my log:

\g_fontspec_family_SabonNextLT-RegularOsF.otf_int=\count318
fontspec info: Defining font family 'SabonNextLT-RegularOsF.otf(0)' for font '
SabonNextLT-RegularOsF.otf' with options [Path=C:/fonts/SabonNext/, ItalicFont
= SabonNextLT-ItalicOsF.otf, BoldFont = SabonNextLT-DemiOsF.otf].

\g_fontspec_SabonNextLT-RegularOsF.otf(0)_prop=\toks58
fontspec info: Defining shape 'normal' with NFSS spec.:
(fontspec)  <->"[C:/fonts/SabonNext/SabonNextLT-RegularOsF.otf]/ICU:script=latn
;language=DFLT;"

fontspec info: Defining shape 'bold' with NFSS spec.:
(fontspec)  <->"[C:/fonts/SabonNext/SabonNextLT-DemiOsF.otf]/ICU:script=latn;la
nguage=DFLT;"

fontspec info: Defining shape 'italic' with NFSS spec.:
(fontspec)  <->"[C:/fonts/SabonNext/SabonNextLT-ItalicOsF.otf]/ICU:script=latn;
language=DFLT;"

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
!
! The font "SabonNextLT-DemiOsF.otf/I" cannot be found.
!
! See the fontspec documentation for further information.
! For immediate help type H <return>.
!...............................................

l.42 ...T-DemiOsF.otf]{SabonNextLT-RegularOsF.otf}
% Sabon next
|'''''''''''''''''''''''''''''''''''''''''''''''
| A font might not be found for many reasons.
| Check the spelling, where the font is installed etc. etc.
|
| When in doubt, ask someone for help!
|...............................................


Perhaps somebody could try and reproduce the error (with their own installed fonts?)

-
It seems that fontspec chokes when trying to define the Bold Italic font. Try specifying one font also for this shape. –  egreg May 11 '11 at 20:43
so you were able to reproduce the problem? ofcourse I can define the fonts in a different way, as i'm doing now. But it seems a bug in fontspec. –  Timtico May 12 '11 at 6:58

## 1 Answer

I can reproduce the problem with the Linux Biolinum fonts:

\documentclass[11pt]{scrartcl}
\usepackage{fontspec}

\setmainfont[BoldFont = fxbb.otf,
%BoldItalicFont=fxlbi.otf
]{fxbr.otf}
\begin{document}
abc
\end{document}


And I don't think it is a bug. The documentation says that it can happen that the bold italic font is not found and that you can provide it with the BoldItalicFont option:

The BoldFont and ItalicFont features are provided for these situations. If only one of these is used, the bold italic font is requested as the default from the new font. See Example 4. If a bold italic shape is not defined, or you want to specify both custom bold and italic shapes, the BoldItalicFont feature is provided.

-
it works only if i specify bold, italic and bolditalic fonts... Althought that seems abit strange to me, it's sufficient for now :) –  Timtico May 12 '11 at 13:38
If you declare only one font, fontspec has a clear starting point and also a clear "fall back" font if it can't find suitable italic and bold variant. But when you use the ItalicFont/BoldFont option two or three fonts are involved. This makes it much more difficult to decide automatically what the user actually wants for the last combination and so I think it is better if fontspec asks you do to specify the bolditalic too. –  Ulrike Fischer May 12 '11 at 13:45
ok, that makes more sense to me. But still it's strange that I get an ordinary font not found error, and it even suggest changing fontname etc. –  Timtico May 12 '11 at 16:18