summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/gregoriotex/gregoriotex-nabc.tex
blob: 25ebe0b847ca5887524f36453023ee9b88d50788 (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
%GregorioTeX file.
%
% Copyright (C) 2014-2015 The Gregorio Project (see CONTRIBUTORS.md)
%
% This file is part of Gregorio.
%
% Gregorio is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Gregorio is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Gregorio.  If not, see <http://www.gnu.org/licenses/>.

% this file contains macros for St. Gall ancient neume support

\gre@debugmsg{general}{Loading gregoriotex-nabc.tex}%
\gre@declarefileversion{gregoriotex-nabc.tex}{4.1.1}% GREGORIO_VERSION


\xdef\gre@nabcfontname{gregall}
\xdef\gre@nabcfontsize{8}

\def\gresetnabcfont#1#2{%
  \xdef\gre@nabcfontname{#1}%
  \xdef\gre@nabcfontsize{#2}%
  \global\font\gre@font@nabc={name:#1} at #2 pt\relax %
  {%
    \gre@font@nabc %
    \directlua{gregoriotex.init_nabc_font("\luatexluaescapestring{#1}")}%
  }%
  \gre@nabcfontloadedtrue%
}

\def\grenabccharno#1#2#3{{\directlua{
  gregoriotex.print_nabc(gregoriotex.parse_nabc("#1", "\luatexluaescapestring{#2}", #3))
}}}

\def\GreNABCChar#1{{%
  %\catcode`\~=12{}%
  %\catcode`\@=11{}%
  \gre@font@nabc %
  \gre@style@nabc %
  \grenabccharno{#1}{\gre@nabcfontname}{1}%
  \endgre@style@nabc%
}}

\def\GreNABCNeumes#1#2{%
  \GreSetTextAboveLines{\GreNABCChar{#2}}%
}

\newif\ifgre@nabcfontloaded%
\gre@nabcfontloadedfalse%

\def\GreScoreNABCLines#1{%
  \ifgre@nabcfontloaded\else%
    \gresetnabcfont{\gre@nabcfontname}{\gre@nabcfontsize}%
  \fi %
}