ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Henning Hraban Ramm <hraban@fiee.net>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: typescript
Date: Sat, 19 Apr 2008 19:12:12 +0200	[thread overview]
Message-ID: <089BDC51-A2DC-4F9E-B4CC-72791D43780D@fiee.net> (raw)
In-Reply-To: <87lk3axfw7.fsf@zapata.tots-ns.net>

[-- Attachment #1: Type: text/plain, Size: 7350 bytes --]

Am 2008-04-19 um 13:06 schrieb Antoine Junod:

> \starttypescript[serif][garamondpp]
>     \definefontsynonym [GaramondPP-Roman]      [GaramondPremrPro]
>     \definefontsynonym [GaramondPP-Bold]       [GaramondPremrPro-Bd]
>     \definefontsynonym [GaramondPP-Italic]     [GaramondPremrPro-It]
>     \definefontsynonym [GaramondPP-Bold-Italic][GaramondPremrPro-BdIt]
> \stoptypescript
>
> If I've understood what I did in that part, I've simply defined alias
> for the font file names. What I do not catch is the \starttypescript
> line. Is it right to say that the second parameter is the name of the
> 'class' to which the definitions that follow are linked? Second
> question on that part: Is the first argument (serif) a reserved
> keyword or not? What's the point of that argument? Third and last
> question for that part, in the case, as in here, where the font file
> names are easy to remember, is it still needed to create that synonyms
> for any reason?

Only answering your third question:

You mentioned later other faces of that font, e.g. Medium.
You can (and should) map *all* faces in that first typescript if you  
intend to use them later.
(With big families that may be around 50 faces.)

Beware, if you write typescripts for XeTeX/luaTeX, you must define if  
your "font name" is the "screen name" (aka PostScript name) or the  
file name: [file:GaramondPremrPro] vs. [name:Garamond Premier Pro]


If you write typescripts for pdfTeX (mkII), you should give a third  
argument that defines the encodings that the font supports, like:
\starttypescript	[serif]	[urw-antiqua]	[ec,texnansi,qx,t5]
	\definefontsynonym	[URWAntiquaT-Regu]	[\typescriptthree-u003003t]	 
[encoding=\typescriptthree]

The file name is here in fact the name of the tfm file!

(I hope I don't tell you something deprecated here...)


> Then, I wrote the [name] part of the typescript, as the following:
>
> \starttypescript[serif][garamondpp][name]
>     \definefontsynonym [Serif]                  [GaramondPP-Roman]
>     \definefontsynonym [SerifBold]              [GaramondPP-Bold]
>     \definefontsynonym [SerifItalic]            [GaramondPP-Italic]
>     \definefontsynonym [SerifSlanted]           [SerifItalic]
>     \definefontsynonym [SerifBoldItalic]        [GaramondPP-Bold- 
> Italic]
> \stoptypescript
>
> If I caught the point of the last argument, it is here to indicate
> that what follows links font files to the pre-defined font concept
> that are Serif, SerifBold, SerifItalic and so on and so on). Here are
> my questions: I've seen in the sources that there were 7 predefined
> types in the Serif family: Serif, SerifBold, SerifItalic,
> SerifSlanted, SerifBoldItalic and SerifBoldSlanted. What if I have a
> font that not only have a Bold face but also a Medium face and a
> SemiBold face? Second question: my font do not have a slanted face and
> I do not want to have pieces of computer modern in the text because,
> by mistake, I typed an \sl switch or something related. To avoid that,
> you can see I declared SerifSlanted to be a synonym for
> SerifItalic. Is it the way to do that or is it better to directly
> define SerifSlanted as a synonym to GaramondPP-Italic (in my case)?

There are some more keywords:
SerifOldstyle (numbers only), SerifCaps, SerifBoldCaps
You can also define your own variants like this:
\definefontvariant [Serif] [shadow] [Shadow] % use with \Var[shadow]

If you defined a big family in your first typescript you can use this  
setup for different four-member sub-families:

% serif urw-antiqua (normal)
\starttypescript	[serif]	[urw-antiqua]	[name]
%\usetypescript	[serif]	[urw-antiqua]	[\defaultencoding]
	\definefontsynonym	[Serif]		[URWAntiquaT-Regu]
	\definefontsynonym	[SerifSlanted]	[URWAntiquaT-ReguObli]
	\definefontsynonym	[SerifItalic]	[URWAntiquaT-ReguObli]
	\definefontsynonym	[SerifBold]	[URWAntiquaT-Bold]
	\definefontsynonym	[SerifBoldSlanted]	[URWAntiquaT-BoldObli]
	\definefontsynonym	[SerifBoldItalic]	[URWAntiquaT-BoldObli]
\stoptypescript

% serif urw-antiqua (normal bold)
\starttypescript	[serif]	[urw-antiqua-bold]	[name]
\usetypescript	[serif]	[urw-antiqua]	[\defaultencoding]
% different name, so you must load it explicitely!
% or:
% \setups	[font:fallback:serif]
	\definefontsynonym	[Serif]		[URWAntiquaT-Medi]
	\definefontsynonym	[SerifSlanted]	[URWAntiquaT-MediObli]
	\definefontsynonym	[SerifItalic]	[URWAntiquaT-MediObli]
	\definefontsynonym	[SerifBold]	[URWAntiquaT-ExtrBold]
	\definefontsynonym	[SerifBoldSlanted]	[URWAntiquaT-ExtrBoldObli]
	\definefontsynonym	[SerifBoldItalic]	[URWAntiquaT-ExtrBoldObli]
\stoptypescript

I.e. such a "name" typescript defines the related faces for the  
simple style commands (\tf, \bf, \it, \sl etc.)

I mostly map slanted and italic to the same italic face. But it's a  
matter of taste.

You can also do it this way:
	\definefontsynonym	[SerifSlanted]		[SerifItalic]
	\definefontsynonym	[SerifBoldSlanted]	[SerifBoldItalic]

For families with "unusual" faces like plain/shadow/outline or  
regular/sketchy/mixedcase I "abuse" these predefined styles to access  
all available faces.

Find a sample attached.

> And for the last part of my little type script:
>
> \starttypescript [GaramondPP]
>     \definetypeface [GaramondPP][rm][serif][garamondpp][default]
> \stoptypescript
>
> That part is for me a beautiful piece of ununderstanding :) First
> question: the first argument is the name we will use with the
> \usetypescript command. Right? Second question: the first argument of
> the \definetypescript is the name that will be used with the
> \setupbodyfont call. Is it right? Isn't there any conflict with the
> GaramondPP of the \starttypescript and the one of the \definetypeface?
> Or do they need to be the same? Other question: how are related the
> three following parameters (rm, serif and garamondpp)? And finally,
> what's the point of the 'default' argument?

