Hi Michael,

This is not to disparage Wolfgang's great simplefonts module, but I learnt 
setting up fonts the old-fashioned way (with typescripts), so I will give a few 
explanations about this approach. Most of what you want can be achieved easily. 
I have Garamond Premier myself, and this is how I set it up:

It looks like you're only using mkiv. So: call a file type-garamondprem.tex. 
Here's what we will do:

first, we want to find out what features our font offers. On my system:

otfinfo -f ~/texmf/fonts/opentype/adobe/garmprem/GaramondPremrPro.otf 
aalt    Access All Alternates
c2sc    Small Capitals From Capitals
calt    Contextual Alternates
case    Case-Sensitive Forms
cpsp    Capital Spacing
dlig    Discretionary Ligatures
dnom    Denominators
fina    Terminal Forms
frac    Fractions
hist    Historical Forms
kern    Kerning
liga    Standard Ligatures
lnum    Lining Figures
numr    Numerators
onum    Oldstyle Figures
ordn    Ordinals
ornm    Ornaments
pnum    Proportional Figures
salt    Stylistic Alternates
sinf    Scientific Inferiors
size    Optical Size
smcp    Small Capitals
ss01    Stylistic Set 1
ss02    Stylistic Set 2
ss03    Stylistic Set 3
sups    Superscript
tnum    Tabular Figures
zero    Slashed Zero

You can enable these features with the four-letter-code and "yes." So we define 
a set of such features for the different font instances we want to define. In 
my case, I want regular text with oldstyle figures, small caps with lining 
figures, and superior numerals. This goes into your typescript:

\definefontfeature
  [myroman]
  
[protrusion=pure,expansion=quality,script=latn,liga=yes,onum=yes,pnum=yes,kern=yes,tlig=yes,trep=yes]

\definefontfeature
  [mysmcp]
  
[mode=node,script=latn,language=dflt,liga=yes,lnum=yes,tnum=yes,kern=yes,tlig=yes,trep=yes,smcp=yes]

\definefontfeature
  [mysup]
  [mode=node,script=latn,onum=no,pnum=yes,sups=yes]

Next step: we set up the "normal" and smallcaps font:

\starttypescript [serif] [garamondprem] 
  \definefontsynonym [Garamond-Roman]          [name:garamondpremierpro]  
[features=myroman]
  \definefontsynonym [Garamond-Bold]           [name:garamondpremierprobold]  
[features=myroman]
  \definefontsynonym [Garamond-Italic]         [name:garamondpremierproitalic]  
[features=myroman]
  \definefontsynonym [Garamond-Bold-Italic]    
[name:garamondpremierprobolditalicc] [features=myroman]
  \definefontsynonym [Garamond-SmallCaps]      [name:garamondpremierpro]  
[features=mysmcp]
 \stoptypescript

\starttypescript [serif] [garamondprem]
  \definefontsynonym [Serif]           [Garamond-Roman] [features=myroman]
  \definefontsynonym [SerifItalic]     [Garamond-Italic] [features=myroman]
  \definefontsynonym [SerifBold]       [Garamond-Bold] [features=myroman]
  \definefontsynonym [SerifBoldItalic] [Garamond-Bold-Italic] [features=myroman]
  \definefontsynonym [SerifCaps]       [Garamond-SmallCaps] [features=mysmcp]
\stoptypescript

Finally, define your first typeface:

\starttypescript [GaramondPrem]
  \definetypeface [GaramondPrem] [rm] [serif] [garamondprem] [default]
\stoptypescript 

Next step: defining a typeface with superior numbers for footnote references 
etc.:

\starttypescript [serif] [garamondpremupper]
  \definefontsynonym [GaramondPremUpper-Roman]   [name:agaramondproregular]  
[features=mysup]
 \stoptypescript

\starttypescript [serif] [garamondpremupper]
  \definefontsynonym [Serif]           [GaramondPremUpper-Roman]      
[features=mysup]
  \definefontsynonym [SerifItalic]     [Serif]
  \definefontsynonym [SerifBold]       [Serif]
  \definefontsynonym [SerifBoldItalic] [Serif]
  \definefontsynonym [SerifCaps]       [Serif]
  \stoptypescript

\starttypescript [GaramondPremUpper]
  \definetypeface [GaramondPremUpper] [rm] [serif] [garamondpremupper] [default]
\stoptypescript 

Save this typescript somewhere where ConTeXt can find it and run luatools 
--generate. To use these in your documents, you need these lines

\usetypescriptfile[type-garamondprem]
\usetypescript[GaramondPremUpper]
\usetypsecript[GaramondPrem]
\setupbodyfont[GaramondPrem,11pt]

OK so far?

On Mar 12, 2010, at 8:11 PM, Michael Saunders wrote:

> 
> Thank you once again.  That _did_ work, after I got rid of an \os (I
> used it because I saw it in the manual).
> 
> The command \definefontfeature intrigues me greatly.  I wonder if it
> could solve all my problems.  I'd love to understand it so that I
> don't end up coming in here and asking you to write all my font setups
> line by line.  I Googled it and found only a few scattered examples
> here and there, mostly from this list.  I wish I could find an
> explanation of it written down somewhere.  For example, I would very
> much like to know:
> 
> 1. What the first two arguments do.
> 2. What keys and values are available for the third, and what they mean.

See above: all the font features your font offers.

> 3. Once I have composed a \definefontfeature command, how do I use it
> in the text.
> 4. For example, I gathered that I needed a [default]  [default]
> [...onum=yes...] to get oldstyle numerals by default, but what if I
> want to use some lining numerals here and there?
> \definefontfeature [lining]  [lining]  [...onum=no...]
> {\lining 123}
> doesn't do it.

You can write {\sc 123} (because your smallcap font has lining figures). \os is 
tied to math and creates problems when used with professional fonts that don't 
have an accompanying math font.

> 5. How I could use the superior and inferior shapes in my font---like
> for the footnotemarks, for example?

You have defined a font instance with superiors. To use it, set up your 
footnotes accordingly:

\setupfootnotes[textstyle=normal,
                textcommand={\switchtobodyfont[GaramondPremUpper]},
                numbercommand={\switchtobodyfont[GaramondPremUpper]}]


> 6. Could I use \definefontfeature to set up the different design sizes
> of my font (I'm trying to use some standard Adobe fonts like Garamond
> Premiere Pro, which have design sizes), as well as its other features?

I haven't yet played with this, sorry.

> 7. Maybe \definefontfeature is how I should turn on hz?

With the fontfeature, we have defined to use protrusion=pure,expansion=quality 
. To enable it, put this in the preamble of your document:

\enableprotruding
\enableadjusting

HTH

Thomas
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to