%
% Typescript for serif family sil gentium
% written by install-font.pl (copyleft Henning Hraban Ramm)
% adapted 2004-08-23, 2005-11-20
%
% Write in your TeX file something like:
% \usetypescriptfile	[type-sil-gentium]
% \usetypescript	[fiee][sil-gentium]
% \setupbodyfont	[sil-gentium, rm, 12pt]
% \setupbodyfontenvironment	[default]	[em=italic]
% (install-font supports no slanted fonts, but they are default in ConTeXt)

% source of the font: http://scripts.sil.org/Gentium
% the alternate font seems to change only some diacritics

% load mapfile
\starttypescript	[map]	[gentium]	[\defaultencoding]
	\loadmapfile	[\defaultencoding-sil-gentium.map]
\stoptypescript

% serif sil gentium
\starttypescript	[serif]	[gentium,gentium-alt]	[\defaultencoding]
	\definefontsynonym	[GentiumAlt-Italic]	[\defaultencoding-genai101]	[encoding=\defaultencoding]
	\definefontsynonym	[GentiumAlt]	[\defaultencoding-genar101]	[encoding=\defaultencoding]
	\definefontsynonym	[Gentium-Italic]	[\defaultencoding-geni101]	[encoding=\defaultencoding]
	\definefontsynonym	[Gentium]	[\defaultencoding-genr101]	[encoding=\defaultencoding]
\stoptypescript

% serif gentium
\starttypescript	[serif]	[gentium]	[name]
	\setups             [font:fallback:serif]
	\definefontsynonym	[Serif]		[Gentium]
	\definefontsynonym	[SerifItalic]	[Gentium-Italic]
	\definefontsynonym	[SerifBoldAlt]	[SerifItalic]
	\definefontsynonym	[SerifBoldItalic]	[SerifItalic]
	\definefontsynonym	[SerifCaps]	[SerifItalic]
	\definefontsynonym	[SerifBoldCaps]	[SerifItalic]

	\definefontsynonym	[SerifAlt]		[GentiumAlt]
	\definefontsynonym	[SerifItalicAlt]	[GentiumAlt-Italic]
	\definefontsynonym	[SerifOldstyle]	[SerifAlt]
	
	% unfortunately you need to define eight synonyms to handle the fallback cases:
	\definefontsynonym [SerifRegular]	[Serif]
	\definefontsynonym [SerifRegularAlt]	[SerifAlt]
	\definefontsynonym [SerifBoldAlt]	[SerifAlt]
	\definefontsynonym [SerifCapsAlt]	[SerifAlt]
	\definefontsynonym [SerifItalicAlt]	[SerifItalicAlt]
	\definefontsynonym [SerifSlantedAlt]	[SerifItalicAlt]
	\definefontsynonym [SerifBoldItalicAlt]	[SerifItalicAlt]
	\definefontsynonym [SerifBoldSlantedAlt]	[SerifItalicAlt]
	% markup of \Var[alt] results in a (subtle) font switch:
	\definefontvariant [Serif] [alt] [Alt]
\stoptypescript

% serif gentium
\starttypescript	[serif]	[gentium-alt]	[name]
	\setups             [font:fallback:serif]
	\usetypescript		[serif]	[gentium]	[\defaultencoding]
	\definefontsynonym	[Serif]	[GentiumAlt]
	\definefontsynonym	[SerifItalic]	[GentiumAlt-Italic]
\stoptypescript

% sample family definition
\starttypescript	[fiee]	[sil-gentium]
	\definetypeface	[sil-gentium]	[rm]	[serif]	[gentium]	[default]	[encoding=\defaultencoding]
	\definetypeface	[sil-gentium]	[ss]	[sans]	[default]	[default]	[encoding=\defaultencoding]
	\definetypeface	[sil-gentium]	[tt]	[mono]	[default]	[default]	[encoding=\defaultencoding]
	\definetypeface	[sil-gentium]	[mm]	[math]	[default]	[default]	[encoding=\defaultencoding]
\stoptypescript

