I've been trying to figure out how to use Bembo Std (an OpenType font
from Adobe) in ConTeXt + XeTeX.
The example on the _Fonts in XeTeX_ page in the wiki works fine except
for small caps, which (not surprisingly) don't show up in this first
attempt:
\definetypeface[bembo][rm][Xserif][Bembo Std]
\setupbodyfont[bembo]
\starttext
Bembo {\bf Bembo} {\it Bembo} {\sc Bembo} Bembo.
\stoptext
Small caps are present in the font (feature "smcp" according to
otfinfo), as this minimal example shows:
\definetypeface[bembo][rm][Xserif][Bembo
Std:mapping=tex-text;+kern;+onum;+liga]
\setupbodyfont[bembo,11pt]
\setupbodyfontenvironment[default][em=italic]
\def\it{\definedfont["Bembo
Std-Italic:mapping=tex-text;+kern;+onum;+liga"]}
\def\bf{\definedfont["Bembo Std-Bold:mapping=tex-text;+kern;+onum"]}
\def\sc{\definedfont["Bembo Std:mapping=tex-text;+smcp;+kern;+onum"]}
\starttext
Bembo {\bf Bembo} {\it Bembo} {\sc Bembo} Bembo.
\stoptext
But that's a hack. So I create a file "type-bembo.tex":
\starttypescript[bembo][uc]
\definetypeface [bembo] [rm] [serif] [Bembo Std] [default]
[encoding=uc]
\definefontsynonym[BemboRegular]["Bembo Std:mapping=tex-text"]
[encoding=uc]
\definefontsynonym[BemboItalic] ["Bembo
Std-Italic:mapping=tex-text"][encoding=uc]
\definefontsynonym[BemboBold] ["Bembo Std-Bold:mapping=tex-text"]
[encoding=uc]
\definefontsynonym[BemboCaps] ["Bembo
Std:mapping=tex-text;+smcp"] [encoding=uc]
\stoptypescript
\starttypescript[serif][bembo][name]
\definefontsynonym[Serif] [BemboRegular]
\definefontsynonym[SerifItalic] [BemboItalic]
\definefontsynonym[SerifBold] [BemboBold]
\definefontsynonym[SerifCaps] [BemboCaps]
\definefontsynonym[SerifSlanted] [BemboItalic]
\definefontsynonym[SerifBoldItalic] [BemboBold]
\definefontsynonym[SerifBoldSlanted][BemboBold]
\stoptypescript
And a test file in the same directory as the typescript file:
\usetypescriptfile[type-bembo]
\usetypescript[bembo][uc]
\setupbodyfont[bembo,11pt]
\starttext
Bembo {\bf Bembo} {\it Bembo} {\sc Bembo} Bembo.
\stoptext
Now I get small caps all right, but everything's in Computer Modern.
:-( What am I doing wrong?
Changing the double quotes in the typescript to single quotes doesn't
make any difference; not does omitting the quotes or omitting the space
in "Bembo Std".
Here's the output from texexec --xtx --version:
TeXExec 5.4.3 - ConTeXt / PRAGMA ADE 1997-2005
texexec : TeXExec 5.4.3 - ConTeXt / PRAGMA ADE
1997-2005
texutil : TeXUtil 9.0.1 - ConTeXt / PRAGMA ADE
1992-2006
tex : XeTeX, 3.141592-2.2-0.99b (Web2C 7.5.3)
context : ver: 2006.03.31 23:47
cont-en : ver: 2006.03.31 23:47 fmt: 2006.4.3 mes:
english
cont-nl : ver: 2006.03.31 23:47 fmt: 2006.4.3 mes:
dutch
Thanks in advance,
Paul.
--
Paul Hoffman
On 7/12/06, Paul Hoffman wrote:
The example on the _Fonts in XeTeX_ page in the wiki works fine except for small caps, which (not surprisingly) don't show up in this first attempt:
\definetypeface[bembo][rm][Xserif][Bembo Std] \setupbodyfont[bembo] \starttext Bembo {\bf Bembo} {\it Bembo} {\sc Bembo} Bembo. \stoptext
[minimal fix] In type-xtx.tex add the following line: \definefontsynonym[DummyCaps]['\typescripttwo:mapping=tex-text;+smcp'][encoding=uc] and change this one: \definefontsynonym[SerifCaps] [DummyCaps] Hans, can you please do that in the distribution as well? (actually this should either be changed/added all over the place in that file or some more general interface should be provided which would process the "caps" option automatically) Mojca
Mojca Miklavec wrote:
On 7/12/06, Paul Hoffman wrote:
The example on the _Fonts in XeTeX_ page in the wiki works fine except for small caps, which (not surprisingly) don't show up in this first attempt:
\definetypeface[bembo][rm][Xserif][Bembo Std] \setupbodyfont[bembo] \starttext Bembo {\bf Bembo} {\it Bembo} {\sc Bembo} Bembo. \stoptext
[minimal fix]
In type-xtx.tex add the following line: \definefontsynonym[DummyCaps]['\typescripttwo:mapping=tex-text;+smcp'][encoding=uc]
Hmm. Clever approach, but that puts a strong bias on loading fonts by the OpenType method, only. That assumption isn't valid with XeTeX on Mac (fast heading to being a minority ;) -- there's the ATSUI font loading syntax as well, which looks very different. That said, now that I'm kind of back (hi), type-xtx and basically all the XeTeX stuff needs a radical re-think, as I had used the \ifXeTeX switch as a sign we were on a specific platform, not running a specific TeX. -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Adam T. Lindsay, Computing Dept. atl@comp.lancs.ac.uk Lancaster University, InfoLab21 +44(0)1524/510.514 Lancaster, LA1 4WA, UK Fax:+44(0)1524/510.492 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Hi Paul. You almost got it. You slightly misunderstood the use of the definetypface line... Paul Hoffman wrote:
But that's a hack. So I create a file "type-bembo.tex":
\starttypescript[bembo][uc]
not quite. try: \starttypescript[serif][bembo][uc]
\definetypeface [bembo] [rm] [serif] [Bembo Std] [default] [encoding=uc] \definefontsynonym[BemboRegular]["Bembo Std:mapping=tex-text"] [encoding=uc] \definefontsynonym[BemboItalic] ["Bembo Std-Italic:mapping=tex-text"][encoding=uc] \definefontsynonym[BemboBold] ["Bembo Std-Bold:mapping=tex-text"] [encoding=uc] \definefontsynonym[BemboCaps] ["Bembo Std:mapping=tex-text;+smcp"] [encoding=uc] \stoptypescript
Okay, you just need to take the "definetypeface" line out of the above definition. We'll rewrite it and re-place it below.
\starttypescript[serif][bembo][name] \definefontsynonym[Serif] [BemboRegular] \definefontsynonym[SerifItalic] [BemboItalic] \definefontsynonym[SerifBold] [BemboBold] \definefontsynonym[SerifCaps] [BemboCaps] \definefontsynonym[SerifSlanted] [BemboItalic] \definefontsynonym[SerifBoldItalic] [BemboBold] \definefontsynonym[SerifBoldSlanted][BemboBold] \stoptypescript
These lines look pretty good (although I suspect you could be defining Bold Italic as well). You want a third typescript that creates the typeface definition. It's this thing that calls the other two: \starttypescript[bembo][uc] \definetypeface [bembo] [rm] [serif] [bembo] [default] [encoding=uc] \stoptypescript
And a test file in the same directory as the typescript file:
\usetypescriptfile[type-bembo] \usetypescript[bembo][uc] \setupbodyfont[bembo,11pt] \starttext Bembo {\bf Bembo} {\it Bembo} {\sc Bembo} Bembo. \stoptext
Now I get small caps all right, but everything's in Computer Modern. :-( What am I doing wrong?
You're just missing some of the magic in the definetypeface line. To show the arbitrariness of some of the names, you can change the last definition and how you call it: \starttypescript[OpenTypeBembo] \definetypeface [BooBoo] [rm] [serif] [bembo] [default] [encoding=uc] \stoptypescript \usetypescriptfile[type-bembo] \usetypescript[OpenTypeBembo] \setupbodyfont[BooBoo,11pt] And when you call the "BooBoo" typeface, it knows that definition and calls the following definitions when using the \rm family: \starttypescript[serif][bembo] [uc] \starttypescript[serif][bembo] [name] \starttypescript[serif][default][size] (and some other, special definitions that 98% of the time you don't need to worry about.) Does that work? -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Adam T. Lindsay, Computing Dept. atl@comp.lancs.ac.uk Lancaster University, InfoLab21 +44(0)1524/510.514 Lancaster, LA1 4WA, UK Fax:+44(0)1524/510.492 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Bingo! Thanks a million, Adam; that did the trick.
To show the arbitrariness of some of the names, you can change the last definition and how you call it:
\starttypescript[OpenTypeBembo] \definetypeface [BooBoo] [rm] [serif] [bembo] [default] [encoding=uc] \stoptypescript
\usetypescriptfile[type-bembo] \usetypescript[OpenTypeBembo] \setupbodyfont[BooBoo,11pt]
And when you call the "BooBoo" typeface, it knows that definition and calls the following definitions when using the \rm family:
\starttypescript[serif][bembo] [uc] \starttypescript[serif][bembo] [name] \starttypescript[serif][default][size]
(and some other, special definitions that 98% of the time you don't need to worry about.)
Aha! That explains a lot. Now I know how to define a variant with
old-style figures:
\starttypescript[serif][bembo][uc]
\definefontsynonym[BemboRegular]
["Bembo Std:mapping=tex-text"]
[encoding=uc]
...
\stoptypescript
%
\starttypescript[serif][bembo-osf][uc]
\definefontsynonym[BemboRegular]
["Bembo Std:mapping=tex-text;+onum"]
[encoding=uc]
...
\stoptypescript
%
\starttypescript[serif][bembo,bembo-osf][name]
\definefontsynonym[Serif][BemboRegular]
...
\stoptypescript
%
\starttypescript[bembo][uc]
\definetypeface[bembo]
[rm][serif][bembo][default][encoding=uc]
\definetypeface[bembo-osf]
[rm][serif][bembo-osf][default][encoding=uc]
\stoptypescript
I figured out bold italic, too ("Bembo Std-Bold Italic", not "Bembo
Std-BoldItalic", d'oh!) and all is golden. I suppose I should try to
fix the typescript so it can be used with other encodings, but I'll
leave that for another day. For now, I'm just thrilled to be able to
use my brand new shiny font. ConTeXt + XeTeX + Adobe Bembo Std +
helpful netizens = bliss.
Paul.
--
Paul Hoffman
participants (3)
-
Adam Lindsay
-
Mojca Miklavec
-
Paul Hoffman