From 68b85a1733357e9b2c973020f7967433eabcbe33 Mon Sep 17 00:00:00 2001
From: Janek Warchol <lemniskata.bernoullego@gmail.com>
Date: Fri, 19 Aug 2011 17:17:43 +0200
Subject: [PATCH] add basic infrastructure for kievan font

First step in supporting kievan square notation.
Add generic metafont file, driver files and
file containing code (one glyph currently).
Modified scripts used in font generation
to include kievan glyphs.
---
 mf/GNUmakefile                          |   11 ++++++
 mf/feta-kievan-generic.mf               |   47 +++++++++++++++++++++++++++
 mf/feta-kievan.mf                       |   54 +++++++++++++++++++++++++++++++
 mf/feta-kievan11.mf                     |   13 +++++++
 mf/feta-kievan13.mf                     |   13 +++++++
 mf/feta-kievan14.mf                     |   13 +++++++
 mf/feta-kievan16.mf                     |   13 +++++++
 mf/feta-kievan18.mf                     |   13 +++++++
 mf/feta-kievan20.mf                     |   13 +++++++
 mf/feta-kievan23.mf                     |   13 +++++++
 mf/feta-kievan26.mf                     |   13 +++++++
 scripts/build/gen-emmentaler-scripts.py |    1 +
 scripts/build/mf-to-table.py            |    2 +
 13 files changed, 219 insertions(+), 0 deletions(-)
 create mode 100644 mf/feta-kievan-generic.mf
 create mode 100644 mf/feta-kievan.mf
 create mode 100644 mf/feta-kievan11.mf
 create mode 100644 mf/feta-kievan13.mf
 create mode 100644 mf/feta-kievan14.mf
 create mode 100644 mf/feta-kievan16.mf
 create mode 100644 mf/feta-kievan18.mf
 create mode 100644 mf/feta-kievan20.mf
 create mode 100644 mf/feta-kievan23.mf
 create mode 100644 mf/feta-kievan26.mf

diff --git a/mf/GNUmakefile b/mf/GNUmakefile
index 1fa0a73..ef1405c 100644
--- a/mf/GNUmakefile
+++ b/mf/GNUmakefile
@@ -18,6 +18,7 @@ FETA_MF_FILES = $(call src-wildcard,feta[0-9]*.mf) \
 		$(call src-wildcard,feta-alphabet*[0-9].mf) \
 		$(call src-wildcard,feta-notehead*[0-9].mf) \
 		$(call src-wildcard,feta-flags*[0-9].mf) \
+		$(call src-wildcard,feta-kievan*[0-9].mf) \
 		$(call src-wildcard,parmesan[0-9]*.mf)
 
 STAFF_SIZES = 11 13 14 16 18 20 23 26
@@ -67,6 +68,7 @@ $(outdir)/emmentaler-%.otf\
 			    $(outdir)/feta%.pfb \
 			    $(outdir)/feta-noteheads%.pfb \
 			    $(outdir)/feta-flags%.pfb \
+			    $(outdir)/feta-kievan%.pfb \
 			    $(outdir)/feta-alphabet%.pfb \
 			    $(outdir)/parmesan%.pfb \
 			    $(outdir)/feta%.otf-table \
@@ -86,6 +88,7 @@ $(outdir)/%.otf-table: $(outdir)/%.lisp
 	cat $< $(if $(findstring brace,$<),,$(subst feta,parmesan,$<)) \
 	       $(if $(findstring brace,$<),,$(subst feta,feta-noteheads,$<)) \
 	       $(if $(findstring brace,$<),,$(subst feta,feta-flags,$<)) \
+	       $(if $(findstring brace,$<),,$(subst feta,feta-kievan,$<)) \
 	       $(if $(findstring brace,$<),,$(subst feta,feta-alphabet,$<)) > $@
 
 
@@ -93,41 +96,49 @@ $(outdir)/%.otf-table: $(outdir)/%.lisp
 $(outdir)/feta26.otf-table: $(outdir)/feta26.lisp \
 			    $(outdir)/feta-noteheads26.lisp \
 			    $(outdir)/feta-flags26.lisp \