In this last step you define your "font clan" to map \rm, \ss and \tt  
(and math) together.
Even if I provide a sample in my typescripts, I nearly always define  
a new "clan" in my environment file.

E.g.
\usetypescriptfile	[type-enc]
\usetypescriptfile	[type-klein-delitsch]
\loadmapfile	[\defaultencoding-klein-delitsch.map]

\starttypescript[fiee][liederheft]
	\usetypescript [serif] [schoolbook] [\defaultencoding]
	\usetypescript [handwriting] [delitsch] [\defaultencoding]
	\usetypescript [handwriting] [delitsch] [name]
	\definetypeface	[liederheft]	[rm]	[serif]	[schoolbook]	[default]	 
[encoding=\defaultencoding]
	\definetypeface [liederheft] [ss] [sans]  [default][default]  
[encoding=ec]
	\definetypeface [liederheft] [tt] [mono]  [default][default]  
[encoding=ec]
	\definetypeface [liederheft] [hw] [handwriting]  [delitsch][default]  
[encoding=\defaultencoding]
\stoptypescript

Perhaps not a good example, because I don't need sans, mono and math  
here. But it shows how to define the additional handwriting (hw) or  
calligraphy (cg) fonts.

The third argument of \definetypeface takes different setups, often a  
relative scaling factor to make the different fonts appear at the  
same size like here:

\definetypeface [postscript] [tt] [mono]  [courier]   [default]  
[rscale=1.1]


Greetlings from Lake Constance!
Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

