summaryrefslogtreecommitdiff
path: root/tex/context/fonts/mkiv/type-imp-cambria.mkiv
blob: 0ccb4409e3adb5fa21eba005f251c1563c04faad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
%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]

    % 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,\s!serif] [cambria,cambria-x,cambria-y]
        % 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,mathextra},\s!goodies=cambria-math]
        \definefontsynonym [\s!MathRomanBold] [CambriaMath] [\s!features={\s!math\mathsizesuffix,cambria-math-bold,mathextra},\s!goodies=cambria-math]
    \stoptypescript
    \starttypescript [\s!math] [cambria-x] [\s!name]
        \loadfontgoodies[cambria-math]
        \definefontsynonym [\s!MathRoman]     [CambriaMath] [\s!features={\s!math,mathextra},\s!goodies=cambria-math]
        \definefontsynonym [\s!MathRomanBold] [CambriaMath] [\s!features={\s!math,cambria-math-bold,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,mathextra},\s!goodies=cambria-math]
        \definefontsynonym [\s!MathRomanBold] [CambriaMath] [\s!features={\s!math-nostack\mathsizesuffix,cambria-math-bold,mathextra},\s!goodies=cambria-math]
    \stoptypescript

    \starttypescript [\s!serif] [cambria,cambria-m,cambria-a] [\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]
        % 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