Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I absolute adore Adobe's Garamond Premier Pro (the full set of opticals). In normal circumstances, I can just use it with \setmainfont{Garamond Premier Pro} when I'm working on my desktop, or laptop.

However, for various reasons I need to do my typesetting on the go. Naturally I can't (and won't) install Garamond Premier Pro on every single computer I use, so I need to make use of it as a "local" font, same with the other fonts I use in the document.

The problem is, I cannot for the life of me, figure out the how to configure fontspec to actually use all of it.

Here is a barebones, minimum example of my file:

\documentclass[letterpaper,10pt]{article}
\usepackage[letterpaper]{geometry}
\usepackage{fontspec}

\defaultfontfeatures{Ligatures=TeX}
\setmainfont[
    Path = fonts/Garamond/ ,
    Extension = .otf ,
    SizeFeatures={
        {Size=-8,UprightFont=*-Capt,BoldFont=*-BdCapt,ItalicFont=*-

ItCapt,BoldItalicFont=*-BdItCapt},
        {Size=8-14,UprightFont=*,BoldFont=*-Bd,ItalicFont=*-

It,BoldItalicFont=*-BdIt},
        {Size=14-21,UprightFont=*-Subh,BoldFont=*-BdSubh,ItalicFont=*-

ItSubh,BoldItalicFont=*-BdItSubh},
        {Size=21-,UprightFont=*-Disp,BoldFont=*-BdDisp,ItalicFont=*-

ItDisp,BoldItalicFont=*-BdItDisp}}
    ]{GaramondPremrPro}
\setsansfont[Path = fonts/Optima/ ,
    Extension = .otf ,
    UprightFont = * ,
    BoldFont = *-Bold ,
    ItalicFont = *-Italic ,
    BoldItalicFont = *-BoldItalic
    ]{OptimaLTStd}
\setmonofont[Path = fonts/OCR/ ,
    Extension = .otf ,
    UprightFont = *,
    BoldFont = *
    ]{OCRAStd}

\begin{document}
    Hello, world! \quad \textit{Hello, world!} \quad \textbf{Hello, world!} 

\quad \textbf{\textit{Hello,world!}}

    \textsf{Hello, world! \quad \textit{Hello, world!} \quad \textbf{Hello, 

world!} \quad \textbf{\textit{Hello,world!}}}

    \texttt{Hello, world!}
\end{document}

The way I have Optima and OCR A setup works just fine; point in fact I tried setting up Adobe's Caslon using a similar configuration as for the Optima and OCR A fonts, and the file compiles just perfectly.

The error I get when I attempt to compile anything is:

(E:\PORT\MiKTeX\tex\latex\fontspec\fontspec.cfg)))

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! LaTeX error: "kernel/key-unknown"
!
! The key 'fontspec/Size' is unknown and is being ignored.
!
! See the LaTeX3 documentation for further information.
!
! For immediate help type H <return>.
!...............................................

l.14 ^^I]{GaramondPremrPro}

?

I'm not sure of the precise version of fontspec my version of MiKTeX (portable) is running; but I only just installed MiKTeX (portable) on my flash drive a week ago, and it only downloaded fontspec from the package repository a few days back (I want to say three, but I may be incorrect).

All in all, what I'm looking for is some help in figuring out that fontspec error message, and actually finding a way to setup Garamond Premier Pro. Though this would apply to any other time one would need to setup a local opticals font.


EDIT

Many thanks to Ulrike Fischer for pointing out an error in my MWE. However the problem still persists, now with a different error:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! LaTeX error: "kernel/key-unknown"
!
! The key 'fontspec/UprightFont' is unknown and is being ignored.
!
! See the LaTeX3 documentation for further information.
!
! For immediate help type H <return>.
!...............................................

l.14 ^^I]{GaramondPremrPro}

?
share|improve this question
    
There is a pair of braces missing around all the Size-specifications. –  Ulrike Fischer Mar 19 at 15:54
    
Welcome to TeX.SX! –  Adam Liter Mar 19 at 16:45
    
@UlrikeFischer Thank you for pointing that out. I've edited the question and posted the results. The problem persists. –  CMG Mar 19 at 16:47
    
I don't think that you can use keys like UprightFont in the argument of SizeFeatures. If you need such a fine grained control about the font choice you will imho have to write fd-files. Look at the euenc-package and eu1lmr.fd (xelatex) and eu2lmr.fd (lualatex) for examples. –  Ulrike Fischer Mar 19 at 17:03
    
@UlrikeFischer Well, I'm pretty stumped as to how looking at the LMR font definition file will help me. I know that it can help, I just have no idea what I'm to actually do with it. –  CMG Mar 22 at 17:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.