[-- Attachment #2: type-apostrophe-covington.tex --]
[-- Type: application/octet-stream, Size: 9534 bytes --]

%
% Typescript for serif family apostrophe covington
% written by install-font.pl (copyleft Henning Hraban Ramm)
% adapted 2003-08-17, 2005-11-20, 2005-12-10
%
% Write in your TeX file something like:
% \usetypescriptfile	[type-apostrophe-covington]
% \usetypescript	[fiee][apostrophe-covington]
% \setupbodyfont	[apostrophe-covington, rm, 12pt]


% load mapfile
\starttypescript	[map]	[covington][\defaultencoding]
	\loadmapfile	[\defaultencoding-apostrophe-covington.map]
\stoptypescript

% serif apostrophe covington
\starttypescript	[serif]	[covington,covington-cond,covington-exp,covington-sh]	[\defaultencoding]
	\definefontsynonym	[Covington]	[\defaultencoding-coving01]	[encoding=\defaultencoding]
	\definefontsynonym	[Covington-Italic]	[\defaultencoding-coving02]	[encoding=\defaultencoding]
	\definefontsynonym	[Covington-Bold]	[\defaultencoding-coving03]	[encoding=\defaultencoding]
	\definefontsynonym	[Covington-BoldItalic]	[\defaultencoding-coving04]	[encoding=\defaultencoding]
	\definefontsynonym	[Covington-Cond]	[\defaultencoding-coving05]	[encoding=\defaultencoding]
	\definefontsynonym	[Covington-Cond-Italic]	[\defaultencoding-coving06]	[encoding=\defaultencoding]
	\definefontsynonym	[Covington-Cond-Bold]	[\defaultencoding-coving07]	[encoding=\defaultencoding]
	\definefontsynonym	[Covington-Cond-BoldItalic]	[\defaultencoding-coving08]	[encoding=\defaultencoding]
	\definefontsynonym	[Covington-Exp]	[\defaultencoding-coving09]	[encoding=\defaultencoding]
	\definefontsynonym	[Covington-Exp-Italic]	[\defaultencoding-coving10]	[encoding=\defaultencoding]
	\definefontsynonym	[Covington-Exp-Bold]	[\defaultencoding-coving11]	[encoding=\defaultencoding]
	\definefontsynonym	[Covington-Exp-BoldItalic]	[\defaultencoding-coving12]	[encoding=\defaultencoding]
	\definefontsynonym	[Covington-Shadow]	[\defaultencoding-coving13]	[encoding=\defaultencoding]
	\definefontsynonym	[Covington-Shadow-Italic]	[\defaultencoding-coving14]	[encoding=\defaultencoding]
	\definefontsynonym	[Covington-Rev-Italic]	[\defaultencoding-coving15]	[encoding=\defaultencoding]
	\definefontsynonym	[Covington-Rev-BoldItalic]	[\defaultencoding-coving16]	[encoding=\defaultencoding]
	\definefontsynonym	[CovingtonSC]	[\defaultencoding-coving17]	[encoding=\defaultencoding]
	\definefontsynonym	[CovingtonSC-Italic]	[\defaultencoding-coving18]	[encoding=\defaultencoding]
	\definefontsynonym	[CovingtonSC-Bold]	[\defaultencoding-coving19]	[encoding=\defaultencoding]
	\definefontsynonym	[CovingtonSC-BoldItalic]	[\defaultencoding-coving20]	[encoding=\defaultencoding]
	\definefontsynonym	[CovingtonSC-Cond]	[\defaultencoding-coving21]	[encoding=\defaultencoding]
	\definefontsynonym	[CovingtonSC-Cond-Italic]	[\defaultencoding-coving22]	[encoding=\defaultencoding]
	\definefontsynonym	[CovingtonSC-Cond-Bold]	[\defaultencoding-coving23]	[encoding=\defaultencoding]
	\definefontsynonym	[CovingtonSC-Cond-BoldItalic]	[\defaultencoding-coving24]	[encoding=\defaultencoding]
	\definefontsynonym	[CovingtonSC-Exp]	[\defaultencoding-coving25]	[encoding=\defaultencoding]
	\definefontsynonym	[CovingtonSC-Exp-Italic]	[\defaultencoding-coving26]	[encoding=\defaultencoding]
	\definefontsynonym	[CovingtonSC-Exp-Bold]	[\defaultencoding-coving27]	[encoding=\defaultencoding]
	\definefontsynonym	[CovingtonSC-Exp-BoldItalic]	[\defaultencoding-coving28]	[encoding=\defaultencoding]
	\definefontsynonym	[CovingtonSC-Shadow]	[\defaultencoding-coving29]	[encoding=\defaultencoding]
	\definefontsynonym	[CovingtonSC-Shadow-Italic]	[\defaultencoding-coving30]	[encoding=\defaultencoding]
	\definefontsynonym	[CovingtonSC-Rev-Italic]	[\defaultencoding-coving31]	[encoding=\defaultencoding]
	\definefontsynonym	[CovingtonSC-Rev-BoldItalic]	[\defaultencoding-coving32]	[encoding=\defaultencoding]
\stoptypescript

% serif covington
\starttypescript	[serif]	[covington]	[name]
	\setups	[font:fallback:serif]
	\definefontsynonym	[Serif]				[Covington]
	\definefontsynonym	[SerifItalic]			[Covington-Italic]
	\definefontsynonym	[SerifSlanted]		[Covington-Rev-Italic]
	\definefontsynonym	[SerifCaps]			[CovingtonSC]
	\definefontsynonym	[OldStyle]			[CovingtonSC]

	\definefontsynonym	[SerifBold]			[Covington-Bold]
	\definefontsynonym	[SerifBoldItalic]		[Covington-BoldItalic]
	\definefontsynonym	[SerifBoldSlanted]		[Covington-Rev-BoldItalic]
	\definefontsynonym	[SerifBoldCaps]		[CovingtonSC-Bold]

	\definefontsynonym	[SerifBoldItalicCaps]	[CovingtonSC-BoldItalic]
	\definefontsynonym	[SerifItalicCaps]		[CovingtonSC-Italic]
	\definefontsynonym	[SerifBoldSlantedCaps]	[CovingtonSC-Rev-BoldItalic]
	\definefontsynonym	[SerifSlantedCaps]		[CovingtonSC-Rev-Italic]
	
	\definefontvariant [Serif] [cond] [Cond] % \Var[cond]
	\definefontvariant [Serif] [exp] [Exp] % \Var[exp]
	\definefontvariant [Serif] [shadow] [Shadow] % \Var[shadow]
	\definefontvariant [Serif] [caps] [SC] % \Var[shadow]

	\definefontsynonym	[SerifRegularCond]		[Covington-Cond]
	\definefontsynonym	[SerifBoldCond]		[Covington-Cond-Bold]
	\definefontsynonym	[SerifBoldItalicCond]	[Covington-Cond-BoldItalic]
	\definefontsynonym	[SerifBoldSlantedCond]	[Covington-Cond-BoldItalic]
	\definefontsynonym	[SerifItalicCond]		[Covington-Cond-Italic]
	\definefontsynonym	[SerifSlantedCond]		[Covington-Cond-Italic]
	\definefontsynonym	[SerifCapsCond]			[CovingtonSC-Cond]
	\definefontsynonym	[SerifBoldCapsCond]		[CovingtonSC-Cond-Bold]
	\definefontsynonym	[SerifBoldItalicCapsCond]	[CovingtonSC-Cond-BoldItalic]
	\definefontsynonym	[SerifItalicCapsCond]		[CovingtonSC-Cond-Italic]

	\definefontsynonym	[SerifRegularExp]			[Covington-Exp]
	\definefontsynonym	[SerifBoldExp]		[Covington-Exp-Bold]
	\definefontsynonym	[SerifBoldItalicExp]	[Covington-Exp-BoldItalic]
	\definefontsynonym	[SerifBoldSlantedExp]	[Covington-Exp-BoldItalic]
	\definefontsynonym	[SerifItalicExp]		[Covington-Exp-Italic]
	\definefontsynonym	[SerifSlantedExp]		[Covington-Exp-Italic]
	\definefontsynonym	[SerifCapsExp]			[CovingtonSC-Exp]
	\definefontsynonym	[SerifBoldCapsExp]		[CovingtonSC-Exp-Bold]
	\definefontsynonym	[SerifBoldItalicCapsExp]	[CovingtonSC-Exp-BoldItalic]
	\definefontsynonym	[SerifItalicCapsExp]		[CovingtonSC-Exp-Italic]

	\definefontsynonym	[SerifRegularShadow]	[Covington-Shadow]
	\definefontsynonym	[SerifItalicShadow]		[Covington-Shadow-Italic]
	\definefontsynonym	[SerifSlantedShadow]		[Covington-Shadow-Italic]
	\definefontsynonym	[SerifBoldShadow]			[CovingtonSC-Shadow]
	\definefontsynonym	[SerifBoldItalicShadow]		[CovingtonSC-Shadow-Italic]
	\definefontsynonym	[SerifBoldSlantedShadow]		[CovingtonSC-Shadow-Italic]
	\definefontsynonym	[SerifCapsShadow]			[CovingtonSC-Shadow]
	\definefontsynonym	[SerifItalicCapsShadow]		[CovingtonSC-Shadow-Italic]

	\definefontsynonym	[SerifRegularSC]			[CovingtonSC]
	\definefontsynonym	[SerifBoldItalicSC]	[CovingtonSC-BoldItalic]
	\definefontsynonym	[SerifItalicSC]		[CovingtonSC-Italic]
	\definefontsynonym	[SerifBoldSlantedSC]	[CovingtonSC-Rev-BoldItalic]
	\definefontsynonym	[SerifSlantedSC]		[CovingtonSC-Rev-Italic]

\stoptypescript

% serif covington condensed
\starttypescript	[serif]	[covington-cond]	[name]
	\setups	[font:fallback:serif]
	\definefontsynonym	[SerifSlanted]		[SerifItalic]
	\definefontsynonym	[SerifBoldSlanted]	[SerifBoldItalic]

	\definefontsynonym	[Serif]			[Covington-Cond]
	\definefontsynonym	[SerifBold]		[Covington-Cond-Bold]
	\definefontsynonym	[SerifBoldItalic]	[Covington-Cond-BoldItalic]
	\definefontsynonym	[SerifItalic]		[Covington-Cond-Italic]
	\definefontsynonym	[SerifCaps]			[CovingtonSC-Cond]
	\definefontsynonym	[SerifBoldCaps]		[CovingtonSC-Cond-Bold]
	\definefontsynonym	[SerifBoldItalicCaps]	[CovingtonSC-Cond-BoldItalic]
	\definefontsynonym	[SerifItalicCaps]		[CovingtonSC-Cond-Italic]
\stoptypescript

% serif covington expanded
\starttypescript	[serif]	[covington-exp]	[name]
	\setups	[font:fallback:serif]
	\definefontsynonym	[SerifSlanted]		[SerifItalic]
	\definefontsynonym	[SerifBoldSlanted]	[SerifBoldItalic]

	\definefontsynonym	[Serif]			[Covington-Exp]
	\definefontsynonym	[SerifBold]		[Covington-Exp-Bold]
	\definefontsynonym	[SerifBoldItalic]	[Covington-Exp-BoldItalic]
	\definefontsynonym	[SerifItalic]		[Covington-Exp-Italic]
	\definefontsynonym	[SerifCaps]			[CovingtonSC-Exp]
	\definefontsynonym	[SerifBoldCaps]		[CovingtonSC-Exp-Bold]
	\definefontsynonym	[SerifBoldItalicCaps]	[CovingtonSC-Exp-BoldItalic]
	\definefontsynonym	[SerifItalicCaps]		[CovingtonSC-Exp-Italic]
\stoptypescript

% serif covington shadow
\starttypescript	[serif]	[covington-sh]	[name]
	\setups	[font:fallback:serif]
	\definefontsynonym	[SerifSlanted]		[SerifItalic]
	\definefontsynonym	[SerifBoldSlanted]	[SerifBoldItalic]

	\definefontsynonym	[Serif]			[Covington-Shadow]
	\definefontsynonym	[SerifItalic]		[Covington-Shadow-Italic]
	\definefontsynonym	[SerifBold]			[CovingtonSC-Shadow]
	\definefontsynonym	[SerifBoldItalic]		[CovingtonSC-Shadow-Italic]
	\definefontsynonym	[SerifCaps]			[CovingtonSC-Shadow]
	\definefontsynonym	[SerifItalicCaps]		[CovingtonSC-Shadow-Italic]
\stoptypescript

% sample family definition
\starttypescript	[fiee]	[apostrophe-covington]
	\definetypeface	[apostrophe-covington]	[rm]	[serif]	[covington]	[default]	[encoding=\defaultencoding]
	%\definetypeface	[apostrophe-covington-cond]	[rm]	[serif]	[covington-cond]	[default]	[encoding=\defaultencoding]
	%\definetypeface	[apostrophe-covington-exp]	[rm]	[serif]	[covington-exp]	[default]	[encoding=\defaultencoding]
	%\definetypeface	[apostrophe-covington-sh]	[rm]	[serif]	[covington-sh]	[default]	[encoding=\defaultencoding]
\stoptypescript


[-- Attachment #3: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

  parent reply	other threads:[~2008-04-19 17:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-19 11:06 typescript Antoine Junod
2008-04-19 13:13 ` typescript Hans Hagen
2008-04-19 16:39 ` typescript Aditya Mahajan
2008-04-19 17:12 ` Henning Hraban Ramm [this message]
2010-03-15 21:32 typescript Michael Saunders
2010-03-15 21:35 ` typescript Aditya Mahajan
2010-03-15 21:42 ` typescript Hans Hagen
2010-03-15 21:46 ` typescript Philipp Gesang
2010-03-15 21:55   ` typescript Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=089BDC51-A2DC-4F9E-B4CC-72791D43780D@fiee.net \
    --to=hraban@fiee.net \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).