summaryrefslogtreecommitdiff
path: root/doc/context/sources/general/manuals/languages/languages-cover.tex
blob: 75a033b5fa9ee3bb0baaec740c6ea1b99c14f779 (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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
% language=uk

\startcomponent languages-cover

\environment languages-environment

\startbuffer[abstract]

This book explains how we support languages (and
scripts) in \CONTEXT\ \MKIV\ and \LUATEX. Some of
the mechanisms discussed are generic and not
\CONTEXT\ specific. We discuss the way languages are
dealt with in the engine, hyphenation, standard
features and additional goodies. Tracing and the
extensibility of code are also discussed.

\stopbuffer

\startsetups document:abstract
    \framed [
        foregroundstyle=bold,
        foregroundcolor=white,
        width=7.5cm,
        align={normal,tolerant},
        frame=off,
        strut=no,
    ] {
        \getbuffer[abstract]
    }
\stopsetups

\startMPextensions

    def DrawCoverPage (expr what) =

        begingroup ;

        save SpineWidth ; numeric SpineWidth ; SpineWidth := 8mm ;
        save PaperBleed ; numeric PaperBleed ; PaperBleed := 2mm ; % todo

        StartCover ;

            save width, size, anchor ;

            numeric width, size ; pair anchor, offset ;

            color ColorVariant[] ;

          % ColorVariant[1] := \MPcolor{darkred} ;
          % ColorVariant[2] := \MPcolor{darkgreen} ;
          % ColorVariant[3] := \MPcolor{darkblue} ;
          % ColorVariant[4] := \MPcolor{darkyellow} ;

            ColorVariant[1] := \MPcolor{darkmagenta} ;
            ColorVariant[2] := \MPcolor{darkorange} ;
            ColorVariant[3] := \MPcolor{darkyellow} ;
            ColorVariant[4] := \MPcolor{darkcyan} ;

            fill CoverPage enlarged PaperBleed withcolor \MPcolor{darkgray} ;

            fill Spine bottomenlarged  -.5CoverHeight withcolor ColorVariant[3] ;
            fill Spine topenlarged     -.5CoverHeight withcolor ColorVariant[2] ;

            width  := FrontPageWidth ;
            height := FrontPageHeight ;
            size   := 4 * width / 3 ;
            offset := (-1cm,1cm) ;
            anchor := .5[lrcorner CoverPage,urcorner CoverPage] ;

            fill anchored.llft(lltriangle scaled size, urcorner FrontPage) withcolor ColorVariant[1] ;
            fill anchored.urt (urtriangle scaled size, llcorner FrontPage) withcolor ColorVariant[2] ;
            fill anchored.lrt (lrtriangle scaled size, ulcorner FrontPage) withcolor ColorVariant[3] ;
            fill anchored.ulft(ultriangle scaled size, lrcorner FrontPage) withcolor ColorVariant[4] ;

            fill anchored.lrt (lrtriangle scaled size, ulcorner BackPage) withcolor ColorVariant[1] ;
            fill anchored.llft(lltriangle scaled size, urcorner BackPage) withcolor ColorVariant[3] ;
            fill anchored.ulft(ultriangle scaled size, lrcorner BackPage) withcolor ColorVariant[2] ;
            fill anchored.urt (urtriangle scaled size, llcorner BackPage) withcolor ColorVariant[4] ;

            draw thetextext.llft(textext("\bf Languages in \ConTeXt\hskip-.1em") rotated 45 ysized .350height, anchor shifted (6*offset+offset)) withcolor white ;
            draw thetextext.llft(textext("\bf explaining luatex and mkiv")       rotated 45 ysized .275height, anchor shifted (5*offset+offset)) withcolor white ;
            draw thetextext.llft(textext("\bf Hans Hagen")                       rotated 45 ysized .200height, anchor shifted (2*offset+offset)) withcolor white ;
            draw thetextext.llft(textext("\bf PRAGMA ADE")                       rotated 45 ysized .200height, anchor shifted (1*offset+offset)) withcolor white ;

            % for the moment

            draw thetextext.top(textext("\bf work in progress") xsized 4cm, lrcorner Page shifted (-3cm,1cm)) withcolor white ;

            % till here

            width := BackPageWidth ;

            draw thetextext(textext("\bf\setups[document:abstract]") xsized .65width rotated 45 , center BackPage) withcolor white ;

            anchor := .5[ulcorner Spine,urcorner Spine] shifted (0,-1cm);

            draw thetextext.bot(textext("\bf Languages in \ConTeXt\hskip-.1em") rotated 90 xsized .8SpineWidth, anchor) withcolor white ;

            anchor := .5[llcorner Spine,lrcorner Spine] shifted (0,1cm);

            draw thetextext.top(textext("\bf Hans Hagen")                       rotated 90 xsized .8SpineWidth, anchor) withcolor white ;

        StopCover ;

        if what = "front" :
            clip currentpicture to FrontPage ;
        elseif what = "back" :
            clip currentpicture to BackPage ;
        else :
            drawboundary CoverPage ;
        fi ;

        endgroup ;

    enddef ;

\stopMPextensions

\doifmodeelse {simple} {

    \startMPpage
        DrawCoverPage("front") ;
    \stopMPpage

} {

    \startMPpage
        DrawCoverPage("cover") ;
    \stopMPpage

}

\stopcomponent