Dear ConTeXtnicians:

I'm making progress understanding the typescripts model, though I have still not fully 
solved my problem. Please help set me straight and to complete and generalize what 
follows. I'm hoping the 
following can serve as a template for a ConTeXt font how-to/faq, something which seems 
to be desperately needed. mfonts.pdf is really obscure for beginners, unfortunately.

Given a set of 2 raw fonts, one activates them in ConTeXt through the following 6-part 
procedure:

1. Determine the style, family, and encoding and write a typescript with a more 
user-friendly, pretty name for the raw font:

\starttypescript           [style]                      [family]           [encoding]
  \definefontsynonym [Pretty]                    [original]         
[encoding=theencoding]
  \definefontsynonym [Pretty-Bold]            [originalb]       
[encoding=theencodingenc]
\stoptypescript

The [encoding=theencoding] position may be left blank if the encoding is OT1 or  7-bit 
ascii. Is this correct? 

2. There may be other fonts using the same style, so a more generic abstract style 
name is associated with the font:

\starttypescript         [style]                      [family]                         
[name]
\definefontsynonym [Style]                      [Pretty sa 1.6]
\definefontsynonym [Style-Bold]              [Pretty-Bold sa 1.6]
\stoptypescript

3. Set up the appropriate sizes for the fonts with respect to one of the default style 
parameters,
rm, ss, tt, mm, cg, or hw. 

\starttypescript   [style]                                                             
                [default]  [size]
\definebodyfont [20.7pt, 17.3pt, 14.4pt, 12pt, 11pt, 10pt, 9pt, 8pt, 7pt]  [rm]        
 [default]
\stoptypescript

For what does the `default' option in the 2nd arg. to \starttypescript stand?
For what does the `default' option in the 3rd arg. to \definebodyfont stand?
Can one associate any style one pleases with, say, [rm], or is there more involved?

4. Combine the generic abstract style and size typescripts into a single font 
collection:

\starttypescript [collect]
\usetypescript  [style]   [family]    [name]
\usetypescript  [style]   [default]  [size]
\stoptypescript

5. Use the collection in a typeface which takes 6 parameters:

collection name
style parameter 
style
family
!not sure what this is!
encoding/rscale options

\starttypescript [mycollect]
\definetypeface [collect] [rm] [style] [family] [default] [encoding=theencoding, 
rscale=thescalefactor]
\stoptypescript

What does `rscale' mean? What is the purpose of the style parameter here? This is an 
importan question because I think the crux of my problem is here as I will explain 
below.

6. Place the above code into a file type-fam.To use the font issue the following:

\usetypescriptfile[type-fam]
\usetypescript[mycollect
\setupbodyfont[collect]

The font should work now. But see below!

========================================================
Now I tried this but it's not working. I have discovered something which may be the 
source of the bug.

0. My two raw fonts are omarab and omarabb, located in \texmf\fonts\ovf\public\omega 
of any tex distribution. 

% type-arabic.tex
%1. style, family, and encoding

\starttypescript [naskh] [omega] [default]
  \definefontsynonym [OmegaArabic]             [omarab]
  \definefontsynonym [OmegaArabic-Bold]        [omarabb]
\stoptypescript

%2. abstract style synonyms

\starttypescript [naskh] [omega] [name]
\definefontsynonym [Naskh]      [OmegaArabic sa 1.6]
\definefontsynonym [NaskhBold]  [OmegaArabic-Bold sa 1.6]
\stoptypescript

%3. sizes

\starttypescript [naskh] [default] [size]
\definebodyfont
[20.7pt, 17.3pt, 14.4pt, 12pt, 11pt, 10pt, 9pt, 8pt, 7pt] [rm] [default]
\stoptypescript

%4. final collection

\starttypescript [omarab]
\usetypescript [naskh] [omega] [name]
\usetypescript [naskh] [default] [size]
\stoptypescript

%5. typeface

\starttypescript [arabtest]
\definetypeface [omartest] [rm]
[naskh] [omega] [default] [rscale=1] % [encoding=default]
\stoptypescript

%6. invocation

\usetypescriptfile[type-arabic]
\usetypescript[arabtest]
\setupbodyfont[omartest]

==========================

When I follow the above steps, this is what happens:
====================
(./om-test4.tuo) (./om-test4.tuo)
systems        : begin file om-test4 at line 19
typescript     : [arabtest] [] []
(c:/TeXLive/texmf/tex/context/base/type-syn.tex)
(c:/TeXLive/texmf/tex/context/base/type-enc.tex)
(c:/TeXLive/texmf/tex/context/base/type-siz.tex)
(c:/TeXLive/texmf/tex/context/base/type-map.tex)
(c:/TeXLive/texmf/tex/context/base/type-spe.tex)
(c:/TeXLive/texmf/tex/context/base/type-exa.tex) (./type-arabic.tex
typeface       : [omartest] [rm] [naskh] [omega]
typescript     : [naskh] [omega] [name,default,default,special]
(c:/TeXLive/texmf/tex/context/base/type-syn.tex)
(c:/TeXLive/texmf/tex/context/base/type-enc.tex)
(c:/TeXLive/texmf/tex/context/base/type-siz.tex)
(c:/TeXLive/texmf/tex/context/base/type-map.tex)
(c:/TeXLive/texmf/tex/context/base/type-spe.tex)
(c:/TeXLive/texmf/tex/context/base/type-exa.tex) (./type-arabic.tex)
typescript     : [naskh] [default] [size]
(c:/TeXLive/texmf/tex/context/base/type-syn.tex)
(c:/TeXLive/texmf/tex/context/base/type-enc.tex)
(c:/TeXLive/texmf/tex/context/base/type-siz.tex)
(c:/TeXLive/texmf/tex/context/base/type-map.tex)
(c:/TeXLive/texmf/tex/context/base/type-spe.tex)
(c:/TeXLive/texmf/tex/context/base/type-exa.tex) (./type-arabic.tex))
Missing character: There is no ^^^^0242 in font cmr10!
:
:
======================

cmr10 is being called instead of omarab. But here is a clue: 

If I replace `[rm]' with `[ss]' in step 3 alone,  I get cmr12 called;
If I replace `[rm]' with `[ss]' in step 3 and step5,  I get cmss10 called;
If I replace `[rm]' with `[ss]' in step 5 alone,  I get cmr10 called;

This all makes me think that I am missing at least one important step above. Can 
anyone tell us what that is?
I am getting really desperate here...

Again, I hope some of you will help me to develop this into a more general font faq.

Best wishes
Idris

Dr. Idris Samawi Hamid
Depatment of Philosophy
Colorado State University
Fort Collins, CO 80526


Reply via email to