+			    $(outdir)/feta-kievan26.lisp \
 			    $(outdir)/parmesan26.lisp \
 			    $(outdir)/feta-alphabet26.lisp
 $(outdir)/feta23.otf-table: $(outdir)/feta23.lisp \
 			    $(outdir)/feta-noteheads23.lisp \
 			    $(outdir)/feta-flags23.lisp \
+			    $(outdir)/feta-kievan23.lisp \
 			    $(outdir)/parmesan23.lisp \
 			    $(outdir)/feta-alphabet23.lisp
 $(outdir)/feta20.otf-table: $(outdir)/feta20.lisp \
 			    $(outdir)/feta-noteheads20.lisp \
 			    $(outdir)/feta-flags20.lisp \
+			    $(outdir)/feta-kievan20.lisp \
 			    $(outdir)/parmesan20.lisp \
 			    $(outdir)/feta-alphabet20.lisp
 $(outdir)/feta18.otf-table: $(outdir)/feta18.lisp \
 			    $(outdir)/feta-noteheads18.lisp \
 			    $(outdir)/feta-flags18.lisp \
+			    $(outdir)/feta-kievan18.lisp \
 			    $(outdir)/parmesan18.lisp \
 			    $(outdir)/feta-alphabet18.lisp
 $(outdir)/feta16.otf-table: $(outdir)/feta16.lisp \
 			    $(outdir)/feta-noteheads16.lisp \
 			    $(outdir)/feta-flags16.lisp \
+			    $(outdir)/feta-kievan16.lisp \
 			    $(outdir)/parmesan16.lisp \
 			    $(outdir)/feta-alphabet16.lisp
 $(outdir)/feta14.otf-table: $(outdir)/feta14.lisp \
 			    $(outdir)/feta-noteheads14.lisp \
 			    $(outdir)/feta-flags14.lisp \
+			    $(outdir)/feta-kievan14.lisp \
 			    $(outdir)/parmesan14.lisp \
 			    $(outdir)/feta-alphabet14.lisp
 $(outdir)/feta13.otf-table: $(outdir)/feta13.lisp \
 			    $(outdir)/feta-noteheads13.lisp \
 			    $(outdir)/feta-flags13.lisp \
+			    $(outdir)/feta-kievan13.lisp \
 			    $(outdir)/parmesan13.lisp \
 			    $(outdir)/feta-alphabet13.lisp
 $(outdir)/feta11.otf-table: $(outdir)/feta11.lisp \
 			    $(outdir)/feta-noteheads11.lisp \
 			    $(outdir)/feta-flags11.lisp \
+			    $(outdir)/feta-kievan11.lisp \
 			    $(outdir)/parmesan11.lisp \
 			    $(outdir)/feta-alphabet11.lisp
 
