Re: [NTG-context] Fonts with XeTeX

2008-11-17 Thread Thomas A. Schmitz

On Nov 17, 2008, at 9:39 PM, Bart C. Wise wrote:

 I am having difficulties writing a typescript for the Caslon font  
 that's on my
 system.

 The following works:

 \definetypeface[Caslon-Bold][rm][Xserif][CaslonOldFaceBT-Heavy]
 \definetypeface[Caslon-Italic][rm][Xserif][CaslonOldFaceBT-Italic]
 \definetypeface[Caslon-Regular][rm][Xserif][CaslonOldFaceBT-Roman]

 \starttext
 Testing
 \switchtobodyfont[Caslon-Regular] Testing
 \switchtobodyfont[Caslon-Bold] Testing
 \switchtobodyfont[Caslon-Italic] Testing
 \stoptext


 However, I tried to write a simple typescript for the same font.  I  
 came up
 with the following:

 \starttypescript[serif][caslon][uc]
\definetypeface[CaslonRegular][CaslonOldFaceBT-Roman][encoding=uc]
\definetypeface[CaslonItalic][CaslonOldFaceBT-Italic][encoding=uc]
\definetypeface[CaslonBold][CaslonOldFaceBT-Heavy][encoding=uc]
 \stoptypescript

 \starttypescript[serif][caslon][name]
\definefontsynonym  [Serif]   [CaslonRegular]
\definefontsynonym  [SerifItalic] [CaslonItalic]
\definefontsynonym  [SerifBold]   [CaslonBold]
 \stoptypescript

 \starttypescript[caslon][uc]
\definetypeface[caslon][rm][serif][caslon][default][encoding=uc]
 \stoptypescript

 \usetypescript[caslon][uc]
 \setupbodyfont[caslon, 12pt]

 \starttext
 Testing {\bf Testing} {\it Testing}
 \stoptext

 It fails to compile on the \setupbodyfont line.

 I know I'm doing something wrong, but every variation I've tried  
 ends up with
 a compile error, or the caslon font is never loaded and it reverts  
 back to the
 default font.

Fonts in XeTeX are still a mystery to me, but from what I've learned  
in the last months, it seems that the syntax for luatex typescripts  
can and should also be used for XeTeX. This works on my system (latest  
beta):

file: type-caslon.tex

%

\starttypescript [serif] [caslon]
   \definefontsynonym [Caslon-Roman]  [file:ACaslonPro- 
Regular]  [features=default]
   \definefontsynonym [Caslon-Bold]   [file:ACaslonPro-Bold]   
[features=default]
   \definefontsynonym [Caslon-Italic] [file:ACaslonPro- 
Italic]  [features=default]
   \definefontsynonym [Caslon-Bold-Italic][file:ACaslonPro- 
BoldItalic] [features=default]
   \definefontsynonym [Caslon-SmallCaps]  [file:ACaslonPro- 
Regular]  [features=smallcaps]
  \stoptypescript

\starttypescript [serif] [caslon]
   \usetypescript[serif][fallback]
   \definefontsynonym [Serif]   [Caslon-Roman]  
[features=default]
   \definefontsynonym [SerifItalic] [Caslon-Italic]  
[features=default]
   \definefontsynonym [SerifBold]   [Caslon-Bold] [features=default]
   \definefontsynonym [SerifBoldItalic] [Caslon-Bold-Italic]  
[features=default]
   \definefontsynonym [SerifCaps]   [Caslon-SmallCaps]  
[features=smallcaps]
\stoptypescript

\starttypescript [Caslon]
   \definetypeface [Caslon] [rm] [serif] [caslon] [default]
\stoptypescript

%%

and then:

\usetypescriptfile[type-caslon]
\usetypescript[Caslon]
\setupbodyfont[Caslon,12pt]

\starttext

Hello World!

\stoptext

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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Fonts with XeTeX

2008-11-17 Thread Arthur Reutenauer
Hello Bart,

  Try

  \starttypescript[serif][caslon][uc]
  \definefontsynonym[CaslonRegular][name:CaslonOldFaceBT-Roman][encoding=uc]
  \definefontsynonym[CaslonItalic][name:CaslonOldFaceBT-Italic][encoding=uc]
  \definefontsynonym[CaslonBold][name:CaslonOldFaceBT-Heavy][encoding=uc]
  \stoptypescript
  
  \starttypescript[serif][caslon][name]
  \definefontsynonym  [Serif]   [CaslonRegular]
  \definefontsynonym  [SerifItalic] [CaslonItalic]
  \definefontsynonym  [SerifBold]   [CaslonBold]
  \stoptypescript
  
  \starttypescript[caslon][uc]
  \definetypeface[caslon][rm][serif][caslon][default][encoding=uc]
  \stoptypescript
  
  \usetypescript[caslon][uc]
  \setupbodyfont[caslon, 12pt]
  
  \starttext
  Testing {\bf Testing} {\it Testing}
  \stoptext

  Note the two changes: \definetypeface's in the first typescript have
been replaced with \definefontsynonym commands, and the font names have
been prepended with name:, forcing XeTeX to look for an installed font
instead of a TFM (in plain XeTeX, you get the same result by surrounding
the font name with double quotes).

  I am unable to test the typescript because I don't have Caslon Old
Face, but it works when I replace the font names with the appropriate
faces from Adobe Caslon, which I have.

Arthur
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Fonts with XeTeX

2008-11-17 Thread Bart C. Wise
Arthur,

This works!  Thanks for your help.

Bart

On Monday 17 November 2008 02:25:15 pm Arthur Reutenauer wrote:
   Hello Bart,

   Try

   \starttypescript[serif][caslon][uc]
  
 \definefontsynonym[CaslonRegular][name:CaslonOldFaceBT-Roman][encoding=uc]
 \definefontsynonym[CaslonItalic][name:CaslonOldFaceBT-Italic][encoding=uc]
 \definefontsynonym[CaslonBold][name:CaslonOldFaceBT-Heavy][encoding=uc]
 \stoptypescript

   \starttypescript[serif][caslon][name]
   \definefontsynonym  [Serif]   [CaslonRegular]
   \definefontsynonym  [SerifItalic] [CaslonItalic]
   \definefontsynonym  [SerifBold]   [CaslonBold]
   \stoptypescript

   \starttypescript[caslon][uc]
   \definetypeface[caslon][rm][serif][caslon][default][encoding=uc]
   \stoptypescript

   \usetypescript[caslon][uc]
   \setupbodyfont[caslon, 12pt]

   \starttext
   Testing {\bf Testing} {\it Testing}
   \stoptext

   Note the two changes: \definetypeface's in the first typescript have
 been replaced with \definefontsynonym commands, and the font names have
 been prepended with name:, forcing XeTeX to look for an installed font
 instead of a TFM (in plain XeTeX, you get the same result by surrounding
 the font name with double quotes).

   I am unable to test the typescript because I don't have Caslon Old
 Face, but it works when I replace the font names with the appropriate
 faces from Adobe Caslon, which I have.

   Arthur
 ___
 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  : https://foundry.supelec.fr/projects/contextrev/
 wiki : http://contextgarden.net
 ___


___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___