%D \module %D [ file=type-imp-cambria, %D version=2007.07.30, %D title=\CONTEXT\ Typescript Macros, %D subtitle=Microsoft Cambria, %D author=Hans Hagen, %D date=\currentdate, %D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] %C %C This module is part of the \CONTEXT\ macro||package and is %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. %D We use Dejavu as it covers wider range of monospaced glyphs. \loadtypescriptfile[dejavu] \starttypescriptcollection[cambria] \pushglobalsetups \startsetups[cambria] \setupmathradical[\c!leftmargin=.05mq,\c!mindepth=.05mx]% \stopsetups \popglobalsetups % microsoft: cambria.ttc cambriab.ttf cambriai.ttf cambriaz.ttf % ascender : cambmath.ttf cambria.ttf cambriab.ttf cambriai.ttf cambriaz.ttf \doifunknownfontfeature {cambria-math-bold} {\definefontfeature[cambria-math-bold][boldened]} \starttypescript [\s!math] [cambria,cambria-x,cambria-y,cambria-nt,cambria-m,cambria-a] \checkedmapfontsize[\typescripttwo][\s!script] [.73] \checkedmapfontsize[\typescripttwo][\s!scriptscript][.60] \stoptypescript \starttypescript [\s!math,\s!serif] [cambria,cambria-x,cambria-y,cambria-nt] % whatever matches \definefontsynonym [CambriaMath] [\s!name:cambriamath] \definefontsynonym [CambriaSerif] [\s!name:cambria] \stoptypescript \starttypescript [\s!math,\s!serif] [cambria-m] % microsoft cabria \definefontsynonym [CambriaMath] [\s!file:cambria.ttc(Cambria Math)] \definefontsynonym [CambriaSerif] [\s!file:cambria.ttc(Cambria)] \stoptypescript \starttypescript [\s!math,\s!serif] [cambria-a] % ascender cambria \definefontsynonym [CambriaMath] [\s!file:cambmath.ttf] \definefontsynonym [CambriaSerif] [\s!file:cambria.ttf] \stoptypescript % We load a goodies file that will apply a patch to the font. As a demonstration % we apply the patch when caching and when scaling which is why we also specify % the goodies file with the name. \starttypescript [\s!math] [cambria,cambria-m,cambria-a] [\s!name] \loadfontgoodies[cambria-math] \definefontsynonym [\s!MathRoman] [CambriaMath] [\s!features={\s!math\mathsizesuffix,cambria:mathextra,mathextra},\s!goodies=cambria-math] \definefontsynonym [\s!MathRomanBold] [CambriaMath] [\s!features={\s!math\mathsizesuffix,cambria-math-bold,cambria:mathextra,mathextra},\s!goodies=cambria-math] \stoptypescript \starttypescript [\s!math] [cambria-nt] [\s!name] \loadfontgoodies[cambria-math] \definefontsynonym [\s!MathRoman] [CambriaMath] [\s!features={\s!math\mathsizesuffix,cambria:mathextra,mathextra}] \definefontsynonym [\s!MathRomanBold] [CambriaMath] [\s!features={\s!math\mathsizesuffix,cambria-math-bold,cambria:mathextra,mathextra}] \stoptypescript \starttypescript [\s!math] [cambria-x] [\s!name] \loadfontgoodies[cambria-math] \definefontsynonym [\s!MathRoman] [CambriaMath] [\s!features={\s!math,cambria:mathextra,mathextra},\s!goodies=cambria-math] \definefontsynonym [\s!MathRomanBold] [CambriaMath] [\s!features={\s!math,cambria-math-bold,cambria:mathextra,mathextra},\s!goodies=cambria-math] \stoptypescript \starttypescript [\s!math] [cambria-y] [\s!name] \loadfontgoodies[cambria-math] \definefontsynonym [\s!MathRoman] [CambriaMath] [\s!features={\s!math-nostack\mathsizesuffix,cambria:mathextra,mathextra},\s!goodies=cambria-math] \definefontsynonym [\s!MathRomanBold] [CambriaMath] [\s!features={\s!math-nostack\mathsizesuffix,cambria-math-bold,cambria:mathextra,mathextra},\s!goodies=cambria-math] \stoptypescript \starttypescript [\s!serif] [cambria,cambria-m,cambria-a,cambria-nt] [\s!name] \setups[\s!font:\s!fallback:\s!serif] \definefontsynonym [\s!Serif] [CambriaSerif] [\s!features=\s!default,\s!goodies=cambria] \definefontsynonym [\s!SerifBold] [\s!name:cambriabold] [\s!features=\s!default,\s!goodies=cambria] \definefontsynonym [\s!SerifItalic] [\s!name:cambriaitalic] [\s!features=\s!default,\s!goodies=cambria] \definefontsynonym [\s!SerifBoldItalic] [\s!name:cambriabolditalic] [\s!features=\s!default,\s!goodies=cambria] \stoptypescript \starttypescript [cambria,cambria-m,cambria-a] % any \definetypeface [cambria] [\s!rm] [\s!serif] [\typescriptone] [\s!default] \definetypeface [cambria] [\s!tt] [\s!mono] [dejavu] [\s!default] \definetypeface [cambria] [\s!mm] [\s!math] [\typescriptone] [\s!default] \stoptypescript \starttypescript [cambria-x,cambria-y,cambria-nt] % test x \definetypeface [\typescriptone] [\s!rm] [\s!serif] [cambria] [\s!default] \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default] \definetypeface [\typescriptone] [\s!mm] [\s!math] [\typescriptone] [\s!default] \stoptypescript \stoptypescriptcollection