diff --git a/mf/feta-kievan-generic.mf b/mf/feta-kievan-generic.mf
new file mode 100644
index 0000000..bb9294b
--- /dev/null
+++ b/mf/feta-kievan-generic.mf
@@ -0,0 +1,47 @@
+% Feta (not the Font-En-Tja) music font --  generic stuff: include lots of files, but don't
+% This file is part of LilyPond, the GNU music typesetter.
+%
+% Copyright (C) 2011 Aleksandr Andreev <aleksandr.andreev@gmail.com>
+%
+%
+% LilyPond 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.
+%
+% LilyPond 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 LilyPond.	If not, see <http://www.gnu.org/licenses/>.
+
+
+if test = -1:
+	mode := smoke;
+fi
+
+staffsize# := design_size * pt#;
+
+mode_setup;
+
+input feta-macros;
+
+input feta-params;
+
+font_x_height staff_space#;
+
+fet_beginfont ("feta", design_size, "fetaMusic");
+
+input feta-kievan;
+
+autometric_parameter ("staffsize", staffsize#);
+autometric_parameter ("stafflinethickness", stafflinethickness#);
+autometric_parameter ("staff_space", staff_space#);
+autometric_parameter ("linethickness", linethickness#);
+autometric_parameter ("black_notehead_width", black_notehead_width#);
+autometric_parameter ("ledgerlinethickness", ledgerlinethickness#);
+autometric_parameter ("blot_diameter", blot_diameter#);
+
+fet_endfont;
diff --git a/mf/feta-kievan.mf b/mf/feta-kievan.mf
new file mode 100644
index 0000000..24d7313
--- /dev/null
+++ b/mf/feta-kievan.mf
@@ -0,0 +1,54 @@
+% Feta (not the Font-En-Tja) music font -- implement noteheads
+% This file is part of LilyPond, the GNU music typesetter.
+%
+% Copyright (C) 2011 Aleksandr Andreev <aleksandr.andreev@gmail.com>
+% BASED OFF SUPRASL, (C) 2009 JOPPI HARRI, USED WITH PERMISSION
+%
+%
+% LilyPond 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.
+%
+% LilyPond 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 LilyPond.  If not, see <http://www.gnu.org/licenses/>.
+
+
+fet_begingroup ("kievan");
+
+fet_beginchar("kievan quarter (down)", "d2");
+	% this draws the quarter note with the stem down
+	% quarter note with stem down is used for all quarter notes when we are on
+	% third line of staff or above
+	% and sometimes on second line or between second or third line
+	x1 = 2.2 * 2 staff_space#;
+	x2 = 16.3 * 2 staff_space#;
+	x3 = 24.2 * 2 staff_space#;
+	y1 = 8.1 * 2 staff_space#;
+	y2 = 9.1 * 2 staff_space#;
+	y3 = 8.9 * 2 staff_space#;
+	x4 = 22 * 2 staff_space#;
+	y4 = -25.8 * 2 staff_space#;
+	x5 = 25 * 2 staff_space#;
+	y5 = -58.6 * 2 staff_space#;
+	x6 = 14.8 * 2 staff_space#;
+	y6 = -63.5 * 2 staff_space#;
+	x7 = 14.3 * 2 staff_space#;
+	y7 = -46.9 * 2 staff_space#;
+	x8 = 17.8 * 2 staff_space#;
+	y8 = -8.5 * 2 staff_space#;
+	x9 = 0.4 * 2 staff_space#;
+	y9 = -9.6 * 2 staff_space#;
+	x10 = 0;
+	y10 = -5.9 * 2 staff_space#;
+	fill z1{dir 8.6} .. z2 .. z3 & z3 .. z4 .. z5 & z5 -- z6 & z6 .. z7 .. z8 & z8{left} .. z9 & z9 .. z10 ... {dir 75}cycle;
+
+	set_char_box (0, 1.39 staff_space#, 3.53 staff_space#, 0.51 staff_space#);
+fet_endchar;
+
+fet_endgroup ("kievan");
diff --git a/mf/feta-kievan11.mf b/mf/feta-kievan11.mf
new file mode 100644
index 0000000..38df1f0
--- /dev/null
+++ b/mf/feta-kievan11.mf
@@ -0,0 +1,13 @@
+% feta-kievan11.mf
+% part of LilyPond's pretty-but-neat music font
+
+input feta-autometric;
+
+design_size := 11.22;
+test := 0;
+
+
+input feta-kievan-generic;
+
+end.
+
diff --git a/mf/feta-kievan13.mf b/mf/feta-kievan13.mf
new file mode 100644
index 0000000..87a6830
--- /dev/null
+++ b/mf/feta-kievan13.mf
@@ -0,0 +1,13 @@
+% feta-kievan13.mf
+% part of LilyPond's pretty-but-neat music font
+
+input feta-autometric;
+
+design_size := 12.60;
+test := 0;
+
+
+input feta-kievan-generic;
+
+end.
+
diff --git a/mf/feta-kievan14.mf b/mf/feta-kievan14.mf
new file mode 100644
index 0000000..f1de0fc
--- /dev/null
+++ b/mf/feta-kievan14.mf
@@ -0,0 +1,13 @@
+% feta-kievan14.mf
+% part of LilyPond's pretty-but-neat music font
+
+input feta-autometric;
+
+design_size := 14.14;
+test := 0;
+
+
+input feta-kievan-generic;
+
+end.
+
diff --git a/mf/feta-kievan16.mf b/mf/feta-kievan16.mf
new file mode 100644
index 0000000..9c4fa1d
--- /dev/null
+++ b/mf/feta-kievan16.mf
@@ -0,0 +1,13 @@
+% feta-kievan16.mf
+% part of LilyPond's pretty-but-neat music font
+
+input feta-autometric;
+
+design_size := 15.87;
+test := 0;
+
+
+input feta-kievan-generic;
+
+end.
+
diff --git a/mf/feta-kievan18.mf b/mf/feta-kievan18.mf
new file mode 100644
index 0000000..f1716da
--- /dev/null
+++ b/mf/feta-kievan18.mf
@@ -0,0 +1,13 @@
+% feta-kievan18.mf
+% part of LilyPond's pretty-but-neat music font
+
+input feta-autometric;
+
+design_size := 17.82;
+test := 0;
+
+
+input feta-kievan-generic;
+
+end.
+
diff --git a/mf/feta-kievan20.mf b/mf/feta-kievan20.mf
new file mode 100644
index 0000000..0e3476c
--- /dev/null
+++ b/mf/feta-kievan20.mf
@@ -0,0 +1,13 @@
+% feta-kievan20.mf
+% part of LilyPond's pretty-but-neat music font
+
+input feta-autometric;
+
+design_size := 20;
+test := 0;
+
+
+input feta-kievan-generic;
+
+end.
+
diff --git a/mf/feta-kievan23.mf b/mf/feta-kievan23.mf
new file mode 100644
index 0000000..962ddd2
--- /dev/null
+++ b/mf/feta-kievan23.mf
@@ -0,0 +1,13 @@
+% feta-kievan23.mf
+% part of LilyPond's pretty-but-neat music font
+
+input feta-autometric;
+
+design_size := 22.45;
+test := 0;
+
+
+input feta-kievan-generic;
+
+end.
+
diff --git a/mf/feta-kievan26.mf b/mf/feta-kievan26.mf
new file mode 100644
index 0000000..27f1ce7
--- /dev/null
+++ b/mf/feta-kievan26.mf
@@ -0,0 +1,13 @@
+% feta-kievan26.mf
+% part of LilyPond's pretty-but-neat music font
+
+input feta-autometric;
+
+design_size := 25.20;
+test := 0;
+
+
+input feta-kievan-generic;
+
+end.
+
diff --git a/scripts/build/gen-emmentaler-scripts.py b/scripts/build/gen-emmentaler-scripts.py
index 8d7d08b..f23e1c4 100644
--- a/scripts/build/gen-emmentaler-scripts.py
+++ b/scripts/build/gen-emmentaler-scripts.py
@@ -43,6 +43,7 @@ SetFontNames("%(name)s-%(design_size)d", "%(name)s-%(design_size)d", "%(name)s-%
 MergeFonts("feta%(design_size)d.pfb");
 MergeFonts("feta-noteheads%(design_size)d.pfb");
 MergeFonts("feta-flags%(design_size)d.pfb");
+MergeFonts("feta-kievan%(design_size)d.pfb");
 MergeFonts("parmesan%(design_size)d.pfb");
 
 # load nummer/din after setting PUA.
diff --git a/scripts/build/mf-to-table.py b/scripts/build/mf-to-table.py
index 4f8f92d..9ca6878 100644
--- a/scripts/build/mf-to-table.py
+++ b/scripts/build/mf-to-table.py
@@ -246,6 +246,8 @@ for filenm in files:
         enc_name = 'FetaNoteheadsEncoding'
     elif re.search ('feta-flags', filenm):
         enc_name = 'FetaFlagsEncoding'
+    elif re.search ('feta-kievan', filenm):
+        enc_name = 'FetaKievanEncoding'
     elif re.search ('feta-brace', filenm):
         enc_name = 'FetaBraceEncoding'
     elif re.search ('feta-alphabet', filenm):
-- 
1.7.0.4

