6

I suspect this isn't valid code, but the docs are ambiguous.

fontspec is loaded with \fontspec[<font features>]{fontname}. BoldFont is included in "font features". Then I should be able to recursively define:

\setmainfont[SizeFeatures={
{Size={-8},BoldFont=Arial},
{Size=8-}}]{Hoefler Text}

But this gives

(fontspec) The following font options are not recognised:
(fontspec)     BoldFont=Arial

Not allowed or there's a way around it? My hopes were to make the whole font definitions in this way (with BoldFeatures={SizeFeatures=...} again and so on).

A minimal working file:

\documentclass{article}
\usepackage{fontspec}

\setmainfont[SizeFeatures={
{Size={-8},BoldFont=Arial},
{Size=8-}}]{Hoefler Text}

\begin{document}
Normal text\
{\small \textbf{Small bold}}\\
\end{document}

Edit: Using Gentoo/Linux, Texlive-2010

2
  • (Wanted to add the tag "sizefeatures" but not allowed to new members, could someone create it?)
    – user7384
    Aug 22, 2011 at 11:55
  • 1
    Welcome to tex.sx! I think fontspec is precise enough for a tag.
    – raphink
    Aug 22, 2011 at 12:13

1 Answer 1

5

define first a bold font:

\documentclass{article}
\usepackage{fontspec}

\setmainfont[BoldFont=Arial Bold,
  SizeFeatures={
  {Size={-8},BoldFont=Arial Bold},
  {Size=8-}}]{Hoefler Text}

\begin{document}
Normal text\\

{\small \textbf{Small bold}}\\
\end{document}
6
  • (fontspec) The following font options are not recognised: (fontspec) BoldFont=Arial Bold For immediate help type H <return>. ... l.7 {Size=8-}}]{Hoefler Text}
    – user7384
    Aug 22, 2011 at 12:42
  • I get the above with your code, or other fonts. (XeLatex is working fine with other samples)
    – user7384
    Aug 22, 2011 at 12:44
  • are you running Linux or Windows?
    – user2478
    Aug 22, 2011 at 13:53
  • Sorry Linux/Gentoo, TexLive 2010
    – user7384
    Aug 22, 2011 at 15:09
  • 2010 is a bit old for the package fontspec. Can yiou upgrade to 2011?
    – user2478
    Aug 22, 2011 at 15:38

You must log in to answer this question.

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