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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
|
%% missaali.tex
%% Copyright 2016 Tommi Syrjönen
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is Tommi Syrjänen
%
% See file MANIFEST-Missaali.txt to a list of files that make up this
% work.
\ProvidesPackage{missaali}[2016/12/25 v1.004 XeLaTeX Package (Use Missaali Open Type Font)]
%% Author: Tommi Syrjänen (tssyrjan@iki.fi)
%%
%% This is a package for using the Missaali OpenType textura font
%% with xelatex. Documentation is in the file 'missaali.pdf'.
%% First require some necessary packages
\RequirePackage{fontspec}
\RequirePackage{ifthen}
\RequirePackage{accsupp}
\RequirePackage{calc}
\RequirePackage{multicol}
\RequirePackage{geometry}
%% Boolean flags for selecting font features
\newif\ifOldFinnish
\newif\ifContextualAlternates
\newif\ifLigatures
\newif\ifMissaleAbbrStyle
\newif\ifAbbreviate
\newif\ifHistForms
\newif\ifPoFusion
\newif\ifAlternateG
\newif\ifAlternateZ
\newif\ifAltPunctuation
\newif\ifAdditionalAbbrs
\makeatletter
% By default: abbreviation style Missale, ligatures and contextual alternates true
\ContextualAlternatestrue
\Ligaturestrue
\MissaleAbbrStyletrue
%% Package option: old punctuation
\DeclareOption{OldPunctuation}{\AltPunctuationtrue}
%% Package option: old Finnish ortogrphy
\DeclareOption{OldFinnish}{\OldFinnishtrue}
%% Package option: old style adieresis and ae-ligature
\DeclareOption{OldAE}{\HistFormstrue}
%% Package option: alternate G
\DeclareOption{AltG}{\AlternateGtrue}
%% Package option: alternate Z
\DeclareOption{AltZ}{\AlternateZtrue}
%% Package option: fuse po
\DeclareOption{FusePo}{\PoFusiontrue}
\ProcessOptions*{}
% Possibly global font features:
% calt - long s and rotunda r
% liga - standard ligatures
% hist - old ae and oe
% ss16 - old Finnish ortography
% ss17 - alternate punctuation
% ss18 - use po-ligature
% ss19 - alternate z
% ss20 - alternage G
\newcommand{\@caltoptions}{\ifContextualAlternates +calt;\else -calt;\fi}
\newcommand{\@ligaoptions}{\ifLigatures +liga;\else -liga;\fi}
\newcommand{\@histoptions}{\ifHistForms +hist; \fi}
\newcommand{\@finnoptions}{\ifOldFinnish +ss16; \fi}
\newcommand{\@punctoptions}{\ifAltPunctuation +ss17; \fi}
\newcommand{\@pofusionoptions}{\ifPoFusion +ss18;\fi}
\newcommand{\@zoptions}{\ifAlternateZ +ss19; \fi}
\newcommand{\@goptions}{\ifAlternateG +ss22; \fi}
\newcommand{\msmanualspacing}{\@enableobeylines\@enableactivechars}
\newcommand{\msaltpunctuation}{\addfontfeature{RawFeature=+ss17:}}
\newcommand{\@abbroptions}{%
\ifAbbreviate%
\ifAdditionalAbbrs%
+ss02;%
\else%
\ifMissaleAbbrStyle%
+dlig;%
\else%
+ss03;%
\fi%
\fi%
\fi%
}
\begingroup
\catcode`,=\active
\catcode`.=\active
\catcode`!=\active
\catcode`:=\active
% \@enableactivechars adds some extra space on both sides of
% punctuation symbols. The following commands are created with voodoo
% programming and some experimentation and there probably is some more
% reasonable way to do it. The important points are:
%
% 1. A punctuation mark should have some stretch added to its both
% sides if there is justification going on.
%
% 2. If there is just the the skip on both sides, then the active
% character will eat any letter 'l' immediately after it. (Probably
% because it then adds the 'l' to the fill turning it to filll.)
%
% 3. If an empty group is added after the skip (or it is enclosed
% inside extra pair of braces), then it doesn't eat 'l' but it will
% add extra space after the symbol and that is not desirable. There's
% probably a some reason for this but I wasn't in the mood to find the
% root cause.
%
% 4. The negative kern at the end removes some of the extra space.
%
% 5. The kerning dimension is defined using the extra skip and dimexpr
% because when we are expanding the macro, the dot is an active
% character so it's not possible to use it for the decimal separator.
\gdef\@enableactivechars{%
\newskip\@activeskip%
\@activeskip\dimexpr 2em/10
\catcode`,=\active\def,{\hskip0pt plus 2fill\char`,\hskip0pt plus 1fill{}%
\kern-\@activeskip\hbox{}}%
\catcode`.=\active\def.{\hskip0pt plus 2fill\char`.\hskip0pt plus 1fill{}%
\kern-\@activeskip\hbox{}}%
\catcode`!=\active\def!{\hskip0pt plus 2fill\char`!\hskip0pt plus 1fill{}%
\kern-\@activeskip\hbox{}}%
\catcode`:=\active\def:{\hskip0pt plus 2fill\char`:\hskip0pt plus 1fill{}%
\kern-\@activeskip\hbox{}}%
}
\endgroup
\newcommand{\@enableobeylines}{
\obeylines\spaceskip 0.2em plus 3fill%
}
\newcommand{\@createoptions}{
RawFeature=\@abbroptions\@zoptions\@goptions\@pofusionoptions\@punctoptions\@finnoptions\@histoptions\@ligaoptions\@caltoptions+dmmy;
}
\newcommand{\MsNormalStyle}{\OldFinnishfalse\HistFormsfalse\ContextualAlternatestrue\Ligaturestrue\MissaleAbbrStyletrue\PoFusionfalse\AlternateGfalse\AlternateZfalse\AdditionalAbbrsfalse\AltPunctuationfalse}
\newcommand{\MsAltAEStyle}{\HistFormstrue}
\newcommand{\MsAltZStyle}{\AlternateZtrue}
\newcommand{\MsAltGStyle}{\AlternateGtrue}
\newcommand{\MsOldFinnishStyle}{\OldFinnishtrue}
\newcommand{\MsPoFusionStyle}{\PoFusiontrue}
\newcommand{\MsAltAbbrStyle}{\AdditionalAbbrsfalse\MissaleAbbrStylefalse}
\newcommand{\MsNormalAbbrStyle}{\AdditionalAbbrsfalse\MissaleAbbrStyletrue}
\newcommand{\MsAdditionalAbbrStyle}{\AdditionalAbbrstrue}
\newcommand{\MsAltPunctiationStyle}{\AltPunctuationtrue}
% These colors correspond to the red and blue inks used in the
% facsimile reprint of Missale Aboense in the SRGB color space (as
% interpreted by my scanner)
\newcommand{\@blue}{455f9b}
\newcommand{\@red}{c55e47}
% Emphasize by adding red color
\newcommand{\texturaemph}[1]{{\addfontfeature{Color=\@red}#1}}
% Change font family to textura
\newcommand{\mstexturafamily}{\parindent0pt%
\let\emph\texturaemph%
\fontspec[\@createoptions]{Missaali}}
% Set an isolated text fragment in Missaali
\newcommand{\missaali}[1]{{\mstexturafamily #1}}
\newcommand{\mssetsizes}[3]{%
\setcounter{@texturafontsize}{#1}%
\setlength{\@texturablockwidth}{#2}%
\setcounter{@texturablocklines}{#3}}
% The width of a single column of text
\newlength{\@texturablockwidth}
\setlength{\@texturablockwidth}{6.40cm}
\newcommand{\mssetblockwidth}[1]{%
\setlength{\@texturablockwidth}{#1}}
% The height of the text block in lines
\newcounter{@texturablocklines}
\setcounter{@texturablocklines}{34}
\newcommand{\mssetblocklines}[1]{%
\setcounter{@texturablocklines}{#1}}
% The width of the gutter
\newlength{\@texturagutterwidth}
\setlength{\@texturagutterwidth}{1cm}
\newcommand{\mssetgutterwidth}[1]{%
\setcounter{\@texturagutterwidth}{#1}}
% Textura font size
\newcounter{@texturafontsize}
\setcounter{@texturafontsize}{18}
\newcommand{\mssetfontsize}[1]{%
\setcounter{@texturafontsize}{#1}}
\newlength{\@textwidth}
\newlength{\@textheight}
% An environment for setting textura full page at a time
\newenvironment{mstextura}{%
\begingroup%
\setlength{\@textwidth}{\dimexpr\@texturablockwidth*2+\@texturagutterwidth}%
\setlength{\@textheight}{\dimexpr \value{@texturafontsize}pt*\value{@texturablocklines}}%
\newgeometry{textwidth=\@textwidth,textheight=\@textheight,columnsep=\@texturagutterwidth}%
\parindent0pt%
\begin{multicols}{2}\raggedcolumns%
\fontsize{\value{@texturafontsize}}{\value{@texturafontsize}}%
\msmanualspacing%
\mstexturafamily}{%
\end{multicols}%
\restoregeometry\endgroup}
% Setting textura in two columns without setting the length of the
% blocks
\newlength{\@savedcolumnsep}
\newenvironment{mstexturablocks}{%
\begingroup%
\setlength{\@textwidth}{\dimexpr\@texturablockwidth*2+\@texturagutterwidth}%
\setlength{\@savedcolumnsep}{\columnsep}
\columnsep\@texturagutterwidth%
\begin{minipage}{\@textwidth}%
\parindent0pt%
\begin{multicols}{2}\raggedcolumns%
\fontsize{\value{@texturafontsize}}{\value{@texturafontsize}}%
\msmanualspacing%
\mstexturafamily}{%
\end{multicols}%
\end{minipage}%&
\columnsep\@savedcolumnsep
\endgroup}
% A single column block of textura
\newenvironment{mstexturablock}{%
\begingroup%
\setlength{\@textwidth}{\@texturablockwidth}%
\begin{minipage}{\@textwidth}%
\parindent0pt%
\fontsize{\value{@texturafontsize}}{\value{@texturafontsize}}%
\msmanualspacing%
\mstexturafamily}{%
\end{minipage}\endgroup}
% Chapterinitial doesn't use lettrine because I'm having troubles of
% finding a correct scaling for the initial letter so that the result
% will be of the right height. This has the unfortunate problem that
% the user has to handle the indentation of the second line of the
% initial by hand. However, as lettrine didn't work nicely together
% with the \msmanualspacing option in any case, this would have happened
% often anyway. The value 1.3 for lower is a magic number that seems
% to give a nicish result in most cases.
\newbox\@ibox
\newlength\@initwidth
\newcommand{\mschapterinitial}[1]{%
\setbox\@ibox\hbox{\msrubric{\addfontfeature{Scale=2}\addfontfeature{RawFeature=+ss20;}#1}}%
\@initwidth=\wd\@ibox%
\mbox{\smash{\lower1.3\baselineskip\hbox to \wd\@ibox{\vbox to 2\baselineskip{\hbox to \wd\@ibox{\box\@ibox}}}}}}
\newcommand{\mschapterinitialblue}[1]{%
\setbox\@ibox\hbox{\msrubricblue{\addfontfeature{Scale=2}\addfontfeature{RawFeature=+ss20;}#1}}%
\@initwidth=\wd\@ibox%
\mbox{\smash{\lower1.3\baselineskip\hbox to \wd\@ibox{\vbox to 2\baselineskip{\hbox to \wd\@ibox{\box\@ibox}}}}}}
% \mschapterindent adds as much horizontal space as the latest seen
% chapter initial is wide
\newcommand{\mschapterindent}{\mbox{}\hskip\@initwidth}
% \startchapter takes three arguments. The first is the initial letter,
% the second is the text of the first line, and the third is the text
% of the second line.
\newcommand{\msstartchapter}[3]{%
\par\mschapterinitial{#1}#2\\%
\mschapterindent{}#3}
% \startchapterblue takes three arguments. The first is the initial letter,
% the second is the text of the first line, and the third is the text
% of the second line.
\newcommand{\msstartchapterblue}[3]{%
\par\mschapterinitialblue{#1}#2\\%
\mschapterindent{}#3}
% \startchapterwithrubric takes four arguments. The first argument is
% a rubric that is set at the right edge of the column, the second is
% the initial letter, the third is the contents of the first line and
% the last is the contents of the second line.
\newcommand{\msstartchapterwithrubric}[4]{%
\par\mspartialrubric{#1}%
\mspartialline{\mschapterinitial{#2}#3}\\%
\mschapterindent{}#4}
% \startchapterwithrubricblue takes four arguments. The first argument
% is a rubric that is set at the right edge of the column in red, the
% second is the initial letter that will be set in blue, the third is
% the contents of the first line and the last is the contents of the
% second line.
\newcommand{\msstartchapterwithrubricblue}[4]{%
\par\mspartialrubric{#1}%
\mspartialline{\mschapterinitialblue{#2}#3}\\%
\mschapterindent{}#4}
% Add a one-line high red lombardic initial
\newcommand{\msparinitial}[1]{{%
\addfontfeature{Color=\@red}%
\addfontfeature{RawFeature=+titl;}#1}}
% Add a one-line high blue lombardic initial
\newcommand{\msparinitialblue}[1]{{%
\addfontfeature{Color=\@blue}%
\addfontfeature{RawFeature=+titl;}#1}}
% Turns off the standard ligature substitutions for its argument.
\newcommand{\msnoliga}[1]{{\addfontfeature{RawFeature=-liga;}#1}}
% Use the abbreviation ligatures that are used in main text of Missale
% Aboense
\newcommand{\msabbr}[1]{{%
\Abbreviatetrue\MsNormalAbbrStyle\mstexturafamily #1}}
% Use additional abbreviation symbols
\newcommand{\msabbra}[1]{{%
\Abbreviatetrue\MsAdditionalAbbrStyle%
\mstexturafamily #1}}
% Use the alternate set of abbreviation symbols
\newcommand{\msabbralt}[1]{{%
\Abbreviatetrue\MsAltAbbrStyle\mstexturafamily #1}}
% The commands that add abbreviation marks all have four forms that
% are based on two binary selections: whether the mark is on only r or
% over all other letters, and whether there is an additional
% unabbreviated actual text that is added to the pdf or not.
%
% If the basic command is FOO, the four forms are:
% \mstFOO: letters other than r, no actual text
% \mstFOOacc: letters other than r, has actual text
% \rmstFOO: r only, no actual text
% \rmstFOOacc: r only, has actual text
% Add a generic abbreviation symbol, r not abbreviated
\newcommand{\mstd}[1]{{\addfontfeature{RawFeature=+lt04;}#1}}
\newcommand{\mstdacc}[2]{%
\BeginAccSupp{method=plain,ActualText=#2}%
\mstd{#1}\EndAccSupp{}}
% add a generic abbreviation symbol, r abbreviated
\newcommand{\rmstd}[1]{{\addfontfeature{RawFeature=+lr04;}#1}}
\newcommand{\rmstdacc}[2]{%
\BeginAccSupp{method=plain,ActualText=#2}%
\rmstd{#1}\EndAccSupp{}}
% Add specifically tilde, r not abbreviated
\newcommand{\mstdt}[1]{{\addfontfeature{RawFeature=+lt05}#1}}
\newcommand{\mstdtacc}[2]{%
\BeginAccSupp{method=plain,ActualText=#2}%
\mstdt{#1}\EndAccSupp{}}
% Add specifically tilde, r abbreviated
\newcommand{\rmstdt}[1]{{\addfontfeature{RawFeature=+lr05}#1}}
\newcommand{\rmstdtacc}[2]{%
\BeginAccSupp{method=plain,ActualText=#2}%
\rmstdt{#1}\EndAccSupp{}}
% Add wide tilde for a-abbreviation, r not abbreviated
\newcommand{\mstda}[1]{{\addfontfeature{RawFeature=+lt09}#1}}
\newcommand{\mstdaacc}[2]{%
\BeginAccSupp{method=plain,ActualText=#2}%
\mstda{#1}\EndAccSupp{}}
% Add wide tilde for a-abbreviation, r abbreviated
\newcommand{\rmstda}[1]{{\addfontfeature{RawFeature=+lr09}#1}}
\newcommand{\rmstdaacc}[2]{%
\BeginAccSupp{method=plain,ActualText=#2}%
\rmstda{#1}\EndAccSupp{}}
% Add acute for r-abbreviation, r not abbreviated
\newcommand{\mstdr}[1]{{\addfontfeature{RawFeature=+lt07}#1}}
\newcommand{\mstdracc}[2]{%
\BeginAccSupp{method=plain,ActualText=#2}%
\mstdr{#1}\EndAccSupp{}}
% Add acute for r-abbreviation, r abbreviated
\newcommand{\rmstdr}[1]{{\addfontfeature{RawFeature=+lr07}#1}}
\newcommand{\rmstdracc}[2]{%
\BeginAccSupp{method=plain,ActualText=#2}%
\rmstdr{#1}\EndAccSupp{}}
% Add grave for short tilde, r not abbreviated
\newcommand{\mstdst}[1]{{\addfontfeature{RawFeature=+lt08}#1}}
\newcommand{\mstdstacc}[2]{%
\BeginAccSupp{method=plain,ActualText=#2}%
\mstdst{#1}\EndAccSupp{}}
% Add grave for short tilde, r abbreviated
\newcommand{\rmstdst}[1]{{\addfontfeature{RawFeature=+lr08}#1}}
\newcommand{\rmstdstacc}[2]{%
\BeginAccSupp{method=plain,ActualText=#2}%
\rmstdst{#1}\EndAccSupp{}}
% Add ring for o-abbreviation, r not abbreviated
\newcommand{\mstdo}[1]{{\addfontfeature{RawFeature=+lt10}#1}}
\newcommand{\mstdoacc}[2]{%
\BeginAccSupp{method=plain,ActualText=#2}%
\mstdo{#1}\EndAccSupp{}}
% Add ring for o-abbreviation, r abbreviated
\newcommand{\rmstdo}[1]{{\addfontfeature{RawFeature=+lr10}#1}}
\newcommand{\rmstdoacc}[2]{%
\BeginAccSupp{method=plain,ActualText=#2}%
\rmstdo{#1}\EndAccSupp{}}
% Add dieresis, r not abbreviatd
\newcommand{\mstdd}[1]{{\addfontfeature{RawFeature=+lt06}#1}}
\newcommand{\mstddacc}[2]{%
\BeginAccSupp{method=plain,ActualText=#2}%
\mstdd{#1}\EndAccSupp{}}
% Add dieresis, r xabbreviatd
\newcommand{\rmstdd}[1]{{\addfontfeature{RawFeature=+lr06}#1}}
\newcommand{\rmstddacc}[2]{%
\BeginAccSupp{method=plain,ActualText=#2}%
\rmstdd{#1}\EndAccSupp{}}
% Add diagonal slash, r not abbreviated
\newcommand{\mstddg}[1]{{\addfontfeature{RawFeature=+lt11;}#1}}
\newcommand{\mstddgacc}[2]{%
\BeginAccSupp{method=plain,ActualText=#2}%
\mstddg{#1}\EndAccSupp{}}
% Add diagonal slash, r abbreviated
\newcommand{\rmstddg}[1]{{\addfontfeature{RawFeature=+lr11}#1}}
\newcommand{\rmstddgacc}[2]{%
\BeginAccSupp{method=plain,ActualText=#2}%
\rmstddg{#1}\EndAccSupp{}}
% Enable liturgical symbols
\newcommand{\mstdl}[1]{{\addfontfeature{RawFeature=+ss15}#1}}
% Macros for entering different forms of 'r' and 's' directly to the
% code.
\newcommand{\rotundar}{\char`\^^^^a75b}
\newcommand{\straightr}{\char`\^^^^ef3f}
\newcommand{\shorts}{\char`\^^^^ef3c}
\newcommand{\longs}{\char'\^^^^017f}
% Enters a lombardic initial in the current size and color:
\newcommand{\msinit}[1]{{\addfontfeature{RawFeature=+titl;}#1}}
% Enters an alternative form of initial in the current size and color:
\newcommand{\msinita}[1]{{\addfontfeature{RawFeature=+titl;+ss23;}#1}}
% Adds the alternative form of initial I in very large size in the
% gutter.
\newbox\initialibox
\newcommand{\initialI}{%
\setbox\initialibox\hbox{\smash{%
\mstexturafamily%
\addfontfeature{Scale=10}%
\addfontfeature{Color=\@blue}%
\addfontfeature{RawFeature=+titl;+ss23;}I}}%
\mbox{}\kern-\wd\initialibox%
\smash{\lower9ex\box\initialibox{}}}
% Add a red paragraph symbol
\newcommand{\mspara}{{\msrubric{¶}}}
% Change font color to red
\newcommand{\msrubric}[1]{{\addfontfeature{Color=\@red}#1}}
% Change font color to blue
\newcommand{\msrubricblue}[1]{{\addfontfeature{Color=\@blue}#1}}
% The commands \mspartialrubric and \mspartialline are used together
% to set a short title on the right end of the line and normal text to
% left. These commands should be used as a pair, with \mspartialrubric
% first.
\newbox\rubricbox
\setbox\rubricbox\hbox{}
\newcommand{\mspartialrubric}[1]{%
\setbox\rubricbox\hbox{\msrubric{#1}}%
\hfill{}\msrubric{#1}}
\newcommand{\mspartialline}[1]{\vskip-\baselineskip{}#1\phantom{\box\rubricbox}}
%% Typeset the name of the font
\newcommand{\Missaali}{{\Ligaturestrue\mstexturafamily{}Missaali}}
\makeatother
|