On Mar 13, 2010, at 5:09 PM, Michael Saunders wrote:
I don't understand the syntax of \starttypescript. It doesn't appear in the manual. It occurs twice in the "typography" document. In both cases the first argument appears to be the name of the typescript. In one example, there is only one argument, and in the other example, the second argument appears to be a list of encodings. Since everything is now utf-8, I guess that could be forgotten. So, in your example here, I take "serif" to be the name of both typsecripts, but I don't know what [garamondprem] is doing.
We're talking about mkiv here, so we don't need to worry about encodings (which is a confusing topic - utf8 is not a font encoding, but an input encoding; these two are not identical). A typescript file can contain a series of typeface definitions, e.g., one for serif, one for sans, one for mono, one for math, etc. hence the syntax \starttypescript [<typeface>] [<identifier>]
It's never spelled out, but from looking at examples of \definefontsynonym [1][2] in the docs, I think it means something like "what we used to call 2 we can now call 1", i.e., telling the machine to replace instances of "1" with "2". If this is the case, your third arguments above just seem to apply your features to the fonts referred to, which makes sense. I don't see, though, why this has to be done twice, and with an extra layer of misdirection. E.g., instead of: \definefontsynonym [Garamond-Roman] [name:garamondpremierpro] [features=myroman] \definefontsynonym [Serif] [Garamond-Roman] [features=myroman] why not just: \definefontsynonym [Serif] [name:garamondpremierpro] [features=myroman]?
I think the purpose of the above step is to connect identifiers like "Serif" to a qualified font file.
You could indeed write typescripts without the extra layer of abstraction. It just may make it easier if you want to mix different fonts etc.
Finally, define your first typeface:
\starttypescript [GaramondPrem] \definetypeface [GaramondPrem] [rm] [serif] [garamondprem] [default] \stoptypescript
I think this is a typescript called GaramondPrem that contains a typeface called GaramondPrem. It seems a little redundant that they have the same name.
You can use two different names, if you prefer.
I know that the typescripts are referred to by \usetypescript, but I don't know where typefaces are referred to, so maybe it's just a dummy argument.
In the \usebodyfont or \switchtobodyfont commands.
The "[rm]" seems to be what links this to the font switching command, and the "[garamondprem]" obviously refers to both the typescripts you defined above. I don't understand what the "[serif]" is doing. In the typography manual, Hans says, "The third and fourth arguments to \definetypeface are pointers to already declared font sets; these are defined elsewhere." I think by "font set" he must mean a typescript like garamondprem, but I don't know where the font set (typescript?) "serif"
As I said: there's at least serif, sans, mono, math
is or why two font sets need to be pointed to.
???
The same typography document goes on to explain the fifth argument: "The fifth argument to \definetypeface specifies specific font size setups (if any), these will be covered in section ?? in the next chapter." This is getting scary, but I'm hoping putting "[optical]" there will solve everything.
I don't follow.
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
I think I follow you, up to the line: \definefontsynonym [SerifItalic] [Serif]. These last lines seem to say that if you're in bold or italic, that you should still use regular superior figures, but the font has its own bold and italic superiors. I think that's true of all the weight/shape/design size variations in the set.
It depends what you want to achieve. I map everything onto Serif because I do not want the superior numbers to be bold or italic, even in an italic environment. Of course, you can define something for all these variants.
\starttypescript [GaramondPremUpper] \definetypeface [GaramondPremUpper] [rm] [serif] [garamondpremupper] [default] \stoptypescript
I'm confused about how [GaramondPremUpper] and [garamondpremupper] seem to be getting associated with [rm] and [serif] after they were already associated with [GaramondPrem] and [garamondprem]. I don't see how, when I now use \rm, the machine is going to know whether I mean garamondpremupper or garamondprem. The rest of the file seems straightforward.
In ConTeXt, you are always within a certain bodyfont (the one defined with the \definetypeface command). A switch like \it or \rm will thus take the italic/roman from this bodyfont. Meaning: when you say \setubodyfont[GaramondPrem], it will use "normal" Garamond Premier, if you use \switchtobodyfont[GaramondPremUpper], it will use the superior numbers variant.
OK so far?
Thank you---that brought me a lot closer to understanding! after saving your example and running luatools --generate, I put the last lines in my test document and tried running Context on it in the usual way. I get the error: !undefined control sequence <recently read> \usetypescript l.12 \usetypescript [GaramondPrem]
Then we will need your example - this is not normal behavior. Thomas