+1.3.18.uu2
+==========
+
+* lilypond-mode.el for emacs supersedes mudela-mode.el
+
+* Tuplet spanners don't collide with encompassing notes.
+
+* Gobbled Adobe parseAFM* code, for future use.
+
+* Big 1999 to 2000 search/replace.
+
+* Big interline to staff_space search/replace for mf files.
+
+* Removed Bow class, and split code into Tie and Slur
+
+* Don't put scripts on grace notes.
+
+* Font_metric uses SCM for name field.
+
+* Various compilation fixes.
+
1.3.17.jcn2
===========
1.3.16.jcn1
===========
- * Fixed cross staff slurs. It seems that cross-staff sign
- was swapped.
+* Fixed cross staff slurs. It seems that cross-staff sign
+ was swapped.
1.3.15.hwn1
===========
@subsubsection Is there an emacs mode?
-Yes. It is included with the source archive as mudela-mode.el. If
-you have an rpm it is in @file{/usr/doc/lilypond-X/}. You have to install it
-yourself.
+Yes. It is included with the source archive as @file{lilypond-mode.el}.
+If you have an RPM it is in @file{/usr/doc/lilypond-X/}. You have to
+install it yourself.
@subsubsection How do I create the @file{.tfm} files?
distance. Grace notes (of course) come before the accidentals of the
main note. Grace notes can also be positioned after the main note.
+Grace notes without beams should have a slash, if @code{flagStyle} is
+not set. Main note scripts don't end up on the grace note.
+
@mudelafile{grace.ly}
.* TODO
. * use hash tabs iso. alist_ for elt property?
-. * tremolos.
+. * fix tremolos.
. * internationalize GUILE msgs.
+. * with lily 1.3.17, i'm seeing tuplet markings slice mercilessly through
+whatever stands in their way. for an example, see
+http://www4.smart.net/~jcovey/tmp/smith/closing.ps.gz
+on page 2, end of the second system. is there any way around this?
. * unbroken marks.
-. * put property test files in refman.
-. * fix slurdotted
+. * put property test files in refman.
+. * use gnome-print ParseAFM
+. * fix slurdotted!
. * alignment within @itemize
-. * slur dashing.
+. * interstaff stems
. * junk dstream output.
. * agressive type-checking for SCM stuff.
+. * \prop slurdir in grace notes
. * script columns
. * Must stop before this music ends:
verse=\lyrics {
. * input/bugs/clef.sly: clef changes go missing
+. * clean up font metric handling.
. * input/test/grace.sly: wierd big spacing on grace notes
. * TODO^2:
. * make a TODO.texi, like http://www.gnu.org/software/guile/ideas.html
. * context in embedded SCM errors.
. * acc at tied note after linebreak.
. * fix font-naming and selecting
-. * barcheck warning doesn't resync anymore
-. * provide settable/invisible span-score-bar bracket
. * add context information to warnings
Paper:
waarschuwing: Kan niet beide uiteinden van bindingsboog vinden
pa.ly:33:23: waarschuwing: Schroot verzoek: `Span_req':
g' a4 bes8 \grace f8(
)es16 d es8 r c |
-. * sparse ties.
. * chord tonic: placement of accidental C#, Cb (from scm and C++)
. * note head on stem err msg in dutch.
. * why need to run -C mf twice?
. * hara kiri _8 clef.
. * junk -M ?
. * mudela-book doco
-. * fix or replace feta-accordion.mf
. * bracket pdf hack
. * Mondrup:
- if I change the property minVerticalAlign in a multi staff score with
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include <assert.h>
source file of the Flower Library
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "cpu-timer.hh"
source file of the Flower Library
- (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1996, 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include <fstream.h>
this is (Copyleft) 1996, Han-Wen Nienhuys, <hanwen@cs.uu.nl>
*/
+#include <string.h>
#include <stdio.h>
#include <iostream.h>
#include <assert.h>
#include "international.hh"
#include "string-convert.hh"
+
#if !HAVE_GETTEXT
inline char*
gettext (char const* s)
source file of the Flower Library
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the Flower Library
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the Flower Library
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the Flower Library
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the Flower Library
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#ifndef DSTREAM_HH
source file of the Flower Library
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#ifndef PATH_HH
source file of the Flower Library
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
--- /dev/null
+
+/*
+ fproto.hh -- typenames in flowerlib
+
+ (c) 1996 Han-Wen Nienhuys
+*/
+
+#ifndef FPROTO_HH
+#define FPROTO_HH
+
+
+char const * flower_version_sz();
+
+template<class T> struct Link_array;
+template<class T> struct Array;
+template<class T,class K> struct Assoc;
+template<class K, class V> struct Hash_table;
+template<class K, class V> struct Hash_table_iter;
+template<class T> struct Dictionary_iter;
+template<class T> struct Dictionary;
+template<class T> struct Dictionary_iter;
+template<class T> struct Link_list;
+template<class T> struct Interval_t;
+template<class T> struct PQueue;
+
+#include "real.hh"
+
+typedef Interval_t<Real> Interval;
+typedef Interval_t<int> Slice; // junkme.
+
+struct Offset;
+struct Long_option_init;
+struct Rational;
+struct File_path;
+struct Getopt_long;
+struct String_data;
+struct String_handle;
+struct String_convert;
+struct String;
+
+struct Text_stream;
+struct Data_file;
+struct Text_db;
+struct Scalar;
+
+typedef unsigned char U8;
+typedef short I16;
+typedef unsigned short U16;
+typedef unsigned U32;
+typedef int I32;
+typedef long long I64;
+
+typedef unsigned char Byte;
+
+
+#endif // FPROTO_HH
+
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#define INTERVAL_HH
#include <assert.h>
-#include "fproto.hh"
+#include "flower-proto.hh"
#include "real.hh"
#include "drul-array.hh"
return a*i;
}
-// again? see fproto.hh
+// again? see flower-proto.hh
typedef Interval_t<Real> Interval;
typedef Interval_t<int> Slice; // weird name
source file of the Flower Library
- (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1996, 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the flowerlib
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#ifndef LIBC_EXTENSION_HH
#define LIBC_EXTENSION_HH
-#include "fproto.hh"
+#include "flower-proto.hh"
#include "config.h"
#include <cstddef>
#include <stdarg.h>
struct Offset;
Offset complex_multiply (Offset, Offset);
+Offset complex_divide (Offset, Offset);
Offset complex_exp (Offset);
source file of the Flower Library
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
--- /dev/null
+/* Modified 1999 Morten Welinder:
+ * 1. ANSI prototype.
+ * 2. parseFileFree function.
+ */
+// 2000 HWN: AFM_ prefixes.
+/*
+ * (C) 1988, 1989 by Adobe Systems Incorporated. All rights reserved.
+ *
+ * This file may be freely copied and redistributed as long as:
+ * 1) This entire notice continues to be included in the file,
+ * 2) If the file has been modified in any way, a notice of such
+ * modification is conspicuously indicated.
+ *
+ * PostScript, Display PostScript, and Adobe are registered trademarks of
+ * Adobe Systems Incorporated.
+ *
+ * ************************************************************************
+ * THE INFORMATION BELOW IS FURNISHED AS IS, IS SUBJECT TO CHANGE WITHOUT
+ * NOTICE, AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY ADOBE SYSTEMS
+ * INCORPORATED. ADOBE SYSTEMS INCORPORATED ASSUMES NO RESPONSIBILITY OR
+ * LIABILITY FOR ANY ERRORS OR INACCURACIES, MAKES NO WARRANTY OF ANY
+ * KIND (EXPRESS, IMPLIED OR STATUTORY) WITH RESPECT TO THIS INFORMATION,
+ * AND EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR PARTICULAR PURPOSES AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
+ * ************************************************************************
+ */
+
+/* ParseAFM.h
+ *
+ * This header file is used in conjuction with the parseAFM.c file.
+ * Together these files provide the functionality to parse Adobe Font
+ * Metrics files and store the information in predefined data structures.
+ * It is intended to work with an application program that needs font metric
+ * information. The program can be used as is by making a procedure call to
+ * parse an AFM file and have the data stored, or an application developer
+ * may wish to customize the code.
+ *
+ * This header file defines the data structures used as well as the key
+ * strings that are currently recognized by this version of the AFM parser.
+ * This program is based on the document "Adobe Font Metrics Files,
+ * Specification Version 2.0".
+ *
+ * AFM files are separated into distinct sections of different data. Because
+ * of this, the parseAFM program can parse a specified file to only save
+ * certain sections of information based on the application's needs. A record
+ * containing the requested information will be returned to the application.
+ *
+ * AFM files are divided into five sections of data:
+ * 1) The Global Font Information
+ * 2) The Character Metrics Information
+ * 3) The Track Kerning Data
+ * 4) The Pair-Wise Kerning Data
+ * 5) The Composite Character Data
+ *
+ * Basically, the application can request any of these sections independent
+ * of what other sections are requested. In addition, in recognizing that
+ * many applications will want ONLY the x-width of characters and not all
+ * of the other character metrics information, there is a way to receive
+ * only the width information so as not to pay the storage cost for the
+ * unwanted data. An application should never request both the
+ * "quick and dirty" char metrics (widths only) and the Character Metrics
+ * Information since the Character Metrics Information will contain all
+ * of the character widths as well.
+ *
+ * There is a procedure in parseAFM.c, called parseFile, that can be
+ * called from any application wishing to get information from the AFM File.
+ * This procedure expects 3 parameters: a vaild file descriptor, a pointer
+ * to a (FontInfo *) variable (for which space will be allocated and then
+ * will be filled in with the data requested), and a mask specifying
+ * which data from the AFM File should be saved in the FontInfo structure.
+ *
+ * The flags that can be used to set the appropriate mask are defined below.
+ * In addition, several commonly used masks have already been defined.
+ *
+ * History:
+ * original: DSM Thu Oct 20 17:39:59 PDT 1988
+ * modified: DSM Mon Jul 3 14:17:50 PDT 1989
+ * - added 'storageProblem' return code
+ * - fixed typos
+ */
+
+#include <stdio.h>
+
+
+
+/* your basic constants */
+#define TRUE 1
+#define FALSE 0
+#define EOL '\n' /* end-of-line indicator */
+#define MAX_NAME 4096 /* max length for identifiers */
+#define BOOL int
+#define FLAGS int
+
+
+
+/* Flags that can be AND'ed together to specify exactly what
+ * information from the AFM file should be saved.
+ */
+#define P_G 0x01 /* 0000 0001 */ /* Global Font Info */
+#define P_W 0x02 /* 0000 0010 */ /* Character Widths ONLY */
+#define P_M 0x06 /* 0000 0110 */ /* All Char Metric Info */
+#define P_P 0x08 /* 0000 1000 */ /* Pair Kerning Info */
+#define P_T 0x10 /* 0001 0000 */ /* Track Kerning Info */
+#define P_C 0x20 /* 0010 0000 */ /* Composite Char Info */
+
+
+/* Commonly used flags
+ */
+#define P_GW (P_G | P_W)
+#define P_GM (P_G | P_M)
+#define P_GMP (P_G | P_M | P_P)
+#define P_GMK (P_G | P_M | P_P | P_T)
+#define P_GALL (P_G | P_M | P_P | P_T | P_C)
+
+
+
+/* Possible return codes from the parseFile procedure.
+ *
+ * ok means there were no problems parsing the file.
+ *
+ * parseError means that there was some kind of parsing error, but the
+ * parser went on. This could include problems like the count for any given
+ * section does not add up to how many entries there actually were, or
+ * there was a key that was not recognized. The return record may contain
+ * vaild data or it may not.
+ *
+ * earlyEOF means that an End of File was encountered before expected. This
+ * may mean that the AFM file had been truncated, or improperly formed.
+ *
+ * storageProblem means that there were problems allocating storage for
+ * the data structures that would have contained the AFM data.
+ */
+#define AFM_ok 0
+#define AFM_parseError -1
+#define AFM_earlyEOF -2
+#define AFM_storageProblem -3
+
+
+
+/************************* TYPES *********************************/
+/* Below are all of the data structure definitions. These structures
+ * try to map as closely as possible to grouping and naming of data
+ * in the AFM Files.
+ */
+
+
+/* Bounding box definition. Used for the Font BBox as well as the
+ * Character BBox.
+ */
+typedef struct
+{
+ int llx; /* lower left x-position */
+ int lly; /* lower left y-position */
+ int urx; /* upper right x-position */
+ int ury; /* upper right y-position */
+} BBox;
+
+
+/* Global Font information.
+ * The key that each field is associated with is in comments. For an
+ * explanation about each key and its value please refer to the AFM
+ * documentation (full title & version given above).
+ */
+typedef struct
+{
+ char *afmVersion; /* key: StartFontMetrics */
+ char *fontName; /* key: FontName */
+ char *fullName; /* key: FullName */
+ char *familyName; /* key: FamilyName */
+ char *weight; /* key: Weight */
+ float italicAngle; /* key: ItalicAngle */
+ BOOL isFixedPitch; /* key: IsFixedPitch */
+ BBox fontBBox; /* key: FontBBox */
+ int underlinePosition; /* key: UnderlinePosition */
+ int underlineThickness; /* key: UnderlineThickness */
+ char *version; /* key: Version */
+ char *notice; /* key: Notice */
+ char *encodingScheme; /* key: EncodingScheme */
+ int capHeight; /* key: CapHeight */
+ int xHeight; /* key: XHeight */
+ int ascender; /* key: Ascender */
+ int descender; /* key: Descender */
+} AFM_GlobalFontInfo;
+
+
+/* Ligature definition is a linked list since any character can have
+ * any number of ligatures.
+ */
+typedef struct _t_ligature
+{
+ char *succ, *lig;
+ struct _t_ligature *next;
+} Ligature;
+
+
+/* Character Metric Information. This structure is used only if ALL
+ * character metric information is requested. If only the character
+ * widths is requested, then only an array of the character x-widths
+ * is returned.
+ *
+ * The key that each field is associated with is in comments. For an
+ * explanation about each key and its value please refer to the
+ * Character Metrics section of the AFM documentation (full title
+ * & version given above).
+ */
+typedef struct
+{
+ int code, /* key: C */
+ wx, /* key: WX */
+ wy; /* together wx and wy are associated with key: W */
+ char *name; /* key: N */
+ BBox charBBox; /* key: B */
+ Ligature *ligs; /* key: L (linked list; not a fixed number of Ls */
+} AFM_CharMetricInfo;
+
+
+/* Track kerning data structure.
+ * The fields of this record are the five values associated with every
+ * TrackKern entry.
+ *
+ * For an explanation about each value please refer to the
+ * Track Kerning section of the AFM documentation (full title
+ * & version given above).
+ */
+typedef struct
+{
+ int degree;
+ float minPtSize,
+ minKernAmt,
+ maxPtSize,
+ maxKernAmt;
+} AFM_TrackKernData;
+
+
+/* Pair Kerning data structure.
+ * The fields of this record are the four values associated with every
+ * KP entry. For KPX entries, the yamt will be zero.
+ *
+ * For an explanation about each value please refer to the
+ * Pair Kerning section of the AFM documentation (full title
+ * & version given above).
+ */
+typedef struct
+{
+ char *name1;
+ char *name2;
+ int xamt,
+ yamt;
+} AFM_PairKernData;
+
+
+/* AFM_Pcc is a piece of a composite character. This is a sub structure of a
+ * AFM_CompCharData described below.
+ * These fields will be filled in with the values from the key AFM_Pcc.
+ *
+ * For an explanation about each key and its value please refer to the
+ * Composite Character section of the AFM documentation (full title
+ * & version given above).
+ */
+typedef struct
+{
+ char *AFM_PccName;
+ int deltax,
+ deltay;
+} AFM_Pcc;
+
+
+/* Composite Character Information data structure.
+ * The fields ccName and numOfPieces are filled with the values associated
+ * with the key CC. The field pieces points to an array (size = numOfPieces)
+ * of information about each of the parts of the composite character. That
+ * array is filled in with the values from the key AFM_Pcc.
+ *
+ * For an explanation about each key and its value please refer to the
+ * Composite Character section of the AFM documentation (full title
+ * & version given above).
+ */
+typedef struct
+{
+ char *ccName;
+ int numOfPieces;
+ AFM_Pcc *pieces;
+} AFM_CompCharData;
+
+
+/* FontInfo
+ * Record type containing pointers to all of the other data
+ * structures containing information about a font.
+ * A a record of this type is filled with data by the
+ * parseFile function.
+ */
+typedef struct
+{
+ AFM_GlobalFontInfo *gfi; /* ptr to a AFM_GlobalFontInfo record */
+ int *cwi; /* ptr to 256 element array of just char widths */
+ int numOfChars; /* number of entries in char metrics array */
+ AFM_CharMetricInfo *cmi; /* ptr to char metrics array */
+ int numOfTracks; /* number to entries in track kerning array */
+ AFM_TrackKernData *tkd; /* ptr to track kerning array */
+ int numOfPairs; /* number to entries in pair kerning array */
+ AFM_PairKernData *pkd; /* ptr to pair kerning array */
+ int numOfComps; /* number to entries in comp char array */
+ AFM_CompCharData *ccd; /* ptr to comp char array */
+} AFM_Font_info;
+
+
+
+/************************* PROCEDURES ****************************/
+
+/* Call this procedure to do the grunt work of parsing an AFM file.
+ *
+ * "fp" should be a valid file pointer to an AFM file.
+ *
+ * "fi" is a pointer to a pointer to a FontInfo record sturcture
+ * (defined above). Storage for the FontInfo structure will be
+ * allocated in parseFile and the structure will be filled in
+ * with the requested data from the AFM File.
+ *
+ * "flags" is a mask with bits set representing what data should
+ * be saved. Defined above are valid flags that can be used to set
+ * the mask, as well as a few commonly used masks.
+ *
+ * The possible return codes from parseFile are defined above.
+ */
+
+int parseFile (FILE *fp, AFM_Font_info **fi, FLAGS flags);
+void parseFileFree (AFM_Font_info *fi);
source file of the Flower Library
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the Flower Library
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the Flower Library
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the Flower Library
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "compare.hh"
#include "arithmetic-operator.hh"
-#include "fproto.hh"
+#include "flower-proto.hh"
#include "string.hh"
/**
source file of the Flower Library
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the Flower Library
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#define STRING_CONVERT_HH
#include <stdarg.h>
-#include "fproto.hh"
+#include "flower-proto.hh"
#include "string.hh"
source file of the LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of Flower lib
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#ifndef STRINGDATA_INL
source file of the LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#ifndef STRINGHANDLE_HH
#define STRINGHANDLE_HH
-#include "fproto.hh"
+
+#include "flower-proto.hh"
/**
source file of Flower lib
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#ifndef STRINGHANDLE_INL
#include "arithmetic-operator.hh"
-#include "fproto.hh"
+#include "flower-proto.hh"
#include "string-handle.hh"
-class ostream;
-/* Libg++ also has a String class. Programming errors can lead to
- confusion about which String is in use. Uncomment the following if you have
- unexplained crashes after mucking with String
- */
-// #define String FlowerString
+class ostream;
/**
source file of the Flower Library
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the Flower Library
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#ifndef VIRTUAL_METHODS_HH
#define VIRTUAL_METHODS_HH
+ #include <typeinfo>
#include "stdlib.h" // size_t
#define classname(class_ptr) demangle_classname(typeid(*(class_ptr)))
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
source file of the Flower Library
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the flowerlib
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include <math.h>
}
+Offset
+complex_conjugate (Offset o)
+{
+ o[Y_AXIS] = - o[Y_AXIS];
+ return o;
+}
+
+Offset
+complex_divide (Offset z1, Offset z2)
+{
+ z2 = complex_conjugate (z2);
+ Offset z = complex_multiply (z1, z2);
+ z *= 1/z2.length ();
+ return z;
+}
+
+
Offset
complex_exp (Offset o)
--- /dev/null
+/* Our mods:
+
+1. FontInfo has become AFM_AFM_Font_info to avoid namespace collisions.
+2. Version is a linetoken because Bitstream Charter has a space in the version.
+3. Added some necessary #include headers.
+4. Added AFM_ prefixes to error codes.
+5. Made it recognize both '\n' and '\r' as line terminators. Sheesh!
+6. Stopped buffer overflows in token and linetoken.
+
+Raph Levien <raph@acm.org> writing on 4 Oct 1998, updating 21 Oct 1998
+
+
+1. parseFileFree function.
+2. Leak fix in parseFile.
+
+Morten Welinder <terra@diku.dk> September 1999.
+
+*/
+
+/*
+ * (C) 1988, 1989, 1990 by Adobe Systems Incorporated. All rights reserved.
+ *
+ * This file may be freely copied and redistributed as long as:
+ * 1) This entire notice continues to be included in the file,
+ * 2) If the file has been modified in any way, a notice of such
+ * modification is conspicuously indicated.
+ *
+ * PostScript, Display PostScript, and Adobe are registered trademarks of
+ * Adobe Systems Incorporated.
+ *
+ * ************************************************************************
+ * THE INFORMATION BELOW IS FURNISHED AS IS, IS SUBJECT TO CHANGE WITHOUT
+ * NOTICE, AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY ADOBE SYSTEMS
+ * INCORPORATED. ADOBE SYSTEMS INCORPORATED ASSUMES NO RESPONSIBILITY OR
+ * LIABILITY FOR ANY ERRORS OR INACCURACIES, MAKES NO WARRANTY OF ANY
+ * KIND (EXPRESS, IMPLIED OR STATUTORY) WITH RESPECT TO THIS INFORMATION,
+ * AND EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR PARTICULAR PURPOSES AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
+ * ************************************************************************
+ */
+
+/* parseAFM.c
+ *
+ * This file is used in conjuction with the parseAFM.h header file.
+ * This file contains several procedures that are used to parse AFM
+ * files. It is intended to work with an application program that needs
+ * font metric information. The program can be used as is by making a
+ * procedure call to "parseFile" (passing in the expected parameters)
+ * and having it fill in a data structure with the data from the
+ * AFM file, or an application developer may wish to customize this
+ * code.
+ *
+ * There is also a file, parseAFMclient.c, that is a sample application
+ * showing how to call the "parseFile" procedure and how to use the data
+ * after "parseFile" has returned.
+ *
+ * Please read the comments in parseAFM.h and parseAFMclient.c.
+ *
+ * History:
+ * original: DSM Thu Oct 20 17:39:59 PDT 1988
+ * modified: DSM Mon Jul 3 14:17:50 PDT 1989
+ * - added 'storageProblem' return code
+ * - fixed bug of not allocating extra byte for string duplication
+ * - fixed typos
+ * modified: DSM Tue Apr 3 11:18:34 PDT 1990
+ * - added free(ident) at end of parseFile routine
+ * modified: DSM Tue Jun 19 10:16:29 PDT 1990
+ * - changed (width == 250) to (width = 250) in initializeArray
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <sys/file.h>
+#include <math.h>
+#include <string.h>
+#include "parse-afm.hh"
+
+#define lineterm EOL /* line terminating character */
+#define lineterm_alt '\r' /* alternative line terminating character */
+#define normalEOF 1 /* return code from parsing routines used only */
+ /* in this module */
+#define Space "space" /* used in string comparison to look for the width */
+ /* of the space character to init the widths array */
+#define False "false" /* used in string comparison to check the value of */
+ /* boolean keys (e.g. IsFixedPitch) */
+
+#define MATCH(A,B) (strncmp((A),(B), MAX_NAME) == 0)
+
+
+
+/*************************** GLOBALS ***********************/
+
+static char *ident = NULL; /* storage buffer for keywords */
+
+
+/* "shorts" for fast case statement
+ * The values of each of these enumerated items correspond to an entry in the
+ * table of strings defined below. Therefore, if you add a new string as
+ * new keyword into the keyStrings table, you must also add a corresponding
+ * parseKey AND it MUST be in the same position!
+ *
+ * IMPORTANT: since the sorting algorithm is a binary search, the strings of
+ * keywords must be placed in lexicographical order, below. [Therefore, the
+ * enumerated items are not necessarily in lexicographical order, depending
+ * on the name chosen. BUT, they must be placed in the same position as the
+ * corresponding key string.] The NOPE shall remain in the last position,
+ * since it does not correspond to any key string, and it is used in the
+ * "recognize" procedure to calculate how many possible keys there are.
+ */
+
+enum parseKey {
+ ASCENDER, CHARBBOX, CODE, COMPCHAR, CAPHEIGHT, COMMENT,
+ DESCENDER, ENCODINGSCHEME, ENDCHARMETRICS, ENDCOMPOSITES,
+ ENDFONTMETRICS, ENDKERNDATA, ENDKERNPAIRS, ENDTRACKKERN,
+ FAMILYNAME, FONTBBOX, FONTNAME, FULLNAME, ISFIXEDPITCH,
+ ITALICANGLE, KERNPAIR, KERNPAIRXAMT, LIGATURE, CHARNAME,
+ NOTICE, COMPCHARPIECE, STARTCHARMETRICS, STARTCOMPOSITES,
+ STARTFONTMETRICS, STARTKERNDATA, STARTKERNPAIRS,
+ STARTTRACKKERN, TRACKKERN, UNDERLINEPOSITION,
+ UNDERLINETHICKNESS, VERSION, XYWIDTH, XWIDTH, WEIGHT, XHEIGHT,
+ NOPE };
+
+/* keywords for the system:
+ * This a table of all of the current strings that are vaild AFM keys.
+ * Each entry can be referenced by the appropriate parseKey value (an
+ * enumerated data type defined above). If you add a new keyword here,
+ * a corresponding parseKey MUST be added to the enumerated data type
+ * defined above, AND it MUST be added in the same position as the
+ * string is in this table.
+ *
+ * IMPORTANT: since the sorting algorithm is a binary search, the keywords
+ * must be placed in lexicographical order. And, NULL should remain at the
+ * end.
+ */
+
+static char *keyStrings[] = {
+ "Ascender", "B", "C", "CC", "CapHeight", "Comment",
+ "Descender", "EncodingScheme", "EndCharMetrics", "EndComposites",
+ "EndFontMetrics", "EndKernData", "EndKernPairs", "EndTrackKern",
+ "FamilyName", "FontBBox", "FontName", "FullName", "IsFixedPitch",
+ "ItalicAngle", "KP", "KPX", "L", "N",
+ "Notice", "PCC", "StartCharMetrics", "StartComposites",
+ "StartFontMetrics", "StartKernData", "StartKernPairs",
+ "StartTrackKern", "TrackKern", "UnderlinePosition",
+ "UnderlineThickness", "Version", "W", "WX", "Weight", "XHeight",
+ NULL };
+
+/*************************** PARSING ROUTINES **************/
+
+/*************************** token *************************/
+
+/* A "AFM File Conventions" tokenizer. That means that it will
+ * return the next token delimited by white space. See also
+ * the `linetoken' routine, which does a similar thing but
+ * reads all tokens until the next end-of-line.
+ */
+
+static char *token(FILE *stream)
+{
+ int ch, idx;
+
+ /* skip over white space */
+ while ((ch = fgetc(stream)) == ' ' || ch == lineterm ||
+ ch == lineterm_alt ||
+ ch == ',' || ch == '\t' || ch == ';');
+
+ idx = 0;
+ while (idx < MAX_NAME - 1 &&
+ ch != EOF && ch != ' ' && ch != lineterm && ch != lineterm_alt
+ && ch != '\t' && ch != ':' && ch != ';')
+ {
+ ident[idx++] = ch;
+ ch = fgetc(stream);
+ } /* while */
+
+ if (ch == EOF && idx < 1) return ((char *)NULL);
+ if (idx >= 1 && ch != ':' ) ungetc(ch, stream);
+ if (idx < 1 ) ident[idx++] = ch; /* single-character token */
+ ident[idx] = 0;
+
+ return(ident); /* returns pointer to the token */
+
+} /* token */
+
+
+/*************************** linetoken *************************/
+
+/* "linetoken" will get read all tokens until the EOL character from
+ * the given stream. This is used to get any arguments that can be
+ * more than one word (like Comment lines and FullName).
+ */
+
+static char *linetoken(FILE *stream)
+{
+ int ch, idx;
+
+ while ((ch = fgetc(stream)) == ' ' || ch == '\t' );
+
+ idx = 0;
+ while (idx < MAX_NAME - 1 &&
+ ch != EOF && ch != lineterm && ch != lineterm_alt)
+ {
+ ident[idx++] = ch;
+ ch = fgetc(stream);
+ } /* while */
+
+ ungetc(ch, stream);
+ ident[idx] = 0;
+
+ return(ident); /* returns pointer to the token */
+
+} /* linetoken */
+
+
+/*************************** recognize *************************/
+
+/* This function tries to match a string to a known list of
+ * valid AFM entries (check the keyStrings array above).
+ * "ident" contains everything from white space through the
+ * next space, tab, or ":" character.
+ *
+ * The algorithm is a standard Knuth binary search.
+ */
+
+static enum parseKey recognize( register char *ident)
+{
+ int lower = 0, upper = (int) NOPE, midpoint, cmpvalue;
+ BOOL found = FALSE;
+
+ while ((upper >= lower) && !found)
+ {
+ midpoint = (lower + upper)/2;
+ if (keyStrings[midpoint] == NULL) break;
+ cmpvalue = strncmp(ident, keyStrings[midpoint], MAX_NAME);
+ if (cmpvalue == 0) found = TRUE;
+ else if (cmpvalue < 0) upper = midpoint - 1;
+ else lower = midpoint + 1;
+ } /* while */
+
+ if (found) return (enum parseKey) midpoint;
+ else return NOPE;
+
+} /* recognize */
+
+
+/************************* parseGlobals *****************************/
+
+/* This function is called by "parseFile". It will parse the AFM File
+ * up to the "StartCharMetrics" keyword, which essentially marks the
+ * end of the Global Font Information and the beginning of the character
+ * metrics information.
+ *
+ * If the caller of "parseFile" specified that it wanted the Global
+ * Font Information (as defined by the "AFM File Specification"
+ * document), then that information will be stored in the returned
+ * data structure.
+ *
+ * Any Global Font Information entries that are not found in a
+ * given file, will have the usual default initialization value
+ * for its type (i.e. entries of type int will be 0, etc).
+ *
+ * This function returns an error code specifying whether there was
+ * a premature EOF or a parsing error. This return value is used by
+ * parseFile to determine if there is more file to parse.
+ */
+
+static BOOL parseGlobals(FILE *fp, register AFM_GlobalFontInfo *gfi)
+{
+ BOOL cont = TRUE, save = (gfi != NULL);
+ int error = AFM_ok;
+ register char *keyword;
+
+ while (cont)
+ {
+ keyword = token(fp);
+
+ if (keyword == NULL)
+ /* Have reached an early and unexpected EOF. */
+ /* Set flag and stop parsing */
+ {
+ error = AFM_earlyEOF;
+ break; /* get out of loop */
+ }
+ if (!save)
+ /* get tokens until the end of the Global Font info section */
+ /* without saving any of the data */
+ switch (recognize(keyword))
+ {
+ case STARTCHARMETRICS:
+ cont = FALSE;
+ break;
+ case ENDFONTMETRICS:
+ cont = FALSE;
+ error = normalEOF;
+ break;
+ default:
+ break;
+ } /* switch */
+ else
+ /* otherwise parse entire global font info section, */
+ /* saving the data */
+ switch(recognize(keyword))
+ {
+ case STARTFONTMETRICS:
+ keyword = token(fp);
+ gfi->afmVersion = (char *) malloc(strlen(keyword) + 1);
+ strcpy(gfi->afmVersion, keyword);
+ break;
+ case COMMENT:
+ keyword = linetoken(fp);
+ break;
+ case FONTNAME:
+ keyword = token(fp);
+ gfi->fontName = (char *) malloc(strlen(keyword) + 1);
+ strcpy(gfi->fontName, keyword);
+ break;
+ case ENCODINGSCHEME:
+ keyword = token(fp);
+ gfi->encodingScheme = (char *)
+ malloc(strlen(keyword) + 1);
+ strcpy(gfi->encodingScheme, keyword);
+ break;
+ case FULLNAME:
+ keyword = linetoken(fp);
+ gfi->fullName = (char *) malloc(strlen(keyword) + 1);
+ strcpy(gfi->fullName, keyword);
+ break;
+ case FAMILYNAME:
+ keyword = linetoken(fp);
+ gfi->familyName = (char *) malloc(strlen(keyword) + 1);
+ strcpy(gfi->familyName, keyword);
+ break;
+ case WEIGHT:
+ keyword = token(fp);
+ gfi->weight = (char *) malloc(strlen(keyword) + 1);
+ strcpy(gfi->weight, keyword);
+ break;
+ case ITALICANGLE:
+ keyword = token(fp);
+ gfi->italicAngle = atof(keyword);
+ if (errno == ERANGE) error = AFM_parseError;
+ break;
+ case ISFIXEDPITCH:
+ keyword = token(fp);
+ if (MATCH(keyword, False))
+ gfi->isFixedPitch = 0;
+ else
+ gfi->isFixedPitch = 1;
+ break;
+ case UNDERLINEPOSITION:
+ keyword = token(fp);
+ gfi->underlinePosition = atoi(keyword);
+ break;
+ case UNDERLINETHICKNESS:
+ keyword = token(fp);
+ gfi->underlineThickness = atoi(keyword);
+ break;
+ case VERSION:
+ keyword = linetoken(fp);
+ gfi->version = (char *) malloc(strlen(keyword) + 1);
+ strcpy(gfi->version, keyword);
+ break;
+ case NOTICE:
+ keyword = linetoken(fp);
+ gfi->notice = (char *) malloc(strlen(keyword) + 1);
+ strcpy(gfi->notice, keyword);
+ break;
+ case FONTBBOX:
+ keyword = token(fp);
+ gfi->fontBBox.llx = atoi(keyword);
+ keyword = token(fp);
+ gfi->fontBBox.lly = atoi(keyword);
+ keyword = token(fp);
+ gfi->fontBBox.urx = atoi(keyword);
+ keyword = token(fp);
+ gfi->fontBBox.ury = atoi(keyword);
+ break;
+ case CAPHEIGHT:
+ keyword = token(fp);
+ gfi->capHeight = atoi(keyword);
+ break;
+ case XHEIGHT:
+ keyword = token(fp);
+ gfi->xHeight = atoi(keyword);
+ break;
+ case DESCENDER:
+ keyword = token(fp);
+ gfi->descender = atoi(keyword);
+ break;
+ case ASCENDER:
+ keyword = token(fp);
+ gfi->ascender = atoi(keyword);
+ break;
+ case STARTCHARMETRICS:
+ cont = FALSE;
+ break;
+ case ENDFONTMETRICS:
+ cont = FALSE;
+ error = normalEOF;
+ break;
+ case NOPE:
+ default:
+ error = AFM_parseError;
+ break;
+ } /* switch */
+ } /* while */
+
+ return(error);
+
+} /* parseGlobals */
+
+
+
+/************************* initializeArray ************************/
+
+/* Unmapped character codes are (at Adobe Systems) assigned the
+ * width of the space character (if one exists) else they get the
+ * value of 250 ems. This function initializes all entries in the
+ * char widths array to have this value. Then any mapped character
+ * codes will be replaced with the width of the appropriate character
+ * when parsing the character metric section.
+
+ * This function parses the Character Metrics Section looking
+ * for a space character (by comparing character names). If found,
+ * the width of the space character will be used to initialize the
+ * values in the array of character widths.
+ *
+ * Before returning, the position of the read/write pointer of the
+ * file is reset to be where it was upon entering this function.
+ */
+
+static int initializeArray(FILE *fp, register int *cwi)
+{
+ BOOL cont = TRUE, found = FALSE;
+ long opos = ftell(fp);
+ int code = 0, width = 0, i = 0, error = 0;
+ register char *keyword;
+
+ while (cont)
+ {
+ keyword = token(fp);
+ if (keyword == NULL)
+ {
+ error = AFM_earlyEOF;
+ break; /* get out of loop */
+ }
+ switch(recognize(keyword))
+ {
+ case COMMENT:
+ keyword = linetoken(fp);
+ break;
+ case CODE:
+ code = atoi(token(fp));
+ break;
+ case XWIDTH:
+ width = atoi(token(fp));
+ break;
+ case CHARNAME:
+ keyword = token(fp);
+ if (MATCH(keyword, Space))
+ {
+ cont = FALSE;
+ found = TRUE;
+ }
+ break;
+ case ENDCHARMETRICS:
+ cont = FALSE;
+ break;
+ case ENDFONTMETRICS:
+ cont = FALSE;
+ error = normalEOF;
+ break;
+ case NOPE:
+ default:
+ error = AFM_parseError;
+ break;
+ } /* switch */
+ } /* while */
+
+ if (!found)
+ width = 250;
+
+ for (i = 0; i < 256; ++i)
+ cwi[i] = width;
+
+ fseek(fp, opos, 0);
+
+ return(error);
+
+} /* initializeArray */
+
+
+/************************* parseCharWidths **************************/
+
+/* This function is called by "parseFile". It will parse the AFM File
+ * up to the "EndCharMetrics" keyword. It will save the character
+ * width info (as opposed to all of the character metric information)
+ * if requested by the caller of parseFile. Otherwise, it will just
+ * parse through the section without saving any information.
+ *
+ * If data is to be saved, parseCharWidths is passed in a pointer
+ * to an array of widths that has already been initialized by the
+ * standard value for unmapped character codes. This function parses
+ * the Character Metrics section only storing the width information
+ * for the encoded characters into the array using the character code
+ * as the index into that array.
+ *
+ * This function returns an error code specifying whether there was
+ * a premature EOF or a parsing error. This return value is used by
+ * parseFile to determine if there is more file to parse.
+ */
+
+static int parseCharWidths(FILE *fp, register int *cwi)
+{
+ BOOL cont = TRUE, save = (cwi != NULL);
+ int pos = 0, error = AFM_ok;
+ register char *keyword;
+
+ while (cont)
+ {
+ keyword = token(fp);
+ /* Have reached an early and unexpected EOF. */
+ /* Set flag and stop parsing */
+ if (keyword == NULL)
+ {
+ error = AFM_earlyEOF;
+ break; /* get out of loop */
+ }
+ if (!save)
+ /* get tokens until the end of the Char Metrics section without */
+ /* saving any of the data*/
+ switch (recognize(keyword))
+ {
+ case ENDCHARMETRICS:
+ cont = FALSE;
+ break;
+ case ENDFONTMETRICS:
+ cont = FALSE;
+ error = normalEOF;
+ break;
+ default:
+ break;
+ } /* switch */
+ else
+ /* otherwise parse entire char metrics section, saving */
+ /* only the char x-width info */
+ switch(recognize(keyword))
+ {
+ case COMMENT:
+ keyword = linetoken(fp);
+ break;
+ case CODE:
+ keyword = token(fp);
+ pos = atoi(keyword);
+ break;
+ case XYWIDTH:
+ /* PROBLEM: Should be no Y-WIDTH when doing "quick & dirty" */
+ keyword = token(fp); keyword = token(fp); /* eat values */
+ error = AFM_parseError;
+ break;
+ case XWIDTH:
+ keyword = token(fp);
+ if (pos >= 0) /* ignore unmapped chars */
+ cwi[pos] = atoi(keyword);
+ break;
+ case ENDCHARMETRICS:
+ cont = FALSE;
+ break;
+ case ENDFONTMETRICS:
+ cont = FALSE;
+ error = normalEOF;
+ break;
+ case CHARNAME: /* eat values (so doesn't cause AFM_parseError) */
+ keyword = token(fp);
+ break;
+ case CHARBBOX:
+ keyword = token(fp); keyword = token(fp);
+ keyword = token(fp); keyword = token(fp);
+ break;
+ case LIGATURE:
+ keyword = token(fp); keyword = token(fp);
+ break;
+ case NOPE:
+ default:
+ error = AFM_parseError;
+ break;
+ } /* switch */
+ } /* while */
+
+ return(error);
+
+} /* parseCharWidths */
+
+
+/************************* parseCharMetrics ************************/
+
+/* This function is called by parseFile if the caller of parseFile
+ * requested that all character metric information be saved
+ * (as opposed to only the character width information).
+ *
+ * parseCharMetrics is passed in a pointer to an array of records
+ * to hold information on a per character basis. This function
+ * parses the Character Metrics section storing all character
+ * metric information for the ALL characters (mapped and unmapped)
+ * into the array.
+ *
+ * This function returns an error code specifying whether there was
+ * a premature EOF or a parsing error. This return value is used by
+ * parseFile to determine if there is more file to parse.
+ */
+
+static int parseCharMetrics(FILE *fp, register AFM_Font_info *fi)
+{
+ BOOL cont = TRUE, firstTime = TRUE;
+ int error = AFM_ok, count = 0;
+ register AFM_CharMetricInfo *temp = fi->cmi;
+ register char *keyword;
+
+ while (cont)
+ {
+ keyword = token(fp);
+ if (keyword == NULL)
+ {
+ error = AFM_earlyEOF;
+ break; /* get out of loop */
+ }
+ switch(recognize(keyword))
+ {
+ case COMMENT:
+ keyword = linetoken(fp);
+ break;
+ case CODE:
+ if (count < fi->numOfChars)
+ {
+ if (firstTime) firstTime = FALSE;
+ else temp++;
+ temp->code = atoi(token(fp));
+ count++;
+ }
+ else
+ {
+ error = AFM_parseError;
+ cont = FALSE;
+ }
+ break;
+ case XYWIDTH:
+ temp->wx = atoi(token(fp));
+ temp->wy = atoi(token(fp));
+ break;
+ case XWIDTH:
+ temp->wx = atoi(token(fp));
+ break;
+ case CHARNAME:
+ keyword = token(fp);
+ temp->name = (char *) malloc(strlen(keyword) + 1);
+ strcpy(temp->name, keyword);
+ break;
+ case CHARBBOX:
+ temp->charBBox.llx = atoi(token(fp));
+ temp->charBBox.lly = atoi(token(fp));
+ temp->charBBox.urx = atoi(token(fp));
+ temp->charBBox.ury = atoi(token(fp));
+ break;
+ case LIGATURE: {
+ Ligature **tail = &(temp->ligs);
+ Ligature *node = *tail;
+
+ if (*tail != NULL)
+ {
+ while (node->next != NULL)
+ node = node->next;
+ tail = &(node->next);
+ }
+
+ *tail = (Ligature *) calloc(1, sizeof(Ligature));
+ keyword = token(fp);
+ (*tail)->succ = (char *) malloc(strlen(keyword) + 1);
+ strcpy((*tail)->succ, keyword);
+ keyword = token(fp);
+ (*tail)->lig = (char *) malloc(strlen(keyword) + 1);
+ strcpy((*tail)->lig, keyword);
+ break; }
+ case ENDCHARMETRICS:
+ cont = FALSE;;
+ break;
+ case ENDFONTMETRICS:
+ cont = FALSE;
+ error = normalEOF;
+ break;
+ case NOPE:
+ default:
+ error = AFM_parseError;
+ break;
+ } /* switch */
+ } /* while */
+
+ if ((error == AFM_ok) && (count != fi->numOfChars))
+ error = AFM_parseError;
+
+ return(error);
+
+} /* parseCharMetrics */
+
+
+
+/************************* parseAFM_TrackKernData ***********************/
+
+/* This function is called by "parseFile". It will parse the AFM File
+ * up to the "EndTrackKern" or "EndKernData" keywords. It will save the
+ * track kerning data if requested by the caller of parseFile.
+ *
+ * parseAFM_TrackKernData is passed in a pointer to the FontInfo record.
+ * If data is to be saved, the FontInfo record will already contain
+ * a valid pointer to storage for the track kerning data.
+ *
+ * This function returns an error code specifying whether there was
+ * a premature EOF or a parsing error. This return value is used by
+ * parseFile to determine if there is more file to parse.
+ */
+
+static int parseAFM_TrackKernData(FILE *fp, register AFM_Font_info *fi)
+{
+ BOOL cont = TRUE, save = (fi->tkd != NULL);
+ int pos = 0, error = AFM_ok, tcount = 0;
+ register char *keyword;
+
+ while (cont)
+ {
+ keyword = token(fp);
+
+ if (keyword == NULL)
+ {
+ error = AFM_earlyEOF;
+ break; /* get out of loop */
+ }
+ if (!save)
+ /* get tokens until the end of the Track Kerning Data */
+ /* section without saving any of the data */
+ switch(recognize(keyword))
+ {
+ case ENDTRACKKERN:
+ case ENDKERNDATA:
+ cont = FALSE;
+ break;
+ case ENDFONTMETRICS:
+ cont = FALSE;
+ error = normalEOF;
+ break;
+ default:
+ break;
+ } /* switch */
+ else
+ /* otherwise parse entire Track Kerning Data section, */
+ /* saving the data */
+ switch(recognize(keyword))
+ {
+ case COMMENT:
+ keyword = linetoken(fp);
+ break;
+ case TRACKKERN:
+ if (tcount < fi->numOfTracks)
+ {
+ keyword = token(fp);
+ fi->tkd[pos].degree = atoi(keyword);
+ keyword = token(fp);
+ fi->tkd[pos].minPtSize = atof(keyword);
+ if (errno == ERANGE) error = AFM_parseError;
+ keyword = token(fp);
+ fi->tkd[pos].minKernAmt = atof(keyword);
+ if (errno == ERANGE) error = AFM_parseError;
+ keyword = token(fp);
+ fi->tkd[pos].maxPtSize = atof(keyword);
+ if (errno == ERANGE) error = AFM_parseError;
+ keyword = token(fp);
+ fi->tkd[pos++].maxKernAmt = atof(keyword);
+ if (errno == ERANGE) error = AFM_parseError;
+ tcount++;
+ }
+ else
+ {
+ error = AFM_parseError;
+ cont = FALSE;
+ }
+ break;
+ case ENDTRACKKERN:
+ case ENDKERNDATA:
+ cont = FALSE;
+ break;
+ case ENDFONTMETRICS:
+ cont = FALSE;
+ error = normalEOF;
+ break;
+ case NOPE:
+ default:
+ error = AFM_parseError;
+ break;
+ } /* switch */
+ } /* while */
+
+ if (error == AFM_ok && tcount != fi->numOfTracks)
+ error = AFM_parseError;
+
+ return(error);
+
+} /* parseAFM_TrackKernData */
+
+
+/************************* parseAFM_PairKernData ************************/
+
+/* This function is called by "parseFile". It will parse the AFM File
+ * up to the "EndKernPairs" or "EndKernData" keywords. It will save
+ * the pair kerning data if requested by the caller of parseFile.
+ *
+ * parseAFM_PairKernData is passed in a pointer to the FontInfo record.
+ * If data is to be saved, the FontInfo record will already contain
+ * a valid pointer to storage for the pair kerning data.
+ *
+ * This function returns an error code specifying whether there was
+ * a premature EOF or a parsing error. This return value is used by
+ * parseFile to determine if there is more file to parse.
+ */
+
+static int parseAFM_PairKernData(FILE *fp, register AFM_Font_info *fi)
+{
+ BOOL cont = TRUE, save = (fi->pkd != NULL);
+ int pos = 0, error = AFM_ok, pcount = 0;
+ register char *keyword;
+
+ while (cont)
+ {
+ keyword = token(fp);
+
+ if (keyword == NULL)
+ {
+ error = AFM_earlyEOF;
+ break; /* get out of loop */
+ }
+ if (!save)
+ /* get tokens until the end of the Pair Kerning Data */
+ /* section without saving any of the data */
+ switch(recognize(keyword))
+ {
+ case ENDKERNPAIRS:
+ case ENDKERNDATA:
+ cont = FALSE;
+ break;
+ case ENDFONTMETRICS:
+ cont = FALSE;
+ error = normalEOF;
+ break;
+ default:
+ break;
+ } /* switch */
+ else
+ /* otherwise parse entire Pair Kerning Data section, */
+ /* saving the data */
+ switch(recognize(keyword))
+ {
+ case COMMENT:
+ keyword = linetoken(fp);
+ break;
+ case KERNPAIR:
+ if (pcount < fi->numOfPairs)
+ {
+ keyword = token(fp);
+ fi->pkd[pos].name1 = (char *)
+ malloc(strlen(keyword) + 1);
+ strcpy(fi->pkd[pos].name1, keyword);
+ keyword = token(fp);
+ fi->pkd[pos].name2 = (char *)
+ malloc(strlen(keyword) + 1);
+ strcpy(fi->pkd[pos].name2, keyword);
+ keyword = token(fp);
+ fi->pkd[pos].xamt = atoi(keyword);
+ keyword = token(fp);
+ fi->pkd[pos++].yamt = atoi(keyword);
+ pcount++;
+ }
+ else
+ {
+ error = AFM_parseError;
+ cont = FALSE;
+ }
+ break;
+ case KERNPAIRXAMT:
+ if (pcount < fi->numOfPairs)
+ {
+ keyword = token(fp);
+ fi->pkd[pos].name1 = (char *)
+ malloc(strlen(keyword) + 1);
+ strcpy(fi->pkd[pos].name1, keyword);
+ keyword = token(fp);
+ fi->pkd[pos].name2 = (char *)
+ malloc(strlen(keyword) + 1);
+ strcpy(fi->pkd[pos].name2, keyword);
+ keyword = token(fp);
+ fi->pkd[pos++].xamt = atoi(keyword);
+ pcount++;
+ }
+ else
+ {
+ error = AFM_parseError;
+ cont = FALSE;
+ }
+ break;
+ case ENDKERNPAIRS:
+ case ENDKERNDATA:
+ cont = FALSE;
+ break;
+ case ENDFONTMETRICS:
+ cont = FALSE;
+ error = normalEOF;
+ break;
+ case NOPE:
+ default:
+ error = AFM_parseError;
+ break;
+ } /* switch */
+ } /* while */
+
+ if (error == AFM_ok && pcount != fi->numOfPairs)
+ error = AFM_parseError;
+
+ return(error);
+
+} /* parseAFM_PairKernData */
+
+
+/************************* parseAFM_CompCharData **************************/
+
+/* This function is called by "parseFile". It will parse the AFM File
+ * up to the "EndComposites" keyword. It will save the composite
+ * character data if requested by the caller of parseFile.
+ *
+ * parseAFM_CompCharData is passed in a pointer to the FontInfo record, and
+ * a boolean representing if the data should be saved.
+ *
+ * This function will create the appropriate amount of storage for
+ * the composite character data and store a pointer to the storage
+ * in the FontInfo record.
+ *
+ * This function returns an error code specifying whether there was
+ * a premature EOF or a parsing error. This return value is used by
+ * parseFile to determine if there is more file to parse.
+ */
+
+static int parseAFM_CompCharData(FILE *fp, register AFM_Font_info *fi)
+{
+ BOOL cont = TRUE, firstTime = TRUE, save = (fi->ccd != NULL);
+ int pos = 0, j = 0, error = AFM_ok, ccount = 0, pcount = 0;
+ register char *keyword;
+
+ while (cont)
+ {
+ keyword = token(fp);
+ if (keyword == NULL)
+ /* Have reached an early and unexpected EOF. */
+ /* Set flag and stop parsing */
+ {
+ error = AFM_earlyEOF;
+ break; /* get out of loop */
+ }
+ if (ccount > fi->numOfComps)
+ {
+ error = AFM_parseError;
+ break; /* get out of loop */
+ }
+ if (!save)
+ /* get tokens until the end of the Composite Character info */
+ /* section without saving any of the data */
+ switch(recognize(keyword))
+ {
+ case ENDCOMPOSITES:
+ cont = FALSE;
+ break;
+ case ENDFONTMETRICS:
+ cont = FALSE;
+ error = normalEOF;
+ break;
+ default:
+ break;
+ } /* switch */
+ else
+ /* otherwise parse entire Composite Character info section, */
+ /* saving the data */
+ switch(recognize(keyword))
+ {
+ case COMMENT:
+ keyword = linetoken(fp);
+ break;
+ case COMPCHAR:
+ if (ccount < fi->numOfComps)
+ {
+ keyword = token(fp);
+ if (pcount != fi->ccd[pos].numOfPieces)
+ error = AFM_parseError;
+ pcount = 0;
+ if (firstTime) firstTime = FALSE;
+ else pos++;
+ fi->ccd[pos].ccName = (char *)
+ malloc(strlen(keyword) + 1);
+ strcpy(fi->ccd[pos].ccName, keyword);
+ keyword = token(fp);
+ fi->ccd[pos].numOfPieces = atoi(keyword);
+ fi->ccd[pos].pieces = (AFM_Pcc *)
+ calloc(fi->ccd[pos].numOfPieces, sizeof(AFM_Pcc));
+ j = 0;
+ ccount++;
+ }
+ else
+ {
+ error = AFM_parseError;
+ cont = FALSE;
+ }
+ break;
+ case COMPCHARPIECE:
+ if (pcount < fi->ccd[pos].numOfPieces)
+ {
+ keyword = token(fp);
+ fi->ccd[pos].pieces[j].AFM_PccName = (char *)
+ malloc(strlen(keyword) + 1);
+ strcpy(fi->ccd[pos].pieces[j].AFM_PccName, keyword);
+ keyword = token(fp);
+ fi->ccd[pos].pieces[j].deltax = atoi(keyword);
+ keyword = token(fp);
+ fi->ccd[pos].pieces[j++].deltay = atoi(keyword);
+ pcount++;
+ }
+ else
+ error = AFM_parseError;
+ break;
+ case ENDCOMPOSITES:
+ cont = FALSE;
+ break;
+ case ENDFONTMETRICS:
+ cont = FALSE;
+ error = normalEOF;
+ break;
+ case NOPE:
+ default:
+ error = AFM_parseError;
+ break;
+ } /* switch */
+ } /* while */
+
+ if (error == AFM_ok && ccount != fi->numOfComps)
+ error = AFM_parseError;
+
+ return(error);
+
+} /* parseAFM_CompCharData */
+
+
+
+
+/*************************** 'PUBLIC' FUNCTION ********************/
+
+
+/*************************** parseFile *****************************/
+
+/* parseFile is the only 'public' procedure available. It is called
+ * from an application wishing to get information from an AFM file.
+ * The caller of this function is responsible for locating and opening
+ * an AFM file and handling all errors associated with that task.
+ *
+ * parseFile expects 3 parameters: a vaild file pointer, a pointer
+ * to a (FontInfo *) variable (for which storage will be allocated and
+ * the data requested filled in), and a mask specifying which
+ * data from the AFM File should be saved in the FontInfo structure.
+ *
+ * The file will be parsed and the requested data will be stored in
+ * a record of type FontInfo (refer to ParseAFM.h).
+ *
+ * parseFile returns an error code as defined in parseAFM.h.
+ *
+ * The position of the read/write pointer associated with the file
+ * pointer upon return of this function is undefined.
+ */
+
+extern int parseFile (FILE *fp, AFM_Font_info **fi, int flags)
+{
+
+ int code = AFM_ok; /* return code from each of the parsing routines */
+ int error = AFM_ok; /* used as the return code from this function */
+
+ register char *keyword; /* used to store a token */
+
+
+ /* storage data for the global variable ident */
+ if (!ident)
+ ident = (char *) calloc(MAX_NAME, sizeof(char));
+ if (ident == NULL) {error = AFM_storageProblem; return(error);}
+
+ (*fi) = (AFM_Font_info *) calloc(1, sizeof(AFM_Font_info));
+ if ((*fi) == NULL) {error = AFM_storageProblem; return(error);}
+
+ if (flags & P_G)
+ {
+ (*fi)->gfi = (AFM_GlobalFontInfo *) calloc(1, sizeof(AFM_GlobalFontInfo));
+ if ((*fi)->gfi == NULL) {error = AFM_storageProblem; return(error);}
+ }
+
+ /* The AFM File begins with Global Font Information. This section */
+ /* will be parsed whether or not information should be saved. */
+ code = parseGlobals(fp, (*fi)->gfi);
+
+ if (code < 0) error = code;
+
+ /* The Global Font Information is followed by the Character Metrics */
+ /* section. Which procedure is used to parse this section depends on */
+ /* how much information should be saved. If all of the metrics info */
+ /* is wanted, parseCharMetrics is called. If only the character widths */
+ /* is wanted, parseCharWidths is called. parseCharWidths will also */
+ /* be called in the case that no character data is to be saved, just */
+ /* to parse through the section. */
+
+ if ((code != normalEOF) && (code != AFM_earlyEOF))
+ {
+ (*fi)->numOfChars = atoi(token(fp));
+ if (flags & (P_M ^ P_W))
+ {
+ (*fi)->cmi = (AFM_CharMetricInfo *)
+ calloc((*fi)->numOfChars, sizeof(AFM_CharMetricInfo));
+ if ((*fi)->cmi == NULL) {error = AFM_storageProblem; return(error);}
+ code = parseCharMetrics(fp, *fi);
+ }
+ else
+ {
+ if (flags & P_W)
+ {
+ (*fi)->cwi = (int *) calloc(256, sizeof(int));
+ if ((*fi)->cwi == NULL)
+ {
+ error = AFM_storageProblem;
+ return(error);
+ }
+ }
+ /* parse section regardless */
+ code = parseCharWidths(fp, (*fi)->cwi);
+ } /* else */
+ } /* if */
+
+ if ((error != AFM_earlyEOF) && (code < 0)) error = code;
+
+ /* The remaining sections of the AFM are optional. This code will */
+ /* look at the next keyword in the file to determine what section */
+ /* is next, and then allocate the appropriate amount of storage */
+ /* for the data (if the data is to be saved) and call the */
+ /* appropriate parsing routine to parse the section. */
+
+ while ((code != normalEOF) && (code != AFM_earlyEOF))
+ {
+ keyword = token(fp);
+ if (keyword == NULL)
+ /* Have reached an early and unexpected EOF. */
+ /* Set flag and stop parsing */
+ {
+ code = AFM_earlyEOF;
+ break; /* get out of loop */
+ }
+ switch(recognize(keyword))
+ {
+ case STARTKERNDATA:
+ break;
+ case ENDKERNDATA:
+ break;
+ case STARTTRACKKERN:
+ keyword = token(fp);
+ if (flags & P_T)
+ {
+ (*fi)->numOfTracks = atoi(keyword);
+ (*fi)->tkd = (AFM_TrackKernData *)
+ calloc((*fi)->numOfTracks, sizeof(AFM_TrackKernData));
+ if ((*fi)->tkd == NULL)
+ {
+ error = AFM_storageProblem;
+ return(error);
+ }
+ } /* if */
+ code = parseAFM_TrackKernData(fp, *fi);
+ break;
+ case STARTKERNPAIRS:
+ keyword = token(fp);
+ if (flags & P_P)
+ {
+ (*fi)->numOfPairs = atoi(keyword);
+ (*fi)->pkd = (AFM_PairKernData *)
+ calloc((*fi)->numOfPairs, sizeof(AFM_PairKernData));
+ if ((*fi)->pkd == NULL)
+ {
+ error = AFM_storageProblem;
+ return(error);
+ }
+ } /* if */
+ code = parseAFM_PairKernData(fp, *fi);
+ break;
+ case STARTCOMPOSITES:
+ keyword = token(fp);
+ if (flags & P_C)
+ {
+ (*fi)->numOfComps = atoi(keyword);
+ (*fi)->ccd = (AFM_CompCharData *)
+ calloc((*fi)->numOfComps, sizeof(AFM_CompCharData));
+ if ((*fi)->ccd == NULL)
+ {
+ error = AFM_storageProblem;
+ return(error);
+ }
+ } /* if */
+ code = parseAFM_CompCharData(fp, *fi);
+ break;
+ case ENDFONTMETRICS:
+ code = normalEOF;
+ break;
+ case NOPE:
+ default:
+ code = AFM_parseError;
+ break;
+ } /* switch */
+
+ if ((error != AFM_earlyEOF) && (code < 0)) error = code;
+
+ } /* while */
+
+ if ((error != AFM_earlyEOF) && (code < 0)) error = code;
+
+ if (ident != NULL) { free(ident); ident = NULL; }
+
+ return(error);
+
+} /* parseFile */
+
+
+void
+parseFileFree (AFM_Font_info *fi)
+{
+ if (fi->gfi) {
+ free (fi->gfi->afmVersion);
+ free (fi->gfi->fontName);
+ free (fi->gfi->fullName);
+ free (fi->gfi->familyName);
+ free (fi->gfi->weight);
+ free (fi->gfi->version);
+ free (fi->gfi->notice);
+ free (fi->gfi->encodingScheme);
+ free (fi->gfi);
+ }
+
+ /* This contains just scalars. */
+ free (fi->cwi);
+
+ if (fi->cmi) {
+ int i;
+ for (i = 0; i < fi->numOfChars; i++) {
+ free (fi->cmi[i].name);
+ while (fi->cmi[i].ligs) {
+ Ligature *tmp;
+ tmp = fi->cmi[i].ligs;
+ free (tmp->succ);
+ free (tmp->lig);
+ free (tmp);
+ fi->cmi[i].ligs = fi->cmi[i].ligs->next;
+ }
+ }
+ free (fi->cmi);
+ }
+
+ /* This contains just scalars. */
+ free (fi->tkd);
+
+ if (fi->pkd) {
+ int i;
+ for (i = 0; i < fi->numOfPairs; i++) {
+ free (fi->pkd[i].name1);
+ free (fi->pkd[i].name2);
+ }
+ free (fi->pkd);
+ }
+
+ if (fi->ccd) {
+ int i, j;
+ for (i = 0; i < fi->numOfComps; i++) {
+ free (fi->ccd[i].ccName);
+ for (j = 0; j < fi->ccd[i].numOfPieces; j++) {
+ free (fi->ccd[i].pieces[j].AFM_PccName);
+ }
+ free (fi->ccd[i].pieces);
+ }
+ free (fi->ccd);
+ }
+
+ free (fi);
+}
/*
poly.cc -- routines for manipulation of polynomials in one var
- (c) 1993--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1993--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include <math.h>
source file of the Flower Library
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include <math.h>
#include <stdlib.h>
source file of the Flower Library
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include <assert.h>
string.cc - implement String
- (c) 1997--1999 Han-Wen Nienhuys & Jan Nieuwenhuizen
+ (c) 1997--2000 Han-Wen Nienhuys & Jan Nieuwenhuizen
*/
source file of the LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl> */
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl> */
#ifdef STRING_DEBUG
#define memmove mymemmove
\score {\notes \context Voice = VA \relative c'' {
- \grace b8 c4
+ \grace b8 c4-\fermata
\grace { [c32 cis32] } gis4
\grace { [cis32 dis32] } e4
\grace { [c32 d] }\times 2/3 { [c8 c c] }
--- /dev/null
+
+\times 2/3 { c''8 c c }
+\times 2/3 { c8 c'' c,, }
source file of the LilyPond music typesetter
- (c) 1997--1999 Jan Nieuwenhuizen
+ (c) 1997--2000 Jan Nieuwenhuizen
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#ifndef PROTO_HH
#define PROTO_HH
-#include "fproto.hh"
+#include "flower-proto.hh"
#include "real.hh"
struct Duration;
struct Duration_iterator;
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
source file of the LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include <iostream.h>
#include "proto.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>.
Nextstep fixes by tiggr@ics.ele.tue.nl
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include <stdio.h>
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
& Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "align-element.hh"
progress_indication ("[" + path);
Adobe_font_metric * afm_p = read_afm_file (path);
- afm_p->name_str_ = name;
+ afm_p->name_ = ly_symbol2scm (name.ch_C ());
progress_indication ("]");
afm_p_dict_[sname] = afm_p->self_scm_;
return 0;
progress_indication ("[" + path);
Tex_font_metric * tfm_p = Tex_font_metric_reader::read_file (path);
- tfm_p->name_str_ = name;
+ tfm_p->name_ = ly_symbol2scm (name.ch_C( ));
progress_indication ("]");
tfm_p_dict_[sname] = tfm_p->self_scm_;
return list;
}
-Font_metric *
-unsmob_metrics( SCM s)
-{
- if (SMOB_IS_TYPE_B(Font_metric, s))
- return SMOB_TO_TYPE(Font_metric, s);
- else
- return 0;
-}
+
#include "ly-smobs.icc"
IMPLEMENT_SMOBS(Font_metric);
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "atom.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "audio-column.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "audio-element.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "audio-element-info.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "debug.hh"
#include "audio-item.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "audio-staff.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "axis-group-element.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "dimension-cache.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "dimension-cache.hh"
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "timing-engraver.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
*/
* move paper vars to scm
*/
+
+
#include <math.h> // tanh.
#include "directional-element-interface.hh"
#include "beam.hh"
#include "misc.hh"
#include "debug.hh"
-#include "leastsquares.hh"
+#include "least-squares.hh"
#include "stem.hh"
#include "paper-def.hh"
#include "lookup.hh"
set_stem_length (y, dy);
}
- set_elt_property ("y-position", gh_double2scm (y));
+ // UGH. Y is not in staff position unit?
+ set_elt_property ("y-position", gh_double2scm (y));
}
}
return;
}
- Least_squares ls;
+ Array<Offset> ideals;
Real x0 = first_visible_stem ()->hpos_f ();
for (int i=0; i < stem_count (); i++)
{
Stem* s = stem (i);
if (s->invisible_b ())
continue;
- ls.input.push (Offset (s->hpos_f () - x0,
- s->calc_stem_info ().idealy_f_));
+ ideals.push (Offset (s->hpos_f () - x0,
+ s->calc_stem_info ().idealy_f_));
}
Real dydx;
- ls.minimise (dydx, *y); // duh, takes references
+ minimise_least_squares (&dydx, y, ideals); // duh, takes references
Real dx = last_visible_stem ()->hpos_f () - x0;
*dy = dydx * dx;
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include <math.h>
{
flipy (encompass_);
}
+
+ while (encompass_.size () > 1 && encompass_[1][X_AXIS] <= 0.0)
+ {
+ programming_error ("Degenerate slur: infinite steepness reqd");
+ encompass_.del (1);
+ }
+
+ Real l = encompass_.top ()[X_AXIS];
+ while (encompass_.size () > 1 && encompass_.top (1)[X_AXIS] >= l)
+ {
+ programming_error ("Degenerate slur: infinite steepness reqd");
+ encompass_.del (encompass_.size ()-2);
+ }
}
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include <math.h>
source file of the GNU LilyPond music typesetter
- (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1996, 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "box.hh"
source file of the GNU LilyPond music typesetter
- (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1996, 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "paper-column.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "dimension-cache.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "change-iterator.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "change-translator.hh"
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "chord-name-engraver.hh"
{
name.inversion_mol = lookup_l ()->text ("", "/", paper_l ());
Musical_pitch p;
- scm_to (s, &p);
+ p = scm_to (s, &p);
Molecule mol = pitch2molecule (p);
name.inversion_mol.add_at_edge (X_AXIS, RIGHT, mol, 0);
}
{
name.bass_mol = lookup_l ()->text ("", "/", paper_l ());
Musical_pitch p;
- scm_to (s, &p);
+ p = scm_to (s, &p);
Molecule mol = pitch2molecule (p);
name.bass_mol.add_at_edge (X_AXIS, RIGHT, mol, 0);
}
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>,
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>,
Mats Bengtsson <matsb@s3.kth.se>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include <ctype.h>
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "note-column.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "debug.hh"
#include "collision.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "column-x-positions.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "command-request.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "molecule.hh"
if (!isdir_b (dir) || !gh_pair_p (dyns))
{
- set_elt_property ("transparent", SCM_BOOL_T);
+Crescendo * me = (Crescendo*)this;
+ me->set_elt_property ("transparent", SCM_BOOL_T);
return new Molecule;
}
#include <fstream.h>
#include <signal.h>
-
-// libg++ 2.8.0
-// #include <std/new.h>
#include <stdlib.h>
-
#include "debug.hh"
#include "dstream.hh"
#include "flower-debug.hh"
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "dimension-cache.hh"
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "dots.hh"
for (int i=0; i <dots.size (); pos += 2, i++)
{
- staff_symbol_referencer_interface (dots[i]).set_position(pos);
+ staff_symbol_referencer (dots[i]).set_position(pos);
}
}
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "dots.hh"
source file of the LilyPond music typesetter
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "debug.hh"
#include "crescendo.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "proto.hh"
Sourcefile of GNU LilyPond musictypesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "music-list.hh"
#include <math.h>
#include <ctype.h>
-
#include "font-metric.hh"
Box
Font_metric::Font_metric ()
{
self_scm_ = SCM_EOL;
+ name_ = SCM_EOL;
smobify_self ();
}
SCM
Font_metric::description () const
{
- return gh_cons (ly_symbol2scm (name_str_.ch_C()), gh_int2scm (0));
+ return gh_cons (name_, gh_int2scm (0));
}
SCM
Font_metric::mark_smob (SCM s)
{
- return SCM_EOL;
+ Font_metric * m = SMOB_TO_TYPE(Font_metric, s);
+ return m->name_;
}
int
Font_metric::print_smob (SCM s, SCM port, scm_print_state * )
{
- scm_puts ("#<Font_metric>", port);
-
+ Font_metric *m = unsmob_metrics (s);
+ scm_puts ("#<Font_metric ", port);
+ scm_display (m->name_, port);
+ scm_puts (">", port);
return 1;
}
-
-
-
+Font_metric *
+unsmob_metrics( SCM s)
+{
+ if (SMOB_IS_TYPE_B(Font_metric, s))
+ return SMOB_TO_TYPE(Font_metric, s);
+ else
+ return 0;
+}
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "global-translator.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include <math.h> // rint
source file of the GNU LilyPond music typesetter
- (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1996, 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "idealspacing.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include <assert.h>
+
#include "midi-def.hh"
#include "paper-def.hh"
#include "score.hh"
#include "translator-group.hh"
#include "notename-table.hh"
-
-
Identifier::Identifier (int code)
{
token_code_i_ = code;
init_b_ = 0;
}
-
-
Identifier::Identifier (Identifier const&s)
: Input (s)
{
source file of the LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include <strstream.h>
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
--- /dev/null
+/*
+ afm.hh -- declare Adobe_font_metric
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#ifndef AFM_HH
+#define AFM_HH
+
+#include "string.hh"
+#include "box.hh"
+#include "array.hh"
+#include "dictionary.hh"
+#include "font-metric.hh"
+
+struct Adobe_font_char_metric : Character_metric {
+ char_metric_info_;
+ Adobe_font_char_metric (AFM_CharMetricInfo afm_inf);
+ virtual Box dimensions () const;
+};
+
+struct Adobe_font_metric : Font_metric {
+ AFM_Font_info * font_inf_;
+ Array<int> ascii_to_metric_idx_;
+ Dictionary<int> name_to_metric_dict_;
+
+ Character_metric const *get_char (int, bool) const;
+ Adobe_font_char_metric const &find_char (String name, bool warn=true) const;
+ Adobe_font_char_metric const &find_ascii (int ascii,bool warn) const;
+ String str () const;
+ Adobe_font_metric (AFM_Font_info*);
+
+};
+
+Adobe_font_metric *read_afm_file (String fn);
+
+
+
+#endif /* AFM_HH */
+
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
SCM font_descriptions () const;
};
-Font_metric * unsmob_metrics (SCM s);
-
-
#endif /* ALL_FONTS_HH */
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#ifndef ATOM_HH
/*
audio-column.hh -- declare Audio_column
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#ifndef AUDIO_COLUMN_HH
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#ifndef AUDIO_ELEMENT_HH
#define AUDIO_ELEMENT_HH
+ #include <typeinfo>
#include "virtual-methods.hh"
class Audio_element
/*
audio-item.hh -- declare Audio_items
- (c) 1996, 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1996, 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#ifndef AUDIO_ITEM_HH
#define AUDIO_ITEM_HH
+ #include <typeinfo>
#include "lily-proto.hh"
#include "string.hh"
#include "audio-element.hh"
/*
audio-staff.hh -- declare Audio_staff
- (c) 1996, 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1996, 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#ifndef AUDIO_STAFF_HH
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
/*
bar.hh -- part of GNU LilyPond
- (c) 1996--1999 Han-Wen Nienhuys
+ (c) 1996--2000 Han-Wen Nienhuys
*/
#ifndef BAR_HH
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
/*
beam.hh -- part of GNU LilyPond
- (c) 1996--1999 Han-Wen Nienhuys
+ (c) 1996--2000 Han-Wen Nienhuys
*/
#ifndef BEAM_HH
/*
bezier.hh -- declare Bezier and Bezier_bow
- (c) 1998--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#ifndef BEZIER_HH
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
*/
class Bow : public Spanner
{
-public:
- Bow ();
- Offset center () const;
-
protected:
- virtual Molecule* do_brew_molecule_p () const;
-
- virtual Array<Offset> get_encompass_offset_arr () const;
-
- Interval curve_extent (Axis) const;
- Bezier get_curve () const;
-
- Drul_array<Real> dy_f_drul_;
- Drul_array<Real> dx_f_drul_;
};
+#error
#endif // BOW_HH
#ifndef BOXES_HH
#define BOXES_HH
-#include "fproto.hh"
+#include "flower-proto.hh"
#include "real.hh"
#include "interval.hh"
#include "offset.hh"
source file of the GNU LilyPond music typesetter
- (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1996, 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#ifndef CHORD_NAME_ENGRAVER_HH
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
*/
/*
clef-item.hh -- declare Clef_item
- (c) 1996--1999 Han-Wen Nienhuys
+ (c) 1996--2000 Han-Wen Nienhuys
*/
#ifndef CLEFITEM_HH
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
/*
column-x-positions.hh -- part of GNU LilyPond
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#ifndef COLUMN_X_POSITIONS_HH
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the LilyPond music typesetter
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#ifndef DURATION_HH
#define DURATION_HH
-#include "fproto.hh"
+#include "flower-proto.hh"
#include "rational.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1996, 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#ifndef FILE_RESULTS_HH
#define FILE_RESULTS_HH
-#include "fproto.hh"
+#include "flower-proto.hh"
void do_one_file (String init_str, String file_str);
extern Scope *header_global_p;
virtual ~Character_metric ();
};
+
+
struct Font_metric
{
Font_metric ();
- String name_str_;
+ SCM name_;
virtual SCM description () const;
virtual Character_metric const *get_char (int ascii, bool warn) const;
virtual ~Font_metric ();
virtual Box text_dimension (String) const;
};
+Font_metric * unsmob_metrics (SCM s);
+
#endif /* FONT_METRIC_HH */
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
/*
idealspacing.hh -- part of GNU LilyPond
- (c) 1996--1999 Han-Wen Nienhuys
+ (c) 1996--2000 Han-Wen Nienhuys
*/
#ifndef IDEALSPACING_HH
/*
identifier.hh -- part of GNU LilyPond
- (c) 1996--1999 Han-Wen Nienhuys
+ (c) 1996--2000 Han-Wen Nienhuys
*/
#ifndef IDENTIFIER_HH
class Translator_group_identifier;
class Music_identifier;
class Articulation_req_identifier;
-class Symtables_identifier;
class Midi_def_identifier;
class Paper_def_identifier;
class Real_identifier;
/**
- A declarable data structure in mudela.
+ A declarable data structure in mudela.
+
+ TODO: use SCM and SMOBS for union datatype.
*/
struct Identifier : public Input {
bool init_b_;
IDACCESSOR(Translator_group)
IDACCESSOR(Notename_table)
IDACCESSOR(Music)
- IDACCESSOR(Symtables)
IDACCESSOR(Midi_def)
IDACCESSOR(Paper_def)
IDACCESSOR(Real)
DECLARE_ID_CLASS(Real);
DECLARE_ID_CLASS(String);
DECLARE_ID_CLASS(General_script_def);
-DECLARE_ID_CLASS(Symtables);
DECLARE_ID_CLASS(Music);
DECLARE_ID_CLASS(int);
DECLARE_ID_CLASS(Score);
source file of the LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "string.hh"
#include "parray.hh"
-#include "fproto.hh"
+#include "flower-proto.hh"
#include "proto.hh"
// GIGA urg!
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#ifndef ITEM_HH
#define ITEM_HH
/// I am really to be broken?
bool breakable_b () const;
bool broken_b () const;
- bool broken_original_b () const;
Direction break_status_dir () const;
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
/*
key-item.hh -- part of GNU LilyPond
- (c) 1996--1999 Han-Wen Nienhuys
+ (c) 1996--2000 Han-Wen Nienhuys
*/
#ifndef KEYITEM_HH
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#ifndef KEY_PERFOMER_HH
/*
key.hh -- declare Key, Octave_key
- (c) 1996--1999 Han-Wen Nienhuys
+ (c) 1996--2000 Han-Wen Nienhuys
*/
#ifndef KEY_HH
/*
keyword.hh -- part of GNU LilyPond
- (c) 1996--1999 Han-Wen Nienhuys
+ (c) 1996--2000 Han-Wen Nienhuys
*/
#ifndef KEYWORD_HH
--- /dev/null
+/*
+ leastsquare.hh -- part of GNU LilyPond
+
+ (c) 1996--2000 Han-Wen Nienhuys
+*/
+
+#ifndef LEASTSQUARE_HH
+#define LEASTSQUARE_HH
+#include "array.hh"
+#include "offset.hh"
+
+
+/**
+ Least squares minimisation in 2 variables.
+ */
+void minimise_least_squares (Real * coef, Real * offset, Array<Offset>);
+
+#endif // LEASTSQUARE_HH
+
-/*
- leastsquare.hh -- part of GNU LilyPond
-
- (c) 1996--1999 Han-Wen Nienhuys
-*/
-
-#ifndef LEASTSQUARE_HH
-#define LEASTSQUARE_HH
-#include "array.hh"
-#include "offset.hh"
-
-
-/**
- Least squares minimisation in 2 variables.
- */
-struct Least_squares {
- Array<Offset> input;
- void minimise (Real &coef, Real &offset);
- void OK() const;
-};
-
-
-#endif // LEASTSQUARE_HH
+#error
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#ifndef LILY_GUILE_HH
SCM ly_eval_str (String s);
SCM ly_symbol2scm (char const *);
String ly_symbol2string (SCM);
-SCM ly_set_x (String name , SCM val);
-SCM ly_append (SCM a, SCM b);
+SCM ly_offset2scm (Offset o);
+
SCM ly_eval (SCM a);
-SCM ly_func_o (char const* name);
SCM ly_parse_scm (char const* s, int* n);
SCM ly_quote_scm (SCM s);
void ly_display_scm (SCM s);
String ly_scm2string (SCM s);
-SCM array_to_list (SCM *a , int l);
-
#include "array.hh"
//URG how templates suck!
SCM to_scm (int i);
-void scm_to (SCM s, int* i);
+int scm_to (SCM s, int* i);
SCM to_scm (Real r);
-void scm_to (SCM s, Real* r);
+Real scm_to (SCM s, Real* r);
/*
snarfing.
Array<T> scm_to_array (SCM s)
check scm?
+
+ UGH. junkme.
*/
template<class T>void
scm_to_array (SCM s, Array<T>* arr)
arr->clear ();
for (; gh_pair_p (s); s= gh_cdr (s))
{
- T t;
- scm_to (gh_car (s), &t);
+ T t = scm_to (gh_car (s), (T*) 0);
arr->push (t);
}
}
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#ifndef LILY_PROTO_HH
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
/*
line-of-score.hh -- part of GNU LilyPond
- (c) 1996--1999 Han-Wen Nienhuys
+ (c) 1996--2000 Han-Wen Nienhuys
*/
#ifndef SCORELINE_HH
/*
local-key-engraver.hh -- declare Local_key_engraver
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
/*
local-key-item.hh -- part of GNU LilyPond
- (c) 1996--1999 Han-Wen Nienhuys
+ (c) 1996--2000 Han-Wen Nienhuys
*/
#ifndef LOCALKEYITEM_HH
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "lily-guile.hh"
#include "molecule.hh"
-#include "fproto.hh"
+#include "flower-proto.hh"
#include "direction.hh"
#include "box.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#ifndef MAIN_HH
#define MAIN_HH
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
/*
midi-item.hh -- declare Midi items
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#ifndef MIDI_ITEM_HH
/*
midi-stream.hh -- declare Midi_stream
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#ifndef MIDI_STREAM_HH
/*
midi-walker.hh -- declare Midi_walker
- (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1996, 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#ifndef MOLECULE_HH
#define MOLECULE_HH
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#ifndef MULTI_MEASURE_REST_ENGRAVER_HH
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
};
SCM to_scm (Musical_pitch p);
-void scm_to (SCM s, Musical_pitch* p);
+Musical_pitch scm_to (SCM s, Musical_pitch* p);
#include "compare.hh"
INSTANTIATE_COMPARE(Musical_pitch, Musical_pitch::compare);
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#ifndef LEXER_HH
#include "dictionary.hh"
#include "lily-proto.hh"
-#include "lily-proto.hh"
-#include "fproto.hh"
+#include "flower-proto.hh"
#include "array.hh"
#include "string.hh"
#include "includable-lexer.hh"
Input here_input () const;
void start_main_input ();
- bool notename_b (String) const;
- bool chordmodifier_b (String) const;
void set_chordmodifier_table (Notename_table*tab_p);
void set_notename_table (Notename_table*tab_p);
Identifier*lookup_identifier (String s);
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
/*
note-head.hh -- part of GNU LilyPond
- (c) 1996--1999 Han-Wen Nienhuys
+ (c) 1996--2000 Han-Wen Nienhuys
*/
#ifndef NOTEHEAD_HH
/*
head-engraver.hh -- part of GNU LilyPond
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
/*
note-performer.hh -- declare Note_performer
- (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1996, 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1996, 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1996, 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
/*
performance.hh -- declare Performance
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#ifndef PERFORMANCE_HH
/*
performer-group-performer.hh -- declare Performer_group_performer
- (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1996, 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
*/
/*
performer.hh -- declare Performer
- (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1996, 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#ifndef REPEAT_ENGRAVER_HH
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#ifndef REQUEST_HH
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
/*
score-performer.hh -- declare Score_performer
- (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1996, 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
/*
script-engraver.hh -- part of GNU LilyPond
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#ifndef SEQUENTIAL_MUSIC_ITERATOR_HH
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
/*
slur-engraver.hh -- declare Slur_engraver
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
/*
slur.hh -- declare Slur
- (c) 1996--1999 Han-Wen Nienhuys
+ (c) 1996--2000 Han-Wen Nienhuys
*/
#ifndef SLUR_HH
#define SLUR_HH
-#include "bow.hh"
+#include "spanner.hh"
#include "rod.hh"
/**
A #Bow# which tries to drape itself around the stems too.
*/
-class Slur : public Bow
+class Slur : public Spanner
{
int cross_staff_count () const;
Offset encompass_offset (Note_column const* )const;
void add_column (Note_column*);
+
protected:
+ virtual Molecule* do_brew_molecule_p () const;
virtual Array<Offset> get_encompass_offset_arr () const;
+ Bezier get_curve () const;
+ Drul_array<Real> dy_f_drul_;
+ Drul_array<Real> dx_f_drul_;
virtual Direction get_default_dir () const;
virtual void do_post_processing ();
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
/*
spanner.hh -- part of GNU LilyPond
- (c) 1996--1999 Han-Wen Nienhuys
+ (c) 1996--2000 Han-Wen Nienhuys
*/
#ifndef SPANNER_HH
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
/*
staff-performer.hh -- declare Staff_performer
- (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1996, 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
*/
int compare_position (Score_element *const&,Score_element *const&);
-Staff_symbol_referencer_interface staff_symbol_referencer_interface (Score_element const*);
+Staff_symbol_referencer_interface staff_symbol_referencer (Score_element const*);
#endif /* STAFF_SYMBOL_REFERENCER_HH */
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
/*
stem.hh -- declare Stem
- (c) 1996--1999 Han-Wen Nienhuys
+ (c) 1996--2000 Han-Wen Nienhuys
*/
#ifndef STEM_HH
source file of the LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#ifndef TEMPO_PERFORMER_HH
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#ifndef TIE_HH
#define TIE_HH
-#include "bow.hh"
+#include "spanner.hh"
#include "rod.hh"
/**
Connect two noteheads.
*/
-class Tie : public Bow
+class Tie : public Spanner
{
public:
Tie ();
VIRTUAL_COPY_CONS(Score_element);
Note_head* head (Direction) const;
+
protected:
+ virtual Molecule* do_brew_molecule_p () const;
+ virtual Array<Offset> get_encompass_offset_arr () const;
+ Bezier get_curve () const;
+
+ Drul_array<Real> dy_f_drul_;
+ Drul_array<Real> dx_f_drul_;
+
virtual void do_add_processing ();
virtual void do_post_processing ();
virtual Direction get_default_dir() const;
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#ifndef TIME_SIGNATURE_PERFORMER_HH
/*
time_signature.hh -- declare Time_signature
- (c) 1996--1999 Han-Wen Nienhuys
+ (c) 1996--2000 Han-Wen Nienhuys
*/
#ifndef METER_HH
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#ifndef TRANSLATOR_HH
#define TRANSLATOR_HH
+ #include <typeinfo>
#include "global-ctor.hh"
#include "string.hh"
#include "lily-proto.hh"
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
/*
plet-spanner.hh -- part of GNU LilyPond
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#ifndef Tuplet_spanner_HH
void add_column (Note_column*);
void add_beam (Beam*);
protected:
+ void calc_position_and_height (Real*,Real*)const;
+
virtual Molecule* do_brew_molecule_p () const;
VIRTUAL_COPY_CONS(Score_element);
virtual void do_add_processing ();
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
/*
volta-spanner.hh -- part of GNU LilyPond
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#ifndef VOLTA_SPANNER_HH
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "dimension-cache.hh"
-bool
-Item::broken_original_b () const
-{
- return broken_to_drul_[LEFT] || broken_to_drul_[RIGHT];
-}
#if 0
int
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
// clean me up
#include "key-engraver.hh"
source file of the GNU LilyPond music typesetter
- (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1996, 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
keyplacement by Mats Bengtsson
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "key-performer.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
--- /dev/null
+/*
+ least-squares.cc -- implement minimise_least_squares
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1996--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#include "least-squares.hh"
+#include "warn.hh"
+
+
+void
+minimise_least_squares (Real * coef, Real * offset,
+ Array<Offset> input)
+{
+ Real sx = 0.0;
+ Real sy = 0.0;
+ Real sqx =0.0;
+ Real sxy = 0.0;
+
+ for (int i=0; i < input.size();i++)
+ {
+ Real x=input[i][X_AXIS];
+ Real y = input[i][Y_AXIS];
+ sx += x;
+ sy += y;
+ sqx += sqr (x);
+ sxy += x*y;
+ }
+ int N = input.size();
+
+ *coef =0.0;
+ *offset =0.;
+
+ Real den = (N*sqx - sqr (sx));
+ if (!N || !den)
+ programming_error ("minimise_least_squares(): Nothing to minimise");
+
+ *coef = (N * sxy - sx*sy)/den;
+ *offset = (sy - (*coef) * sx)/N;
+}
#include <stdio.h>
#include <ctype.h>
+#include "notename-table.hh"
#include "lily-guile.hh"
#include "string.hh"
#include "string-convert.hh"
int
My_lily_lexer::scan_escaped_word (String str)
{
- DEBUG_OUT << "\\word: `" << str<<"'\n";
int l = lookup_keyword (str);
if (l != -1) {
- DEBUG_OUT << "(keyword)\n";
return l;
}
Identifier * id = lookup_identifier (str);
if (id) {
- DEBUG_OUT << "(identifier)\n";
yylval.id = id;
return id->token_code_i_;
}
if ((YYSTATE != notes) && (YYSTATE != chords)) {
- if (notename_b (str)) {
+ if (note_tab_p_->elem_b (str))
+ {
yylval.pitch = new Musical_pitch (lookup_notename (str));
yylval.pitch->set_spot (Input (source_file_l (),
here_ch_C ()));
print_declarations (true);
String msg (_f ("unknown escaped string: `\\%s'", str));
LexerError (msg.ch_C ());
- DEBUG_OUT << "(string)";
+
yylval.scm = ly_str02scm(str.ch_C());
return STRING;
int
My_lily_lexer::scan_bare_word (String str)
{
- DEBUG_OUT << "word: `" << str<< "'\n";
if ((YYSTATE == notes) || (YYSTATE == chords)) {
- if (notename_b (str)) {
- DEBUG_OUT << "(notename)\n";
+ if (note_tab_p_->elem_b (str)) {
yylval.pitch = new Musical_pitch (lookup_notename (str));
yylval.pitch->set_spot (Input (source_file_l (),
here_ch_C ()));
return (YYSTATE == notes) ? NOTENAME_PITCH : TONICNAME_PITCH;
- } else if (chordmodifier_b (str)) {
- DEBUG_OUT << "(chordmodifier)\n";
+ } else if (chordmodifier_tab_p_->elem_b (str))
+ {
yylval.pitch = new Musical_pitch (lookup_chordmodifier (str));
yylval.pitch->set_spot (Input (source_file_l (),
here_ch_C ()));
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "file-path.hh"
#include "debug.hh"
#include "direction.hh"
+#include "offset.hh"
SCM
ly_str02scm (char const*c)
return gh_int2scm (i);
}
-void
-scm_to (SCM s, int* i)
+/*
+ UGR. junkme.
+ */
+int
+scm_to (SCM s, int* )
{
- // urg
- *i = gh_number_p (s) ? gh_scm2int (s) : 0;
+ return gh_number_p (s) ? gh_scm2int (s) : 0;
}
SCM
return gh_double2scm (r);
}
-void
-scm_to (SCM s, Real* r)
+Real
+scm_to (SCM s, Real* )
{
- // urg
- *r = gh_number_p (s) ? gh_scm2double (s) : 0;
+ return gh_number_p (s) ? gh_scm2double (s) : 0;
}
-
+
bool
to_boolean (SCM s)
{
gh_set_cdr_x (gh_car (l), newcons);
gh_set_car_x (l, newcons);
}
+
+
+SCM
+ly_offset2scm (Offset o)
+{
+ return gh_cons (gh_double2scm (o[X_AXIS]), gh_double2scm(o[Y_AXIS]));
+}
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "staff-symbol.hh"
source file of the GNU LilyPond music typesetter
- (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1996, 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "line-of-score.hh"
/*
local-key-engraver.cc -- implement Local_key_engraver
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
// clean up!
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "local-key-item.hh"
#include "molecule.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
#include "atom.hh"
#include "lily-guile.hh"
-SCM
-ly_offset2scm (Offset o)
-{
- return gh_list (gh_double2scm (o[X_AXIS]), gh_double2scm(o[Y_AXIS]),
- SCM_UNDEFINED);
-}
Lookup::Lookup ()
{
if (!me->afm_l_)
{
warning (_f ("Can't find font: `%s'", font_name_));
- warning (_f ("(search path: `%s')", global_path.str ().ch_C()));
+ warning (_f ("(search path `%s')", global_path.str ().ch_C()));
error (_ ("Aborting"));
}
}
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "lyric-performer.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include <stdlib.h>
"lilypond");
cout << endl;
- cout << _f ("Copyright (c) %s by", "1996--1999");
+ cout << _f ("Copyright (c) %s by", "1996--2000");
cout << "Han-Wen Nienhuys <hanwen@cs.uu.nl>\n"
<< "Jan Nieuwenhuizen <janneke@gnu.org>\n";
}
// GNU GNU?
cout << _ ("GNU LilyPond -- The GNU Project music typesetter");
cout << '\n';
- cout << _f ("Copyright (c) %s by", "1996--1999");
+ cout << _f ("Copyright (c) %s by", "1996--2000");
cout << '\n';
cout << " Han-Wen Nienhuys <hanwen@cs.uu.nl>\n";
cout << " Jan Nieuwenhuizen <janneke@gnu.org>\n";
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "command-request.hh"
#include "mark-engraver.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include <math.h>
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "proto.hh"
//
// source file of the GNU LilyPond music typesetter
//
-// (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+// (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
#include <fstream.h>
#include "string.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "interval.hh"
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
/*
multi_measure_rest-engraver.cc -- implement Multi_measure_rest_engraver
- (c) 1998--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
mol_p->add_molecule (s);
Real staff_space
- = staff_symbol_referencer_interface (this).staff_space ();
+ = staff_symbol_referencer (this).staff_space ();
if (measures_i_ == 1 && rest_symbol)
{
mol_p->translate_axis (staff_space, Y_AXIS);
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "debug.hh"
#include "music-list.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "music-list.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "scope.hh"
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "music-list.hh"
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
+ #include <typeinfo>
#include "music.hh"
#include "music-list.hh"
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "musical-pitch.hh"
/*
TODO: check -- is_pitch () ?
*/
-void
-scm_to (SCM s, Musical_pitch* p)
+Musical_pitch
+scm_to (SCM s, Musical_pitch* )
{
- *p = Musical_pitch (gh_scm2int (gh_car (s)),
- gh_scm2int (gh_cadr (s)),
+ return Musical_pitch (gh_scm2int (gh_car (s)),
+ gh_scm2int (gh_cadr (s)),
gh_scm2int (gh_caddr (s)));
}
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "musical-request.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include <strstream.h>
new_input (main_input_str_, source_global_l);
- if (safe_global_b)
- allow_includes_b_ = false;
+ allow_includes_b_ = allow_includes_b_ && !(safe_global_b);
+
print_declarations(true);
}
return chordmodifier_tab_p_->get_pitch (s);
}
-bool
-My_lily_lexer::notename_b (String s) const
-{
- return note_tab_p_->elem_b (s);
-}
void
My_lily_lexer::set_notename_table (Notename_table *p)
note_tab_p_ = p;
}
-bool
-My_lily_lexer::chordmodifier_b (String s) const
-{
- return chordmodifier_tab_p_->elem_b (s);
-}
+
void
My_lily_lexer::set_chordmodifier_table (Notename_table *p)
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
*/
lexer_p_ = 0;
abbrev_beam_type_i_ = 0;
default_duration_.durlog_i_ = 2;
- default_pitch_ = Musical_pitch (5*7, 0);
error_level_i_ = 0;
fatal_error_i_ = 0;
delete default_header_p_;
}
-
-
void
My_lily_parser::set_version_check (bool ig)
{
abbrev_beam_type_i_ = type_i;
}
-void
-My_lily_parser::set_last_pitch (Musical_pitch const* p)
-{
- default_pitch_ = *p;
-}
-
-// junk me
-Simultaneous_music*
-My_lily_parser::get_word_element (String s, Duration * duration_p)
-{
- Simultaneous_music* velt_p = new Request_chord;
-
- Lyric_req* lreq_p = new Lyric_req;
- lreq_p ->text_str_ = s;
- lreq_p->duration_ = *duration_p;
- lreq_p->set_spot (here_input());
-
- velt_p->add_music (lreq_p);
-
- delete duration_p;
- return velt_p;
-}
-
-// junk me
-Simultaneous_music *
-My_lily_parser::get_rest_element (String s, Duration * duration_p)
-{
- Simultaneous_music* velt_p = new Request_chord;
- velt_p->set_spot (here_input());
- if (s=="s")
- { /* Space */
- Skip_req * skip_p = new Skip_req;
- skip_p->duration_ = *duration_p;
- skip_p->set_spot (here_input());
- velt_p->add_music (skip_p);
- }
- else
- {
- Rest_req * rest_req_p = new Rest_req;
- rest_req_p->duration_ = *duration_p;
- rest_req_p->set_spot (here_input());
-
- velt_p->add_music (rest_req_p);
- }
-
- delete duration_p;
- return velt_p;
-}
// junk me
Simultaneous_music *
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include <math.h> // ceil
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "misc.hh"
/*
head-grav.cc -- part of GNU LilyPond
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "note-head.hh"
source file of the GNU LilyPond music typesetter
- (c) 1996, 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1996, 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "note-performer.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "notename-table.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "moment.hh"
#include "paper-column.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include <math.h>
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
*/
{
if (safe_global_b)
{
- // ly_set_x ("security-paranoia", SCM_BOOL_T);
+
gh_define ("security-paranoia", SCM_BOOL_T);
}
String s = String ("(eval (") + output_global_ch + "-scm 'all-definitions))";
source file of the GNU LilyPond music typesetter
- (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1996, 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "main.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include <fstream.h>
musical_pitch:
steno_musical_pitch {
$$ = $1;
- THIS->set_last_pitch ($1);
}
| explicit_musical_pitch {
$$ = $1;
- THIS->set_last_pitch ($1);
}
;
$$ = v;
}
| RESTNAME optional_notemode_duration {
- $$ = THIS->get_rest_element (ly_scm2string ($1), $2);
+ Simultaneous_music* velt_p = new Request_chord;
+ velt_p->set_spot (THIS->here_input());
+
+ if (ly_scm2string ($1) =="s")
+ { /* Space */
+ Skip_req * skip_p = new Skip_req;
+ skip_p->duration_ = *$2;
+
+ skip_p->set_spot (THIS->here_input());
+ velt_p->add_music (skip_p);
+ }
+ else
+ {
+ Rest_req * rest_req_p = new Rest_req;
+ rest_req_p->duration_ = *$2;
+ rest_req_p->set_spot (THIS->here_input());
+
+ velt_p->add_music (rest_req_p);
+ }
+
+ delete $2;
+ $$ = velt_p;
+
}
| MEASURES optional_notemode_duration {
| STRING optional_notemode_duration {
if (!THIS->lexer_p_->lyric_state_b ())
THIS->parser_error (_ ("Have to be in Lyric mode for lyrics"));
- $$ = THIS->get_word_element (ly_scm2string ($1), $2);
+ Simultaneous_music* velt_p = new Request_chord;
+
+ Lyric_req* lreq_p = new Lyric_req;
+ lreq_p ->text_str_ = ly_scm2string ($1);
+ lreq_p->duration_ = *$2;
+ lreq_p->set_spot (THIS->here_input());
+
+ velt_p->add_music (lreq_p);
+
+ delete $2;
+ $$= velt_p;
}
| chord {
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include <time.h>
source file of the GNU LilyPond music typesetter
- (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1996, 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
*/
source file of the GNU LilyPond music typesetter
- (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1996, 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "staff-symbol-referencer.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "property-iterator.hh"
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "protected-scm.hh"
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "repeat-engraver.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "translator-group.hh"
source file of the GNU LilyPond music typesetter
- (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1996, 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "request.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "debug.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include <math.h> // ceil.
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "staff-symbol-referencer.hh"
#include "rest-engraver.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "molecule.hh"
/*
UGH.
*/
- staff_symbol_referencer_interface (d)
+ staff_symbol_referencer (d)
.set_position ((balltype_i () == 7) ? 4 : 3);
}
}
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "dimension-cache.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "rhythmic-head.hh"
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "rod.hh"
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "score-element-info.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "debug.hh"
#include "dimension-cache.hh"
source file of the GNU LilyPond music typesetter
- (c) 1996, 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1996, 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "score-performer.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "score.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include <fstream.h>
#include "main.hh"
/*
script-engraver.cc -- implement Script_engraver
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "script-engraver.hh"
void
Script_engraver::acknowledge_element (Score_element_info inf)
{
+ bool them_grace = to_boolean (inf.elem_l_->get_elt_property ("grace"));
+ bool us_grace = to_boolean (get_property ("weAreGraceContext",0));
+
+ if (us_grace != them_grace)
+ return;
+
if (Stem *s = dynamic_cast<Stem*>(inf.elem_l_))
{
for (int i=0; i < script_p_arr_.size(); i++)
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "grace-iterator.hh"
#include "translator-group.hh"
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include <math.h> // ceil.
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "translator-group.hh"
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
/*
slur-grav.cc -- implement Slur_engraver
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "proto.hh"
source file of the GNU LilyPond music typesetter
- (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1996, 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "debug.hh"
#include "box.hh"
#include "bezier.hh"
+#include "bezier-bow.hh"
#include "main.hh"
#include "cross-staff.hh"
#include "group-interface.hh"
Slur::Slur ()
{
+ dy_f_drul_[LEFT] = dy_f_drul_[RIGHT] = 0.0;
+ dx_f_drul_[LEFT] = dx_f_drul_[RIGHT] = 0.0;
set_elt_property ("note-columns", SCM_EOL);
}
*/
for (int i = 0; i < 3; i++)
{
- Real height_f = curve_extent (Y_AXIS).length ();
- Real width_f = curve_extent (X_AXIS).length ();
+ Bezier c (get_curve ());
+
+
+ Real height_f = c.extent (X_AXIS).length ();
+ Real width_f = c.extent (Y_AXIS).length ();
dy_f = dy_f_drul_[RIGHT] - dy_f_drul_[LEFT];
if (!fix_broken_b)
}
+
+
+
+Molecule*
+Slur::do_brew_molecule_p () const
+{
+ Real thick = paper_l ()->get_var ("slur_thickness");
+ Bezier one = get_curve ();
+
+ Molecule a;
+ SCM d = get_elt_property ("dashed");
+ if (gh_number_p (d))
+ a = lookup_l ()->dashed_slur (one, thick, gh_scm2int (d));
+ else
+ a = lookup_l ()->slur (one, directional_element (this).get () * thick, thick);
+
+ return new Molecule (a);
+}
+
+
+
+Bezier
+Slur::get_curve () const
+{
+ Bezier_bow b (get_encompass_offset_arr (), directional_element (this).get ());
+
+ b.ratio_ = paper_l ()->get_var ("slur_ratio");
+ b.height_limit_ = paper_l ()->get_var ("slur_height_limit");
+ b.rc_factor_ = paper_l ()->get_var ("slur_rc_factor");
+
+ b.calculate ();
+ return b.get_curve ();
+}
+
+#if 0
+
+/*
+ TODO: FIXME.
+ */
+
+/*
+ Clipping
+
+ This function tries to address two issues:
+ * the tangents of the slur should always point inwards
+ in the actual slur, i.e. *after rotating back*.
+
+ * slurs shouldn't be too high
+ let's try : h <= 1.2 b && h <= 3 staffheight?
+
+ We could calculate the tangent of the bezier curve from
+ both ends going inward, and clip the slur at the point
+ where the tangent (after rotation) points up (or inward
+ with a certain maximum angle).
+
+ However, we assume that real clipping is not the best
+ answer. We expect that moving the outer control point up
+ if the slur becomes too high will result in a nicer slur
+ after recalculation.
+
+ Knowing that the tangent is the line through the first
+ two control points, we'll clip (move the outer control
+ point upwards) too if the tangent points outwards.
+ */
+
+bool
+Bezier_bow::calc_clipping ()
+{
+ Real clip_height = paper_l_->get_var ("slur_clip_height");
+ Real clip_ratio = paper_l_->get_var ("slur_clip_ratio");
+ Real clip_angle = paper_l_->get_var ("slur_clip_angle");
+
+ Real b = curve_.control_[3][X_AXIS] - curve_.control_[0][X_AXIS];
+ Real clip_h = clip_ratio * b <? clip_height;
+ Real begin_h = curve_.control_[1][Y_AXIS] - curve_.control_[0][Y_AXIS];
+ Real end_h = curve_.control_[2][Y_AXIS] - curve_.control_[3][Y_AXIS];
+ Real begin_dy = 0 >? begin_h - clip_h;
+ Real end_dy = 0 >? end_h - clip_h;
+
+ Real pi = M_PI;
+ Real begin_alpha = (curve_.control_[1] - curve_.control_[0]).arg () + dir_ * alpha_;
+ Real end_alpha = pi - (curve_.control_[2] - curve_.control_[3]).arg () - dir_ * alpha_;
+
+ Real max_alpha = clip_angle / 90 * pi / 2;
+ if ((begin_dy < 0) && (end_dy < 0)
+ && (begin_alpha < max_alpha) && (end_alpha < max_alpha))
+ return false;
+
+ transform_back ();
+
+ if ((begin_dy > 0) || (end_dy > 0))
+ {
+ Real dy = (begin_dy + end_dy) / 4;
+ dy *= cos (alpha_);
+ encompass_[0][Y_AXIS] += dir_ * dy;
+ encompass_.top ()[Y_AXIS] += dir_ * dy;
+ }
+ else
+ {
+ //ugh
+ Real c = 0.4;
+ if (begin_alpha >= max_alpha)
+ begin_dy = 0 >? c * begin_alpha / max_alpha * begin_h;
+ if (end_alpha >= max_alpha)
+ end_dy = 0 >? c * end_alpha / max_alpha * end_h;
+
+ encompass_[0][Y_AXIS] += dir_ * begin_dy;
+ encompass_.top ()[Y_AXIS] += dir_ * end_dy;
+
+ Offset delta = encompass_.top () - encompass_[0];
+ alpha_ = delta.arg ();
+ }
+
+ to_canonic_form ();
+
+ return true;
+}
+#endif
+
+
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "dimension-cache.hh"
#include "span-bar.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "span-bar.hh"
source file of the GNU LilyPond music typesetter
- (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1996, 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "dimension-cache.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "proto.hh"
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "staff-margin-engraver.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "staff-performer.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "staff-symbol.hh"
Real off =0.0;
if (gh_number_p (pos))
{
- Real space = staff_symbol_referencer_interface (sc).staff_space ();
+ Real space = staff_symbol_referencer (sc).staff_space ();
off = gh_scm2double (pos) * space/2.0;
}
sc->set_elt_property ("staff-position", gh_double2scm (0.0));
}
Staff_symbol_referencer_interface
-staff_symbol_referencer_interface (Score_element const*e)
+staff_symbol_referencer (Score_element const*e)
{
return e; // gee, I'm so smart!
}
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "staff-symbol.hh"
#include "lookup.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "staff-symbol-referencer.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1996, 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
TODO: This is way too hairy
Drul_array<Note_head*> e (extremal_heads ());
- return Interval (staff_symbol_referencer_interface (e[DOWN]).position_f (),
- staff_symbol_referencer_interface( e[UP]).position_f ());
+ return Interval (staff_symbol_referencer (e[DOWN]).position_f (),
+ staff_symbol_referencer( e[UP]).position_f ());
}
Interval stem_y(y1,y2);
stem_y.unite (Interval (y2,y1));
- Real dy = staff_symbol_referencer_interface (this)
- .staff_space ()/2.0;
-
+ Real dy = staff_symbol_referencer (this).staff_space ()/2.0;
Real head_wid = 0;
if (support_head ())
head_wid = support_head ()->extent (X_AXIS).length ();
source file of the LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "super-element.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "swallow-engraver.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "swallow-perf.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include <limits.h>
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "tempo-performer.hh"
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "dimension-cache.hh"
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
{
exists_b_ = false;
code_ = 0;;
- width_ = height_ = depth_ = italic_correction_ = 0;
- width_fix_ = height_fix_ = depth_fix_ = italic_correction_fix_ = 0;
+ width_ = 0;
+ height_ = 0;
+ depth_ = 0;
+ italic_correction_ = 0;
+ width_fix_ = 0;
+ height_fix_ = 0;
+ depth_fix_ = 0;
+ italic_correction_fix_ = 0;
}
#define APPEND_CHAR_METRIC_ELT(k) outstr += to_str (#k) + " " + to_str (k ## _) + "; "
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
+#include "lookup.hh"
#include "paper-def.hh"
#include "tie.hh"
#include "note-head.hh"
+#include "bezier.hh"
#include "paper-column.hh"
#include "debug.hh"
#include "staff-symbol-referencer.hh"
#include "directional-element-interface.hh"
+#include "molecule.hh"
+#include "bezier-bow.hh"
void
Tie::set_head (Direction d, Item * head_l)
Tie::Tie()
{
set_elt_property ("heads", gh_cons (SCM_EOL, SCM_EOL));
+ dy_f_drul_[LEFT] = dy_f_drul_[RIGHT] = 0.0;
+ dx_f_drul_[LEFT] = dx_f_drul_[RIGHT] = 0.0;
+
}
Note_head*
return a;
}
+
+
+
+Molecule*
+Tie::do_brew_molecule_p () const
+{
+ Real thick = paper_l ()->get_var ("slur_thickness");
+ Bezier one = get_curve ();
+
+ Molecule a;
+ SCM d = get_elt_property ("dashed");
+ if (gh_number_p (d))
+ a = lookup_l ()->dashed_slur (one, thick, gh_scm2int (d));
+ else
+ a = lookup_l ()->slur (one, directional_element (this).get () * thick, thick);
+
+ return new Molecule (a);
+}
+
+
+
+Bezier
+Tie::get_curve () const
+{
+ Bezier_bow b (get_encompass_offset_arr (), directional_element (this).get ());
+
+ b.ratio_ = paper_l ()->get_var ("slur_ratio");
+ b.height_limit_ = paper_l ()->get_var ("slur_height_limit");
+ b.rc_factor_ = paper_l ()->get_var ("slur_rc_factor");
+
+ b.calculate ();
+ return b.get_curve ();
+}
+
+#if 0
+
+/*
+ TODO: FIXME.
+ */
+
+/*
+ Clipping
+
+ This function tries to address two issues:
+ * the tangents of the slur should always point inwards
+ in the actual slur, i.e. *after rotating back*.
+
+ * slurs shouldn't be too high
+ let's try : h <= 1.2 b && h <= 3 staffheight?
+
+ We could calculate the tangent of the bezier curve from
+ both ends going inward, and clip the slur at the point
+ where the tangent (after rotation) points up (or inward
+ with a certain maximum angle).
+
+ However, we assume that real clipping is not the best
+ answer. We expect that moving the outer control point up
+ if the slur becomes too high will result in a nicer slur
+ after recalculation.
+
+ Knowing that the tangent is the line through the first
+ two control points, we'll clip (move the outer control
+ point upwards) too if the tangent points outwards.
+ */
+
+bool
+Bezier_Tie::calc_clipping ()
+{
+ Real clip_height = paper_l_->get_var ("slur_clip_height");
+ Real clip_ratio = paper_l_->get_var ("slur_clip_ratio");
+ Real clip_angle = paper_l_->get_var ("slur_clip_angle");
+
+ Real b = curve_.control_[3][X_AXIS] - curve_.control_[0][X_AXIS];
+ Real clip_h = clip_ratio * b <? clip_height;
+ Real begin_h = curve_.control_[1][Y_AXIS] - curve_.control_[0][Y_AXIS];
+ Real end_h = curve_.control_[2][Y_AXIS] - curve_.control_[3][Y_AXIS];
+ Real begin_dy = 0 >? begin_h - clip_h;
+ Real end_dy = 0 >? end_h - clip_h;
+
+ Real pi = M_PI;
+ Real begin_alpha = (curve_.control_[1] - curve_.control_[0]).arg () + dir_ * alpha_;
+ Real end_alpha = pi - (curve_.control_[2] - curve_.control_[3]).arg () - dir_ * alpha_;
+
+ Real max_alpha = clip_angle / 90 * pi / 2;
+ if ((begin_dy < 0) && (end_dy < 0)
+ && (begin_alpha < max_alpha) && (end_alpha < max_alpha))
+ return false;
+
+ transform_back ();
+
+ if ((begin_dy > 0) || (end_dy > 0))
+ {
+ Real dy = (begin_dy + end_dy) / 4;
+ dy *= cos (alpha_);
+ encompass_[0][Y_AXIS] += dir_ * dy;
+ encompass_.top ()[Y_AXIS] += dir_ * dy;
+ }
+ else
+ {
+ //ugh
+ Real c = 0.4;
+ if (begin_alpha >= max_alpha)
+ begin_dy = 0 >? c * begin_alpha / max_alpha * begin_h;
+ if (end_alpha >= max_alpha)
+ end_dy = 0 >? c * end_alpha / max_alpha * end_h;
+
+ encompass_[0][Y_AXIS] += dir_ * begin_dy;
+ encompass_.top ()[Y_AXIS] += dir_ * end_dy;
+
+ Offset delta = encompass_.top () - encompass_[0];
+ alpha_ = delta.arg ();
+ }
+
+ to_canonic_form ();
+
+ return true;
+}
+#endif
+
+
+
+Array<Offset>
+Tie::get_encompass_offset_arr () const
+{
+ Array<Offset> offset_arr;
+ offset_arr.push (Offset (dx_f_drul_[LEFT], dy_f_drul_[LEFT]));
+ offset_arr.push (Offset (spanner_length () + dx_f_drul_[RIGHT],
+ dy_f_drul_[RIGHT]));
+
+ return offset_arr;
+}
+
+
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "time-signature-engraver.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "time-signature-performer.hh"
source file of the GNU LilyPond music typesetter
- (c) 1996--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1996--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "score-engraver.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "debug.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "translation-property.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "proto.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "music-output-def.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "beam.hh"
Real staff_space = paper_l ()->get_var ("interline");
-
-
Direction dir = directional_element (this).get ();
- Real dy = column_arr.top ()->extent (Y_AXIS) [dir]
- - column_arr[0]->extent (Y_AXIS) [dir];
-
-
+ Real dy = gh_scm2double (get_elt_property ("delta-y"));
SCM number = get_elt_property ("text");
if (gh_string_p (number))
{
set_bounds (RIGHT, column_arr.top ());
}
}
+
+/*
+ use first -> last note for slope, and then correct for disturbing
+ notes in between. */
+void
+Tuplet_spanner::calc_position_and_height (Real *offset, Real * dy) const
+{
+ Link_array<Note_column> column_arr=
+ Group_interface__extract_elements (this, (Note_column*)0, "columns");
+
+
+ Direction d = directional_element (this).get ();
+ *dy = column_arr.top ()->extent (Y_AXIS) [d]
+ - column_arr[0]->extent (Y_AXIS) [d];
+
+ *offset = - d * infinity_f;
+ Real x0 = column_arr[0]->hpos_f ();
+ Real x1 = column_arr.top ()->hpos_f ();
+ for (int i = 0; i < column_arr.size (); i++)
+ {
+ Real notey = column_arr[i]->extent (Y_AXIS)[d];
+ Real x = column_arr[i]->hpos_f () - x0;
+ Real tuplety = *dy * x / (x1 -x0);
+
+ if (notey * d > (*offset + tuplety) * d)
+ *offset = notey - tuplety;
+ }
+}
+
void
Tuplet_spanner::do_post_processing ()
{
+
Link_array<Note_column> column_arr=
Group_interface__extract_elements (this, (Note_column*)0, "columns");
-
+
+ if (!column_arr.size ())
+ {
+ set_elt_property ("transparent", SCM_BOOL_T);
+ set_empty (X_AXIS);
+ set_empty (Y_AXIS);
+ }
Direction d = directional_element (this).get ();
if (!d)
{
d = UP;
directional_element (this).set (d);
+
}
-
- if (column_arr.size())
- translate_axis (column_arr[0]->extent (Y_AXIS)[d], Y_AXIS);
+ Real dy, offset;
+
+ calc_position_and_height (&offset, &dy);
+ set_elt_property ("delta-y", gh_double2scm (dy));
+ translate_axis (offset, Y_AXIS);
if (scm_ilength (get_elt_property ("beams")) == 1)
{
SCM dir_sym =get_elt_property ("dir-forced");
if (gh_number_p (dir_sym))
{
- d= (Direction) gh_scm2int (dir_sym);
+ d= to_dir (dir_sym);
if (d != CENTER)
return d;
}
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "type-swallow-translator.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "translator-group.hh"
#include "axis-group-engraver.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "proto.hh"
--- /dev/null
+;;; lilypond-mode.el --- Major mode for editing GNU LilyPond music scores
+
+;; Copyright (C) 1992,1993,1994 Tim Peters
+
+;; Author: 1999: Jan Nieuwenhuizen
+;; Author: 1997: Han-Wen Nienhuys
+;; Author: 1995-1996 Barry A. Warsaw
+;; 1992-1994 Tim Peters
+;; Created: Feb 1992
+;; Version: 0.0
+;; Last Modified: 12SEP97
+;; Keywords: mudela languages music
+
+;; This software is provided as-is, without express or implied
+;; warranty. Permission to use, copy, modify, distribute or sell this
+;; software, without fee, for any purpose and by any individual or
+;; organization, is hereby granted, provided that the above copyright
+;; notice and this paragraph appear in all copies.
+
+;; Sigh
+
+;; This is a cannabalised version of python-mode.el (HWN)
+;; Added lily-eval-buffer -- jcn
+;;
+;; TODO:
+;; * lily/ly/lilypond?
+;; * fix lily-keymap
+;; * mail Tim Peters about silly copyright (notice)?
+;; * syntax
+;; - should handle block comments too.
+;; - handle lexer modes (\header, \melodic, \lyric) etc.
+;; - indentation
+;; - notenames?
+;; - fontlock: \melodic \melodic
+
+
+(defconst lily-version "1.3.19"
+ "`lilypond-mode' version number.")
+
+(defconst lily-help-address "hanwen@cs.uu.nl"
+ "Address accepting submission of bug reports.")
+
+(defconst lily-font-lock-keywords
+ (let* ((keywords '("spanrequest" "simultaneous" "sequential" "accepts"
+ "alternative" "bar" "breathe"
+ "cadenza" "chordmodifiers" "chords" "clef" "cm" "consists"
+ "consistsend" "context"
+ "duration" "font" "grace" "header" "in" "lyrics"
+ "key" "keysignature" "mark" "musicalpitch"
+ "time" "times" "midi" "mm" "name" "notenames"
+ "notes" "partial" "paper" "penalty" "property" "pt"
+ "relative" "remove" "repeat" "repetitions" "addlyrics"
+ "scm" "scmfile" "score" "script"
+ "shape" "skip" "textscript" "tempo" "translator" "transpose"
+ "type" "version"
+ ))
+ (kwregex (mapconcat (lambda (x) (concat "\\\\" x)) keywords "\\|")))
+
+ (list
+ (concat ".\\(" kwregex "\\)[^a-zA-Z]")
+ (concat "^\\(" kwregex "\\)[^a-zA-Z]")
+ '(".\\(\\\\[a-zA-Z][a-zA-Z]*\\)" 1 font-lock-variable-name-face)
+ '("^[\t ]*\\([a-zA-Z][_a-zA-Z]*\\) *=" 1 font-lock-variable-name-face)
+ ))
+ "Additional expressions to highlight in Mudela mode.")
+
+;; define a mode-specific abbrev table for those who use such things
+(defvar lilypond-mode-abbrev-table nil
+ "Abbrev table in use in `lilypond-mode' buffers.")
+
+(define-abbrev-table 'lilypond-mode-abbrev-table nil)
+
+(defvar lilypond-mode-hook nil
+ "*Hook called by `lilypond-mode'.")
+
+(defvar lily-mode-syntax-table nil
+ "Syntax table used in `lilypond-mode' buffers.")
+
+;;
+(if lily-mode-syntax-table
+ ()
+ (setq lily-mode-syntax-table (make-syntax-table))
+ (mapcar (function
+ (lambda (x) (modify-syntax-entry
+ (car x) (cdr x) lily-mode-syntax-table)))
+ '(( ?\( . "." ) ( ?\) . "." )
+ ( ?\[ . "." ) ( ?\] . "." )
+ ( ?\{ . "(}" ) ( ?\} . "){" )
+ ( ?\< . "(>" )( ?\> . ")>")
+ ( ?\$ . "." ) ( ?\% . "." ) ( ?\& . "." )
+ ( ?\* . "." ) ( ?\+ . "." ) ( ?\- . "." )
+ ( ?\/ . "." ) ( ?\= . "." )
+ ( ?\| . "." ) (?\\ . "\\" )
+ ( ?\_ . "." )
+ ( ?\' . "w")
+ ( ?\" . "\"" )
+ ( ?\% . "<")
+ ( ?\n . ">")
+
+; FIXME
+; ( ?% . ". 124b" )
+; ( ?{ . ". 23" )
+ ))
+
+ )
+
+(defconst lily-imenu-generic-re "^\\([a-zA-Z_][a-zA-Z0-9_]*\\) *="
+ "Regexp matching Identifier definitions.")
+
+;; Sadly we need this for a macro in Emacs 19.
+(eval-when-compile
+ ;; Imenu isn't used in XEmacs, so just ignore load errors.
+ (condition-case ()
+ (require 'imenu)
+ (error nil)))
+
+(defvar lily-imenu-generic-expression
+ (list (list nil lily-imenu-generic-re 1))
+ "Expression for imenu")
+
+
+;;; we're using some handy compile commands
+(require 'compile)
+
+(defcustom lily-command "lilypond"
+ "* LilyPond executable."
+ :type 'string
+ :group 'lily)
+
+(defcustom lily-parameters ""
+ "*."
+ :type 'string
+ :group 'lily)
+
+(defvar lily-regexp-alist
+ '(("\\([a-zA-Z]?:?[^:( \t\n]+\\)[:( \t]+\\([0-9]+\\)[:) \t]" 1 2))
+ "Regexp used to match LilyPond errors. See `compilation-error-regexp-alist'.")
+
+(defcustom lily-tex-command "tex"
+ "*."
+ :type 'string
+ :group 'lily)
+
+(defcustom lily-xdvi-command "xdvi"
+ "*."
+ :type 'string
+ :group 'lily)
+
+(defun lily-compile-file (command parameters file)
+ ;; Setting process-setup-function makes exit-message-function work
+ ;; even when async processes aren't supported.
+ (let ((command-args (concat command " " parameters " " file)))
+ (compile-internal command-args "No more errors" "LilyPond")))
+
+;; do we still need this, now that we're using compile-internal?
+(defun lily-save-buffer ()
+ (if (buffer-modified-p) (save-buffer)))
+
+;;; return (dir base ext)
+(defun split-file-name (name)
+ (let* ((i (string-match "[^/]*$" name))
+ (dir (if (> i 0) (substring name 0 i) "./"))
+ (file (substring name i (length name)))
+ (i (string-match "[^.]*$" file)))
+ (if (and
+ (> i 0)
+ (< i (length file)))
+ (list dir (substring file 0 (- i 1)) (substring file i (length file)))
+ (list dir file ""))))
+
+;;;###autoload
+(defun lily-eval-buffer ()
+ "Run LilyPond on buffer."
+ (interactive)
+ (let ((buffer (buffer-name)))
+ (if buffer-file-name
+ (progn
+ (lily-save-buffer)
+ (lily-compile-file lily-command lily-parameters buffer))
+ (progn
+ (error "Buffer %s is not associated with a file" buffer)
+ (lily-eval-region (min-point) (max-point))))))
+
+;;;###autoload
+(defun lily-eval-region (start end)
+ "Run LilyPond on region."
+ (interactive "r")
+ ;; (message "saving current buffer to temporary file ...")
+ ;; (write-file tmp-file-with-directory)
+ ;;(lily-compile-file lily-command "--init=init.fly" "-")
+ (let ((basename "emacs-lily"))
+ (write-region start end (concat basename ".fly") nil 'nomsg)
+ (lily-compile-file lily-command lily-parameters basename)))
+
+(defun lily-running ()
+ (let ((process (get-process "lilypond")))
+ (and process
+ (eq (process-status process) 'run))))
+
+(defun lily-tex-file (basename)
+ (call-process lily-tex-command nil t nil basename))
+
+(defun lily-xdvi-file (basename)
+ (let ((outbuf (get-buffer-create "*lily-xdvi*"))
+ (name "xdvi")
+ (command (concat lily-xdvi-command " " basename)))
+ (if (get-process "xdvi")
+ ;; Don't open new xdvi window, but force redisplay
+ ;; We could make this an option.
+ (signal-process (process-id (get-process "xdvi")) 'SIGUSR1)
+ (if (fboundp 'start-process)
+ (let* ((process-environment (cons "EMACS=t" process-environment))
+ (proc (start-process-shell-command name outbuf command)))
+ ;;(set-process-sentinel proc 'compilation-sentinel)
+ ;;(set-process-filter proc 'compilation-filter)
+ (set-marker (process-mark proc) (point) outbuf))
+ ;;(setq compilation-in-progress (cons proc compilation-in-progress)))
+
+ ;; No asynchronous processes available.
+ (message "Executing `%s'..." command)
+ ;; Fake modeline display as if `start-process' were run.
+ (setq mode-line-process ":run")
+ (force-mode-line-update)
+ (sit-for 0) ; Force redisplay
+ (call-process shell-file-name nil outbuf nil "-c" command)
+ (message "Executing `%s'...done" command)))))
+
+
+;;;###autoload
+(defun lily-xdvi-buffer ()
+ "Run LilyPond, TeX and Xdvi on buffer."
+ (interactive)
+
+ (let* ((split (split-file-name buffer-file-name))
+ (dir (car split))
+ (base (cadr split)))
+
+ ;; we don't really need this...
+ (let ((tex (concat dir base ".tex"))
+ (dvi (concat dir base ".dvi")))
+ (if (file-exists-p tex) (delete-file tex))
+ (if (file-exists-p dvi) (delete-file dvi)))
+
+ (lily-eval-buffer)
+ (set-buffer "*lilypond*")
+
+ ;;(setq default-directory dir)
+ (while (lily-running)
+ (continue-process (get-process "lilypond")))
+ (sit-for 0) ; Force redisplay
+
+ (if (= 0 (process-exit-status (get-process "lilypond")))
+ (progn
+ (if (= 0 (lily-tex-file base))
+ (lily-xdvi-file base))))))
+
+;;;###autoload
+(defun lily-xdvi-region (start end)
+ "Run LilyPond, TeX and Xdvi on region."
+ (interactive "r")
+
+ (let ((dir default-directory)
+ (base "emacs-lily"))
+
+ ;; we don't really need this...
+ (let ((tex (concat dir base ".tex"))
+ (dvi (concat dir base ".dvi")))
+ (if (file-exists-p tex) (delete-file tex))
+ (if (file-exists-p dvi) (delete-file dvi)))
+
+ (lily-eval-region start end)
+ (set-buffer "*lilypond*")
+
+ ;;(setq default-directory dir)
+ (while (lily-running)
+ (continue-process (get-process "lilypond")))
+ (sit-for 0) ; Force redisplay
+
+ (if (= 0 (process-exit-status (get-process "lilypond")))
+ (progn
+ (if (= 0 (lily-tex-file base))
+ (lily-xdvi-file base))))))
+
+;;;###autoload
+(defun lily-kill-job ()
+ "Kill the currently running LilyPond job."
+ (interactive)
+ (quit-process (get-process "lilypond") t))
+
+;; hmm
+;; (kill-process (get-process "xdvi") t)
+
+(defvar lily-mode-map ()
+ "Keymap used in `lilypond-mode' buffers.")
+
+(if lily-mode-map
+ ()
+ (setq lily-mode-map (make-sparse-keymap))
+ ;; this doesn't work, here
+ ;; I would very much like to have [f9], globally defined as 'compile,
+ ;; being overidden to 'lily-eval-buffer for LilyPond buffers
+ (define-key lily-mode-map [C-f9] 'lily-eval-buffer)
+ ;; urg
+ ;; add to .emacs:
+ ;; (global-set-key [C-f9] 'lily-eval-buffer)
+ )
+
+(defun lilypond-mode ()
+ "Major mode for editing Mudela files."
+ (interactive)
+ ;; set up local variables
+ (kill-all-local-variables)
+
+ (make-local-variable 'font-lock-defaults)
+ (setq font-lock-defaults '(lily-font-lock-keywords))
+
+ (make-local-variable 'paragraph-separate)
+ (setq paragraph-separate "^[ \t]*$")
+
+ (make-local-variable 'paragraph-start)
+ (setq paragraph-start "^[ \t]*$")
+
+ (make-local-variable 'comment-start)
+ (setq comment-start "%")
+
+ (make-local-variable 'comment-start-skip)
+ (setq comment-start-skip "%{? *")
+
+ (make-local-variable 'comment-end)
+ (setq comment-end "\n")
+
+ (make-local-variable 'block-comment-start)
+ (setq block-comment-start "%{")
+
+ (make-local-variable 'block-comment-end)
+ (setq block-comment-end "%}")
+
+ ;; (make-local-variable 'comment-column)
+ ;; (setq comment-column 40)
+
+ (make-local-variable 'imenu-generic-expression)
+ (setq imenu-generic-expression lily-imenu-generic-expression)
+
+ (make-local-variable 'indent-line-function)
+ (setq indent-line-function 'indent-relative-maybe)
+
+ ;;
+ (set-syntax-table lily-mode-syntax-table)
+ (setq major-mode 'lilypond-mode)
+ (setq mode-name "Mudela")
+ (setq local-abbrev-table lilypond-mode-abbrev-table)
+ (use-local-map lily-mode-map)
+
+ ;; run the mode hook. lily-mode-hook use is deprecated
+ (run-hooks 'lilypond-mode-hook))
+
+
+(defun lily-keep-region-active ()
+ ;; do whatever is necessary to keep the region active in XEmacs.
+ ;; Ignore byte-compiler warnings you might see. Also note that
+ ;; FSF's Emacs 19 does it differently and doesn't its policy doesn't
+ ;; require us to take explicit action.
+ (and (boundp 'zmacs-region-stays)
+ (setq zmacs-region-stays t)))
+
+
+;;(defun lily-comment-region (beg end &optional arg)
+;; "Like `comment-region' but uses double hash (`#') comment starter."
+;; (interactive "r\nP")
+;; (let ((comment-start lily-block-comment-prefix))
+;; (comment-region beg end arg)))
+\f
+(defun lily-version ()
+ "Echo the current version of `lilypond-mode' in the minibuffer."
+ (interactive)
+ (message "Using `lilypond-mode' version %s" lily-version)
+ (lily-keep-region-active))
+
+(provide 'lilypond-mode)
+;;; lilypond-mode.el ends here
% -*- Fundamental -*-
-accreg_dot_size# := .5interline#;
+accreg_dot_size# := .5staff_space#;
% FIXME
% 'strange turning path' in accSB and others:
% This dimention is the same on all registersymbols.
% The different symbols should calculate their other
% dimensions from this and accreg_dot_size
-accreg_lh# := 1.0interline#;
+accreg_lh# := 1.0staff_space#;
define_pixels(accreg_dot_size, accreg_linethickness, accreg_lh);
pen accreg_pen;
def def_some_vars =
save hs, mb, mt, thin, thick, height, width, cOne, cTwo;
width = .8staffsize;
- height = 2.4interline;
- thin = 0.05interline;
- thick = 0.2interline;
- hs = 0.4interline;
+ height = 2.4staff_space;
+ thin = 0.05staff_space;
+ thick = 0.2staff_space;
+ hs = 0.4staff_space;
mb = .53;
mt = .47;
cOne = 0.65;
enddef;
fet_beginchar("accSB", "accSB", "accSB")
- set_char_box(.4staffsize#, .4staffsize#, 0, 2.4interline#);
+ set_char_box(.4staffsize#, .4staffsize#, 0, 2.4staff_space#);
def_some_vars;
def_B(.35width, .7height);
currentpicture := currentpicture shifted (-.40width, -.85height);
draw (-.5width, 0)--(.5width, 0)--(.5width, -height)
--(-.5width, -height)--(-.5width, 0);
- currentpicture := currentpicture shifted (0, 2.4interline);
+ currentpicture := currentpicture shifted (0, 2.4staff_space);
fet_endchar;
fet_beginchar("accBB", "accBB", "accBB")
- set_char_box(.4staffsize#, .4staffsize#, 0, 2.4interline#);
+ set_char_box(.4staffsize#, .4staffsize#, 0, 2.4staff_space#);
def_some_vars;
def_B(.35width, .7height);
currentpicture := currentpicture shifted(-.40width, -.85height);
draw (-.5width, 0)--(.5width, 0)--(.5width, -height)
--(-.5width, -height)--(-.5width, 0);
- currentpicture := currentpicture shifted (0, 2.4interline);
+ currentpicture := currentpicture shifted (0, 2.4staff_space);
fet_endchar;
fet_beginchar("accOldEE", "accOldEE", "accOldEE")
- set_char_box(interline#, interline#, 0, 2interline#);
+ set_char_box(staff_space#, staff_space#, 0, 2staff_space#);
show w;
show h;
- r = interline;
- lr = .3interline;
- ir = .6interline;
+ r = staff_space;
+ lr = .3staff_space;
+ ir = .6staff_space;
pickup accreg_pen;
draw fullcircle scaled 2r;
pickup penrazor;
fet_endchar;
fet_beginchar("accOldEES", "accOldEES", "accOldEES")
- set_char_box(interline#, interline#, 0, 2interline#);
+ set_char_box(staff_space#, staff_space#, 0, 2staff_space#);
save r, shy;
- r = interline;
+ r = staff_space;
shy = .3;
pickup accreg_pen;
draw fullcircle scaled 2r;
hip_depth_ratio, hip_width,
foot_depth, foot_width_ratio;
- flare# = 1.0 interline#;
+ flare# = 1.0 staff_space#;
hip_depth_ratio = .72;
foot_width_ratio = .8;
hip_width# = upflag_width# - hip_thickness#/2;
- foot_depth# = 3 interline#;
+ foot_depth# = 3 staff_space#;
set_char_box(stemthickness# /2, hip_width#
+ stemthickness#/2 + right_upflag_space#,
hip_depth_ratio, foot_width_ratio, hip_thickness, foot_thickness);
pickup pencircle scaled stemthickness;
- draw (0, 0) .. (0,-2 interline);
+ draw (0, 0) .. (0,-2 staff_space);
fet_endchar;
fet_beginchar("16th Flag (up)", "u4", "sixteenthflag")
hip_depth_ratio, hip_width,
foot_depth, foot_width_ratio;
save flagspace, total_depth, flag_count;
- total_depth# = 3.5 interline#;
+ total_depth# = 3.5 staff_space#;
flag_count = 2;
- flare# = .85 interline#;
- flagspace# = .85 interline#;
+ flare# = .85 staff_space#;
+ flagspace# = .85 staff_space#;
hip_depth_ratio = .72 ;
hip_width# = upflag_width# - hip_thickness#/2;
flagspace# + foot_depth# = total_depth#;
.97, 1.00, 1.25, hip_thickness, foot_thickness);
pickup pencircle scaled stemthickness;
- draw (0, 0) .. (0,-2 interline);
+ draw (0, 0) .. (0,-2 staff_space);
fet_endchar;
foot_depth, foot_width_ratio;
save flagspace, total_depth, flag_count;
flag_count = 3;
- total_depth#=4.25 interline#;
- flare# = .85 interline#;
- flagspace# = .87 interline#;
+ total_depth#=4.25 staff_space#;
+ flare# = .85 staff_space#;
+ flagspace# = .87 staff_space#;
hip_depth_ratio = .72 ;
hip_width# = upflag_width# - hip_thickness#/2;
(flag_count-1) * flagspace# + foot_depth# = total_depth#;
.95, 1.05, 1.25, hip_thickness, foot_thickness);
pickup pencircle scaled stemthickness;
- draw (0, 0) .. (0,-2 interline);
+ draw (0, 0) .. (0,-2 staff_space);
fet_endchar;
fet_beginchar("64th Flag (up)", "u6", "sixtyfourthflag")
save flagspace, total_depth, flag_count;
flag_count = 4;
- flare# = .85 interline#;
- flagspace# = .9 interline#;
+ flare# = .85 staff_space#;
+ flagspace# = .9 staff_space#;
hip_depth_ratio = .72 ;
hip_width# = upflag_width# - hip_thickness#/2;
- total_depth# = 5.25 interline#;
+ total_depth# = 5.25 staff_space#;
(flag_count-1) * flagspace# + foot_depth# = total_depth#;
foot_width_ratio = .8;
add_flag(flagspace, flare,
.95, 1.05, 1.25, hip_thickness, foot_thickness);
pickup pencircle scaled stemthickness;
- draw (0, 0) .. (0,-2 interline);
+ draw (0, 0) .. (0,-2 staff_space);
fet_endchar;
fet_beginchar("grace dash (up)", "ugrace", "gracedash")
hip_depth_ratio, hip_width,
foot_depth;
- flare# = 1.0 interline#;
+ flare# = 1.0 staff_space#;
hip_depth_ratio = .72;
hip_width# = upflag_width# - hip_thickness#/2;
- foot_depth# = 3 interline#;
+ foot_depth# = 3 staff_space#;
define_pixels(flare, hip_width, hip_thickness,
foot_depth, foot_thickness);
save flagspace, total_depth, flag_count;
flag_count = 1;
- flare# = .99 interline#;
- flagspace# = .9 interline#;
+ flare# = .99 staff_space#;
+ flagspace# = .9 staff_space#;
hip_depth_ratio = .72 ;
hip_width# = downflag_width# - hip_thickness#/2;
- total_depth# = 2.85 interline#;
+ total_depth# = 2.85 staff_space#;
(flag_count-1) * flagspace# + foot_depth# = total_depth#;
foot_width_ratio = .8;
pickup pencircle scaled stemthickness;
- draw (0, 0) .. (0,-2 interline);
+ draw (0, 0) .. (0,-2 staff_space);
y_mirror_char;
fet_endchar;
save flagspace, total_depth, flag_count;
flag_count = 2;
- flare# = .8 interline#;
- flagspace# = .9 interline#;
+ flare# = .8 staff_space#;
+ flagspace# = .9 staff_space#;
hip_depth_ratio = .85 ;
hip_width# = downflag_width# - hip_thickness#/2;
- total_depth# = 3.0 interline#;
+ total_depth# = 3.0 staff_space#;
(flag_count-1) * flagspace# + foot_depth# = total_depth#;
foot_width_ratio = .95;
pickup pencircle scaled stemthickness;
- draw (0, 0) .. (0,-2 interline);
+ draw (0, 0) .. (0,-2 staff_space);
y_mirror_char;
fet_endchar;
save flagspace, total_depth, flag_count;
flag_count = 3;
- flare# = .84 interline#;
- flagspace# = .9 interline#;
+ flare# = .84 staff_space#;
+ flagspace# = .9 staff_space#;
hip_depth_ratio = .85 ;
hip_width# = downflag_width# - hip_thickness#/2;
- total_depth# = 3.85 interline#;
+ total_depth# = 3.85 staff_space#;
(flag_count-1) * flagspace# + foot_depth# = total_depth#;
foot_width_ratio = .95;
pickup pencircle scaled stemthickness;
- draw (0, 0) .. (0,-2 interline);
+ draw (0, 0) .. (0,-2 staff_space);
y_mirror_char;
fet_endchar;
fet_beginchar("64th (down)", "d6", "dsixtyfourthflag")
save flagspace, total_depth, flag_count;
flag_count = 4;
- flare# = .8 interline#;
- flagspace# = .9 interline#;
+ flare# = .8 staff_space#;
+ flagspace# = .9 staff_space#;
hip_depth_ratio = .85 ;
hip_width# = downflag_width# - hip_thickness#/2;
- total_depth# = 4.35 interline#;
+ total_depth# = 4.35 staff_space#;
(flag_count-1) * flagspace# + foot_depth# = total_depth#;
foot_width_ratio = .98;
pickup pencircle scaled stemthickness;
- draw (0, 0) .. (0,-2 interline);
+ draw (0, 0) .. (0,-2 staff_space);
y_mirror_char;
fet_endchar;
save flagspace, total_depth, flag_count;
flag_count = 1;
- flare# = .99 interline#;
- flagspace# = .9 interline#;
+ flare# = .99 staff_space#;
+ flagspace# = .9 staff_space#;
hip_depth_ratio = .72 ;
hip_width# = downflag_width# - hip_thickness#/2;
- total_depth# = 2.85 interline#;
+ total_depth# = 2.85 staff_space#;
(flag_count-1) * flagspace# + foot_depth# = total_depth#;
foot_width_ratio = .8;
define_pixels (height, width);
thin = 2 stafflinethickness;
- thick = .5 interline;
+ thick = .5 staff_space;
z2 = .5 [z1, z3];
y3 = y1 + height/2;
for h := 2 staffsize# step 1 pt# until (7 * staffsize#):
- draw_brace(h, interline# );
+ draw_brace(h, staff_space# );
endfor
fet_begingroup("noteheads");
-noteheight#:=interline#+ (1 + overdone_heads) *stafflinethickness#;
+noteheight#:=staff_space#+ (1 + overdone_heads) *stafflinethickness#;
define_pixels(noteheight);
%
%
%
-brevis_wid# := 2 interline#;
+brevis_wid# := 2 staff_space#;
def draw_brevis(expr brevwid) =
save beamheight, head_width;
x7r = head_width;
y7 = y5;
% z7 = z5;
- z6 - z7 = (stem_width/2, -interline);
+ z6 - z7 = (stem_width/2, -staff_space);
theta = angle(z6-z7)+ 90;
penpos7(stem_width, theta);
penpos6(1.2 stem_width, theta);
enddef;
fet_beginchar("Mensural open head","0mensural","mensuralminimhead")
- draw_mensural_open_head (interline#);
+ draw_mensural_open_head (staff_space#);
fet_endchar;
fet_beginchar("Mensural open head","1mensural","mensuralsemiminimhead")
- draw_mensural_open_head (interline#);
+ draw_mensural_open_head (staff_space#);
fet_endchar;
fet_beginchar("Mensural black head","2mensural","fusahead")
- draw_mensural_black_head (interline#);
+ draw_mensural_black_head (staff_space#);
fet_endchar;
thick#:=1/16designsize;
define_blacker_pixels(thick);
-rthin:=1/8*interline;
+rthin:=1/8*staff_space;
% rthick:=2rthin;
rthick:=2thick+rthin;
%
save stem, ball_crook_stem, ball_crook_balldiam, flare;
-% stem#:=1/8*interline#;
-stem# = 1/5interline#;
-% flare# = 2/3interline#;
-flare# = 2/3interline# - 1/8stafflinethickness#;
+% stem#:=1/8*staff_space#;
+stem# = 1/5staff_space#;
+% flare# = 2/3staff_space#;
+flare# = 2/3staff_space# - 1/8stafflinethickness#;
define_pixels(stem,flare);
save block_rest_y, block_rest_x;
-block_rest_y# = 5/8 interline#;
-block_rest_x# = 3/2 interline#;
+block_rest_y# = 5/8 staff_space#;
+block_rest_x# = 3/2 staff_space#;
define_pixels(block_rest_y, block_rest_x);
save breve_rest_y, breve_rest_x;
-breve_rest_y# = interline#;
-breve_rest_x# = 3/5 interline#;
-multi_rest_x# = 2 interline#;
-multi_rest_y# = 1/3 interline#;
+breve_rest_y# = staff_space#;
+breve_rest_x# = 3/5 staff_space#;
+multi_rest_x# = 2 staff_space#;
+multi_rest_y# = 1/3 staff_space#;
define_pixels(breve_rest_y, breve_rest_x, multi_rest_x, multi_rest_y);
% draw_staff (-2, 2, 0.0);
save alpha, yshift, height;
alpha:=-50;
- yshift# = -1.25 interline#;
- height# = 2.8125 interline#;
+ yshift# = -1.25 staff_space#;
+ height# = 2.8125 staff_space#;
define_pixels (yshift, height);
- set_char_box(0, 27/25interline#,
+ set_char_box(0, 27/25staff_space#,
-yshift#,
yshift# + height#);
z13=z2r+1/2rthin*ne+1/2rthin*nw;
y1r = h;
- x1l=1/3interline;
- z2r=z1+interline*se;
+ x1l=1/3staff_space;
+ z2r=z1+staff_space*se;
z3=1/2[z2,z4];
- x4=3/8interline;
+ x4=3/8staff_space;
y4= 0;
- z5=z4l+1.3interline*se;
+ z5=z4l+1.3staff_space*se;
x6l=x4l;
y6l=y4r;
- x7=2/5interline;
+ x7=2/5staff_space;
y7= -d;
fill z1l{se}..{se}z10..z3l..z11{se}..{se}z5l..z5r{nw}..{nw}z12..z3r..z13{nw}..{nw}z1r.. cycle;
penlabels(1,2,3,4,5,6,7);
penlabels(10,11,12,13);
-% 3/4 interline# + yshift#,
-% 18/5interline# + yshift#)
+% 3/4 staff_space# + yshift#,
+% 18/5staff_space# + yshift#)
fet_endchar;
fet_beginchar("8th rest","3","eighthrest");
% draw_staff (-2, 2, 0.0);
save yshift, ballcorrection;
- ballcorrection = 0.005 interline;
+ ballcorrection = 0.005 staff_space;
- yshift# := -1.0 interline#;
+ yshift# := -1.0 staff_space#;
define_pixels(yshift);
- set_char_box(0, 4/3interline#, -yshift#, yshift# +
- 5/3interline#+7/4stafflinethickness#);
+ set_char_box(0, 4/3staff_space#, -yshift#, yshift# +
+ 5/3staff_space#+7/4stafflinethickness#);
%
% The curve is like a valley causing less space between
x1=w-stem/6;
- y1 = yshift + 1.5 interline + flare/4 + ballcorrection;
+ y1 = yshift + 1.5 staff_space + flare/4 + ballcorrection;
rest_crook (z1,w-stem/6);
z2-z1=whatever*dir70;
y2= yshift + stem/2;
fet_beginchar("16th rest","4","sixteenthrest");
% draw_staff (-2, 2, 0.0);
save yshift, ballcorrection;
- ballcorrection = 0.005 interline;
+ ballcorrection = 0.005 staff_space;
- yshift# := - 2 interline#;
+ yshift# := - 2 staff_space#;
define_pixels(yshift);
save alpha,cw,h,w, height;
alpha=74;
- cw#=7/6interline#;
- height# = 5/3interline#+interline#+7/4stafflinethickness#;
- set_char_box(0, cw#+(height#-3/2interline#)/tand(alpha),
+ cw#=7/6staff_space#;
+ height# = 5/3staff_space#+staff_space#+7/4stafflinethickness#;
+ set_char_box(0, cw#+(height#-3/2staff_space#)/tand(alpha),
-yshift#, height# + yshift#);
define_pixels(cw);
save x,y;
x1=w-stem/6;
- y1 = yshift + 2.5 interline + flare/4 + ballcorrection;
+ y1 = yshift + 2.5 staff_space + flare/4 + ballcorrection;
z2-z1=whatever*dir alpha;
y2= yshift + stem/2;
brush(z1,2/3stem,z2,stem);
rest_crook (z1,cw);
z3-z1=whatever*dir alpha;
- y3=y1-interline;
+ y3=y1-staff_space;
rest_crook (z3,cw);
penlabels(1,2);
fet_endchar;
fet_beginchar("32th rest","5","thirtysecondrest");
% draw_staff (-2, 2, 0.0);
save yshift, ballcorrection;
- ballcorrection = 0.005 interline;
+ ballcorrection = 0.005 staff_space;
- yshift# := -2 interline#;
+ yshift# := -2 staff_space#;
define_pixels(yshift);
save alpha,cw,h;
alpha=76;
- cw#=7/6interline#;
- h#=5/3interline#+2interline#+7/4stafflinethickness#;
+ cw#=7/6staff_space#;
+ h#=5/3staff_space#+2staff_space#+7/4stafflinethickness#;
- set_char_box(0, cw#+(h#-3/2interline#)/tand(alpha),
+ set_char_box(0, cw#+(h#-3/2staff_space#)/tand(alpha),
-yshift#,yshift# +h#);
define_pixels(cw);
save x,y;
x1=w-stem/6;
- y1 = yshift + 3.5 interline + flare/4 + ballcorrection;
+ y1 = yshift + 3.5 staff_space + flare/4 + ballcorrection;
z2-z1=whatever*dir alpha;
y2=stem/2 + yshift;
brush(z1,2/3stem,z2,stem);
rest_crook (z1,cw);
z3-z1=whatever*dir alpha;
- y3=y1-interline;
+ y3=y1-staff_space;
rest_crook (z3,cw);
z4-z1=whatever*dir alpha;
- y4=y1-2interline;
+ y4=y1-2staff_space;
rest_crook (z4,cw);
fet_endchar;
fet_beginchar("64th rest","6","sixtyfourthrest");
% draw_staff (-2, 2, 0.0);
save yshift, ballcorrection;
- ballcorrection = 0.005 interline;
+ ballcorrection = 0.005 staff_space;
- yshift# := -3 interline#;
+ yshift# := -3 staff_space#;
define_pixels(yshift);
save alpha,cw,h,w;
alpha=78;
- cw#=7/6interline#;
- h#=5/3interline#+3interline#+7/4stafflinethickness#;
- w#=cw#+(h#-3/2interline#)/tand(alpha);
+ cw#=7/6staff_space#;
+ h#=5/3staff_space#+3staff_space#+7/4stafflinethickness#;
+ w#=cw#+(h#-3/2staff_space#)/tand(alpha);
set_char_box(0,w#,-yshift# ,yshift# + h#);
define_pixels(cw);
save x,y;
x1=w-stem/6;
- y1 = yshift + 4.5 interline + flare/4 + ballcorrection;
+ y1 = yshift + 4.5 staff_space + flare/4 + ballcorrection;
z2-z1=whatever*dir alpha;
y2=stem/2 + yshift;
brush (z1,2/3stem,z2,stem);
rest_crook (z1,cw);
z3-z1=whatever*dir alpha;
- y3=y1-interline;
+ y3=y1-staff_space;
rest_crook (z3,cw);
z4-z1=whatever*dir alpha;
- y4=y1-2interline;
+ y4=y1-2staff_space;
rest_crook (z4,cw);
z5-z1=whatever*dir alpha;
- y5=y1-3interline;
+ y5=y1-3staff_space;
rest_crook (z5,cw);
fet_endchar;
fet_beginchar("128th rest","7","hundredtwentyeighthrest");
% draw_staff (-2, 2, 0.0);
save yshift, ballcorrection;
- ballcorrection = 0.005 interline;
+ ballcorrection = 0.005 staff_space;
- yshift# := -3 interline#;
+ yshift# := -3 staff_space#;
define_pixels(yshift);
save alpha,cw,h,w;
alpha=78;
- cw#=7/6interline#;
- h#=5/3interline#+4interline#+7/4stafflinethickness#;
- w#=cw#+(h#-3/2interline#)/tand(alpha);
+ cw#=7/6staff_space#;
+ h#=5/3staff_space#+4staff_space#+7/4stafflinethickness#;
+ w#=cw#+(h#-3/2staff_space#)/tand(alpha);
set_char_box(0,w#, -yshift#,yshift# + h#);
define_pixels(cw);
save x,y;
x1=w-stem/6;
- y1 = yshift + 5.5 interline + flare/4 + ballcorrection;
+ y1 = yshift + 5.5 staff_space + flare/4 + ballcorrection;
z2-z1=whatever*dir alpha;
y2=stem/2 + yshift;
brush (z1,2/3stem,z2,stem);
rest_crook (z1,cw);
z3-z1=whatever*dir alpha;
- y3=y1-interline;
+ y3=y1-staff_space;
rest_crook (z3,cw);
z4-z1=whatever*dir alpha;
- y4=y1-2interline;
+ y4=y1-2staff_space;
rest_crook (z4,cw);
z5-z1=whatever*dir alpha;
- y5=y1-3interline;
+ y5=y1-3staff_space;
rest_crook (z5,cw);
z6-z1=whatever*dir alpha;
- y6=y1-4interline;
+ y6=y1-4staff_space;
rest_crook (z6,cw);
fet_endchar;
% Rest symbols for mensural notation:
-mensrestsize# = .8interline#;
+mensrestsize# = .8staff_space#;
fet_beginchar("Mensural 4th rest","2mensural","minimarest")
set_char_box(0,mensrestsize#,0,mensrestsize#);
fet_endchar
fet_beginchar("Mensural 16th rest","4mensural","semifusarest")
- set_char_box(0,mensrestsize#,0,interline#);
+ set_char_box(0,mensrestsize#,0,staff_space#);
pickup pencircle scaled 2 stafflinethickness;
rt x1 = w;
bot y1 = 0;
define_pixels (height, width);
thin = 2 stafflinethickness;
- thick = .5 interline;
+ thick = .5 staff_space;
pickup pencircle scaled thin;
lft x1 = 0;
bot y4 = y1 - thick + thin/2;
alpha = 50;
- z5 = z1 + (width, 3/4interline);
+ z5 = z1 + (width, 3/4staff_space);
% need silly z6?
% strange turning path when invoked via MakeTeXTFM...?
% for h := staffsize# step 1 pt# until (1.1 * staffsize#):
for h := staffsize# step 1 pt# until (7 * staffsize#):
- draw_bracket(h, 2interline# );
+ draw_bracket(h, 2staff_space# );
endfor
fet_begingroup("clefs");
%
-% [Ross] says that clefs take 1 interline space on the left and right
+% [Ross] says that clefs take 1 staff_space space on the left and right
%
def set_horizontal_spacing =
save left_space ,right_space;
% "arrow"
def draw_c_clef (expr reduction) =
save hair, norm, reduced_il, right_edge;
- reduced_il#=interline#*reduction;
+ reduced_il#=staff_space#*reduction;
norm#:=2/3reduced_il#;
hair#:=1/6norm#;
def draw_bass_clef(expr exact_center, reduction) =
save reduced_il, left_tilt, left_thick, ball_to_right;
- reduced_il# = interline# * reduction;
+ reduced_il# = staff_space# * reduction;
set_horizontal_spacing;
ball_to_right# = 2.1 reduced_il#;
x3l - x1l = ball_to_right;
x2 = .5 [x1,x3];
x3l - x3r = .48 reduced_il;
- y3l = -0.05 interline;
+ y3l = -0.05 staff_space;
x4 = x1l - stafflinethickness;
y4 = -2.2 reduced_il;
z5 = (x3l + 1/3 reduced_il, .5 reduced_il);
penlabels(1,2,3,4);
save dot_diam;
- 2 dot_diam = reduction* (interline - stafflinethickness);
+ 2 dot_diam = reduction* (staff_space - stafflinethickness);
pickup pencircle scaled dot_diam;
draw z5;
draw z5 yscaled -1;
if test = 1:
draw_staff(-3,1);
fi;
- draw_bass_clef((.5 interline#, 0), 1.0);
+ draw_bass_clef((.5 staff_space#, 0), 1.0);
fet_endchar;
fet_beginchar("F clef (reduced)", "F_change", "cbassclef")
- draw_bass_clef((.4 interline#, 0),0.8);
+ draw_bass_clef((.4 staff_space#, 0),0.8);
fet_endchar;
save reduced_il, downstroke_dir, downstroke_angle, hair, center;
save breapth_factor, inner_thick_end, thinness, thickness, thinnib;
save inner_start_angle, thinness, thinpen;
- reduced_il# = interline# * reduction;
+ reduced_il# = staff_space# * reduction;
define_pixels(reduced_il);
pair downstroke_dir, center;
if test = 1:
draw_staff(-1,3);
fi;
- draw_gclef((1.7 interline#,0), 1.0);
+ draw_gclef((1.7 staff_space#,0), 1.0);
fet_endchar;
fet_beginchar("G clef", "G_change", "ctrebleclef")
- draw_gclef((1.3 interline#,0), .8);
+ draw_gclef((1.3 staff_space#,0), .8);
fet_endchar;
fet_endgroup("clefs");
def draw_staff(expr first, last, offset)=
pickup pencircle scaled stafflinethickness;
for i:= first step 1 until last:
- draw (- interline, (i + offset) * interline) .. (4 interline,( i+ offset)* interline);
+ draw (- staff_space, (i + offset) * staff_space) .. (4 staff_space,( i+ offset)* staff_space);
endfor
enddef;
stafflines = 5;
-interline#:=staffsize#/(stafflines-1);
+staff_space#:=staffsize#/(stafflines-1);
% URG!
-font_x_height interline# ;
+font_x_height staff_space# ;
%
% [D.K.Roush & J.S.Gourlay] say this should be 0.072
% We know better
% generally, the "blackness" of most chars depends on this.
%
-stafflinethickness#:=0.1 interline#;
+stafflinethickness#:=0.1 staff_space#;
stemthickness# := stafflinethickness#;
ledgerlinethickness# := 2 stafflinethickness#;
-define_pixels(interline, stemthickness);
+define_pixels(staff_space, stemthickness);
define_pixels(stafflinethickness,ledgerlinethickness);
%
fet_begingroup("dots");
save dot_diam;
-2 dot_diam# = interline# - stafflinethickness#;
+2 dot_diam# = staff_space# - stafflinethickness#;
define_pixels(dot_diam);
fet_beginchar("duration dot","dot", "dot")
fet_beginchar("repeat dots", "repeatcolon", "repeatcolon")
pickup pencircle scaled dot_diam;
- draw (dot_diam/2, interline/2);
+ draw (dot_diam/2, staff_space/2);
addto currentpicture also currentpicture yscaled -1;
- set_char_box(0, dot_diam#, interline#/2, interline#/2);
+ set_char_box(0, dot_diam#, staff_space#/2, staff_space#/2);
fet_endchar;
% suggest ca 80 degrees iso half-circle
alpha := 10;
- radius# = 1.25 interline#;
+ radius# = 1.25 staff_space#;
crook_thinness# = 1.5stafflinethickness#;
crook_fatness# = 4 stafflinethickness#;
fet_beginchar("Thumb", "thumb", "thumb")
save thin, height, width, thick;
height# = 5/4 width#;
- height# = interline#;
+ height# = staff_space#;
thin = 1.2 stafflinethickness;
thick = 2 thin;
set_char_box(width#/2, width#/2, height#/2, height#/2);
%
% `\accent' is TeX reserved.
fet_beginchar("> accent", "sforzato", "sforzatoaccent")
- set_char_box(.9 interline#, .9 interline#, .5 interline#, .5 interline#);
+ set_char_box(.9 staff_space#, .9 staff_space#, .5 staff_space#, .5 staff_space#);
save thickness, diminish;
thickness = 3/2 stafflinethickness;
def draw_staccatissimo =
save radius, height;
- height# = .8 interline#;
+ height# = .8 staff_space#;
radius# = 2 stafflinethickness#;
define_pixels(radius, height);
thick# = 1.4 stafflinethickness#;
define_pixels(thick);
- set_char_box(.6 interline#, .6 interline#, thick#/2,thick#/2);
+ set_char_box(.6 staff_space#, .6 staff_space#, thick#/2,thick#/2);
pickup pencircle scaled thick;
lft x1 = -b;
rt x2 = w;
def draw_marcato =
save fat_factor, thinness;
- set_char_box(interline#/2, interline#/2, 0, 1.1 interline#);
+ set_char_box(staff_space#/2, staff_space#/2, 0, 1.1 staff_space#);
fat_factor = .3;
thinness = stafflinethickness;
fet_beginchar("open (unstopped)", "open", "ouvert")
save thin, height, width, thick;
height# = 5/4 width#;
- height# = interline#;
+ height# = staff_space#;
thin = 1.2 stafflinethickness;
thick = 1.4 thin;
set_char_box(width#/2, width#/2, height#/2, height#/2);
fet_beginchar("plus (stopped)", "stopped", "plusstop")
save thick, size;
thick = 2 stafflinethickness;
- size# = 1.1 interline#;
+ size# = 1.1 staff_space#;
set_char_box(size#/2, size#/2, size#/2, size#/2);
pickup pencircle scaled thick;
save ht, wd, thick;
thick = 1.4 stafflinethickness;
- wd# = 1.3 interline#;
+ wd# = 1.3 staff_space#;
ht# = 1.6 wd#;
save wd;
define_pixels(wd)
- wd# = 1.5 interline#;
+ wd# = 1.5 staff_space#;
stemthick = 1.2 stafflinethickness;
- set_char_box(wd#/2, wd#/2, 0, 4/3 interline#);
+ set_char_box(wd#/2, wd#/2, 0, 4/3 staff_space#);
beamheight = 4/10 h;
save turndir;
pair turndir;
- wd# = 35/16 interline#;
- ht# = 18/17 interline#;
+ wd# = 35/16 staff_space#;
+ ht# = 18/17 staff_space#;
darkness = 1.20 stafflinethickness;
set_char_box(wd#/2, wd#/2, ht#/2, ht#/2);
ascender_extra# = 1/2 ex#;
ascender# = ascender_extra# + ex#;
- ex# = 1.5 interline#;
+ ex# = 1.5 staff_space#;
kerning# = .75 ex#;
start_nib_angle = 20;
bulb_size = 0.47;
slant = .2;
local_copy(transform)(currenttransform);
- currenttransform := currenttransform slanted slant shifted (- interline, 0) ;
+ currenttransform := currenttransform slanted slant shifted (- staff_space, 0) ;
y1 = ascender;
x1l = 0;
--- z9r{up}
.. z8r{left} .. z7r{z5-z7} -- cycle;
fill r_p;
- set_char_box(interline# , interline#, 0,ascender#);
+ set_char_box(staff_space# , staff_space#, 0,ascender#);
penpos11(1/4 r_fatness, -20);
def draw_heel =
save radius, thickness, wall;
- radius# := .5 interline#;
+ radius# := .5 staff_space#;
define_pixels(radius);
- set_char_box(radius#, radius#, radius#, 2/3 interline#);
+ set_char_box(radius#, radius#, radius#, 2/3 staff_space#);
thickness := 1.5 stafflinethickness;
pickup pencircle scaled thickness;
save ht,wd;
thickness := 1.5 stafflinethickness;
- ht# := 1.5 interline#;
+ ht# := 1.5 staff_space#;
wd# := 1/3 ht#;
define_pixels(ht,wd);
fet_endchar;
fet_beginchar("Repeatsign", "repeatsign", "repeatsign")
- set_char_box(interline#, interline#, interline#, interline#);
+ set_char_box(staff_space#, staff_space#, staff_space#, staff_space#);
save dot_diam;
- 2 dot_diam# = interline# - stafflinethickness#;
+ 2 dot_diam# = staff_space# - stafflinethickness#;
define_pixels(dot_diam);
penpos1(dot_diam,0);
penlabels (1,2);
pickup pencircle scaled dot_diam;
- draw (-interline/2, interline/2);
- draw (interline/2, -interline/2);
+ draw (-staff_space/2, staff_space/2);
+ draw (staff_space/2, -staff_space/2);
fet_endchar;
fet_beginchar("Segno", "segno", "segno")
save turndir;
pair turndir;
- ht# = 3 interline#;
- wd# = 2 interline#;
+ ht# = 3 staff_space#;
+ wd# = 2 staff_space#;
darkness = 1.20 stafflinethickness;
set_char_box(wd#/2, wd#/2, ht#/2, ht#/2);
save thin, thick, codawidth, codaheight;
thin# = 1.2 stafflinethickness#;
thick# = 3.5 stafflinethickness#;
- codawidth# = 2/3 interline#;
- codaheight# = 1 interline#;
+ codawidth# = 2/3 staff_space#;
+ codaheight# = 1 staff_space#;
define_pixels(thin, thick, codawidth, codaheight);
set_char_box(codawidth#+thick#, codawidth#+thick#,
% this file is included by feta-scripts.mf
tfat := 1/2;
-%twidth# := 0.5interline#;
-%theight# := 0.55interline#;
+%twidth# := 0.5staff_space#;
+%theight# := 0.55staff_space#;
% tthin# := stafflinethickness#;
tthin# := 1.6stafflinethickness#;
-twidth# := 2/3interline#;
-theight# := 1/2interline#;
+twidth# := 2/3staff_space#;
+theight# := 1/2staff_space#;
% uhg/ uhuh?
% toverlap# := tfat*twidth#+tthin#;
% mode_setup;
%% staffsize#=16pt#;
-% interline#:=staffsize#/4;
-% stafflinethickness#:=0.1interline#;
+% staff_space#:=staffsize#/4;
+% stafflinethickness#:=0.1staff_space#;
pi:=3.14159;
slurheightlimit#:=staffsize#/2;
slurthick#:=1.8stafflinethickness#;
-define_pixels(staffsize,interline,stafflinethickness);
+define_pixels(staffsize,staff_space,stafflinethickness);
define_pixels(sleur_pen,slurheightlimit,slurthick);
sluralpha:=2slurheightlimit#/pi;
def set_C_width =
save left_width, right_width;
- left_width# := 0.9 interline#;
- right_width# := .7 interline#;
+ left_width# := 0.9 staff_space#;
+ right_width# := .7 staff_space#;
define_pixels(left_width,right_width);
enddef;
hair# := stafflinethickness#;
- bulb_rad# := 0.4 interline#;
+ bulb_rad# := 0.4 staff_space#;
define_pixels(hair, bulb_rad);
left_fatness = 0.55;
x1r = x5r;
- y1r = .45 interline;
- z2 = (0, interline);
+ y1r = .45 staff_space;
+ z2 = (0, staff_space);
z3r = (-left_width, 0);
- z4 = (0, -interline);
- z5r = (right_width - stafflinethickness, -0.4 interline);
+ z4 = (0, -staff_space);
+ z5r = (right_width - stafflinethickness, -0.4 staff_space);
penpos1(hair, 0);
penpos2(stafflinethickness, 90);
- penpos3(left_fatness * interline, 180);
+ penpos3(left_fatness * staff_space, 180);
penpos4(stafflinethickness, -90);
penpos5(hair, -5);
fet_beginchar ("4/4 meter", "C4/4", "fourfourmeter")
set_C_width;
- set_char_box(left_width# + interline#, right_width# + interline#,
- interline#, interline#);
+ set_char_box(left_width# + staff_space#, right_width# + staff_space#,
+ staff_space#, staff_space#);
draw_C;
fet_endchar;
fet_beginchar ("2/2 meter", "C2/2", "allabreve")
set_C_width;
- set_char_box(left_width# + interline#, right_width# + interline#,
- 1.4 interline#, 1.4 interline#);
+ set_char_box(left_width# + staff_space#, right_width# + staff_space#,
+ 1.4 staff_space#, 1.4 staff_space#);
draw_C;
save excentricity;
threequartercircle = halfcircle & quartercircle rotated 180;
save Cdiameter,Cthickness;
-Cdiameter# := 3/2 interline#;
+Cdiameter# := 3/2 staff_space#;
Cthickness# := 2 stafflinethickness#;
define_pixels(Cdiameter,Cthickness);
%% tempus imperfectum cum prolatione imperfecta
fet_beginchar ("Mensural 4/4 meter", "old4/4", "oldfourfourmeter")
- set_char_box(.5 Cdiameter# + interline#, .5 Cdiameter# + interline#,
+ set_char_box(.5 Cdiameter# + staff_space#, .5 Cdiameter# + staff_space#,
.5 Cdiameter#, .5 Cdiameter#);
pickup pencircle scaled Cthickness;
%% tempus imperfectum cum prolatione imperfecta proportio dupla
fet_beginchar ("Mensural 2/2 meter", "old2/2", "oldallabreve")
- set_char_box(.5 Cdiameter# + interline#, .5 Cdiameter# + interline#,
- interline#, interline#);
+ set_char_box(.5 Cdiameter# + staff_space#, .5 Cdiameter# + staff_space#,
+ staff_space#, staff_space#);
pickup pencircle scaled Cthickness;
draw threequartercircle rotated 45 scaled Cdiameter;
%% tempus perfectum cum prolatione imperfecta
fet_beginchar ("Mensural 3/2 meter", "old3/2", "oldthreetwometer")
- set_char_box(.5 Cdiameter# + interline#, .5 Cdiameter# + interline#,
+ set_char_box(.5 Cdiameter# + staff_space#, .5 Cdiameter# + staff_space#,
.5 Cdiameter#, .5 Cdiameter#);
pickup pencircle scaled Cthickness;
%% tempus imperfectum cum prolatione perfecta
fet_beginchar ("Mensural 6/4 meter", "old6/4", "oldsixfourmeter")
- set_char_box(.5 Cdiameter# + interline#, .5 Cdiameter# + interline#,
+ set_char_box(.5 Cdiameter# + staff_space#, .5 Cdiameter# + staff_space#,
.5 Cdiameter#, .5 Cdiameter#);
pickup pencircle scaled Cthickness;
%% tempus perfectum cum prolatione perfecta
fet_beginchar ("Mensural 9/4 meter", "old9/4", "oldninefourmeter")
- set_char_box(.5 Cdiameter# + interline#, .5 Cdiameter# + interline#,
+ set_char_box(.5 Cdiameter# + staff_space#, .5 Cdiameter# + staff_space#,
.5 Cdiameter#, .5 Cdiameter#);
pickup pencircle scaled Cthickness;
%% tempus perfectum cum prolatione imperfecta proportio dupla
fet_beginchar ("Mensural 3/4 meter", "old3/4", "oldthreefourmeter")
- set_char_box(.5 Cdiameter# + interline#, .5 Cdiameter# + interline#,
- interline#, interline#);
+ set_char_box(.5 Cdiameter# + staff_space#, .5 Cdiameter# + staff_space#,
+ staff_space#, staff_space#);
pickup pencircle scaled Cthickness;
draw fullcircle scaled Cdiameter;
%% tempus imperfectum cum prolatione perfecta proportio dupla
fet_beginchar ("Mensural 6/8 meter", "old6/8", "oldsixeightmeter")
- set_char_box(.5 Cdiameter# + interline#, .5 Cdiameter# + interline#,
- interline#, interline#);
+ set_char_box(.5 Cdiameter# + staff_space#, .5 Cdiameter# + staff_space#,
+ staff_space#, staff_space#);
pickup pencircle scaled Cthickness;
draw threequartercircle rotated 45 scaled Cdiameter;
%% tempus perfectum cum prolatione perfecta proportio dupla
fet_beginchar ("Mensural 9/8 meter", "old9/8", "oldnineeight")
- set_char_box(.5 Cdiameter# + interline#, .5 Cdiameter# + interline#,
- interline#, interline#);
+ set_char_box(.5 Cdiameter# + staff_space#, .5 Cdiameter# + staff_space#,
+ staff_space#, staff_space#);
pickup pencircle scaled Cthickness;
draw fullcircle scaled Cdiameter;
%% tempus imperfectum cum prolatione imperfecta diminutio simplex
fet_beginchar ("Mensural 4/8 meter", "old4/8", "oldfoureightmeter")
- set_char_box(.5 Cdiameter# + interline#, .5 Cdiameter# + interline#,
+ set_char_box(.5 Cdiameter# + staff_space#, .5 Cdiameter# + staff_space#,
.5 Cdiameter#, .5 Cdiameter#);
pickup pencircle scaled Cthickness;
%% tempus imperfectum cum prolatione perfecta diminutio simplex
fet_beginchar ("Mensural 6/8 meter", "old6/8alt", "oldsixeightmeteralt")
- set_char_box(.5 Cdiameter# + interline#, .5 Cdiameter# + interline#,
+ set_char_box(.5 Cdiameter# + staff_space#, .5 Cdiameter# + staff_space#,
.5 Cdiameter#, .5 Cdiameter#);
pickup pencircle scaled Cthickness;
%% tempus imperfectum cum prolatione imperfecta diminutio duplex
fet_beginchar ("Mensural 2/4 meter", "old2/4", "oldtwofourmeter")
- set_char_box(.5 Cdiameter# + interline#, .5 Cdiameter# + interline#,
- interline#, interline#);
+ set_char_box(.5 Cdiameter# + staff_space#, .5 Cdiameter# + staff_space#,
+ staff_space#, staff_space#);
pickup pencircle scaled Cthickness;
draw threequartercircle rotated 225 scaled Cdiameter;
% this fact
%
fet_beginchar("Sharp" , "1", "sharp");
- set_char_box(0, 1.1 interline#, 1.5 interline#,
- 1.5 interline#);
+ set_char_box(0, 1.1 staff_space#, 1.5 staff_space#,
+ 1.5 staff_space#);
save interbeam, interstem, beamheight, beamwidth,
stemwidth;
- interbeam := 1.05 interline;
+ interbeam := 1.05 staff_space;
interstem := 7/16 ;
beamheight := 4 stafflinethickness;
beamwidth := w;
pickup pencircle scaled stemwidth;
x3 = x4 = xpart center;
- bot y3 = -1.5 interline + ypart center;
- top y4 = 1.5 interline + ypart center;
+ bot y3 = -1.5 staff_space + ypart center;
+ top y4 = 1.5 staff_space + ypart center;
path stem;
stem := z3 .. z4;
fet_endchar;
fet_beginchar( "Natural", "0", "natural")
- set_char_box(0, 8/12 interline#, 1.5 interline#, 1.5 interline#);
+ set_char_box(0, 8/12 staff_space#, 1.5 staff_space#, 1.5 staff_space#);
save interbeam, interstem, beamheight, beamwidth,
stemwidth;
pickup penrazor scaled beamheight rotated 90;
- top y2 = interline - 3/2 stafflinethickness ;
+ top y2 = staff_space - 3/2 stafflinethickness ;
slope = stafflinethickness / interstem;
draw z1 .. z2;
pickup pencircle scaled stemwidth;
xpart z3 = xpart z1;
xpart z4 = xpart z2;
- top y3 = 1.5 interline;
+ top y3 = 1.5 staff_space;
top y4 = beamtop;
draw (xpart z1, -y4) .. z3;
bottom_stem_thick = 1.2 stafflinethickness;
- z1 = (0, 2 interline) + center;
- z2 = (0, - 1/2 interline)+ center;
+ z1 = (0, 2 staff_space) + center;
+ z2 = (0, - 1/2 staff_space)+ center;
penpos1(top_stem_thick, 0);
penpos2(bottom_stem_thick, 0);
fill simple_serif(z1r, z1l, 30) -- z2l -- z2r -- cycle;
- y3l = (interline - stafflinethickness)/2 + ypart center;
+ y3l = (staff_space - stafflinethickness)/2 + ypart center;
z3l = whatever [z2r,z1r];
z3r = .26 [z2r, z1r];
- z4 = (3/8 interline, interline/2) + center;
+ z4 = (3/8 staff_space, staff_space/2) + center;
penpos4(whatever, 53);
y4l - y4r = 2 crook_thinness ;
% y4l - y4r = 6/20[crook_thinness, crook_fatness] ;
- y5r = 1/4 interline + ypart center;
+ y5r = 1/4 staff_space + ypart center;
x5l = w + xpart center;
penpos5(crook_fatness, -175);
- z8 = (0, - interline/2 - stafflinethickness/2) + center;
+ z8 = (0, - staff_space/2 - stafflinethickness/2) + center;
z9 = (x5,0);
x8r = xpart center - bottom_stem_thick/2;
penlabels(range 0 thru 10);
- z10 = (bottom_stem_thick/2, -1/5 interline) + center;
+ z10 = (bottom_stem_thick/2, -1/5 staff_space) + center;
unfill z3r{up} .. z4r{right} .. tension .9
.. z6r ---
% unfortunately, 600dpi is not enough to show the brush of the stem.
%
fet_beginchar("Flat", "-1", "flat")
- set_char_box(1.2 stafflinethickness#, .8 interline#, .5 interline#, 2 interline#);
- draw_meta_flat(0, w, 1/3 interline);
+ set_char_box(1.2 stafflinethickness#, .8 staff_space#, .5 staff_space#, 2 staff_space#);
+ draw_meta_flat(0, w, 1/3 staff_space);
fet_endchar;
left_wid = .7;
right_wid = .8;
overlap = .05;
- set_char_box(1.2 stafflinethickness#, (left_wid + right_wid -overlap) *interline#, .5 interline#, 2 interline#);
- draw_meta_flat(0, left_wid* interline, 1/3 interline);
- draw_meta_flat((left_wid - overlap) *interline,
- right_wid *interline, 1/3 interline);
+ set_char_box(1.2 stafflinethickness#, (left_wid + right_wid -overlap) *staff_space#, .5 staff_space#, 2 staff_space#);
+ draw_meta_flat(0, left_wid* staff_space, 1/3 staff_space);
+ draw_meta_flat((left_wid - overlap) *staff_space,
+ right_wid *staff_space, 1/3 staff_space);
fet_endchar;
fet_beginchar("Double sharp", "2", "sharpsharp")
- set_char_box(0, interline#, .5 interline#, .5 interline#);
+ set_char_box(0, staff_space#, .5 staff_space#, .5 staff_space#);
save klaverblad, klaversteel;
- klaversteel = 1/15 interline;
- klaverblad = .35 interline;
+ klaversteel = 1/15 staff_space;
+ klaverblad = .35 staff_space;
z1 = (klaversteel, 0);
z2 = (w/2 - klaverblad / 10, h - klaverblad);
z5 = z1 reflectedabout((0,0), (1,1));
labels(1,2,3,4,5);
- pickup pencircle scaled 1/20 interline;
+ pickup pencircle scaled 1/20 staff_space;
filldraw
z1{dir 45} .. {right}z2 -- z3 --
z4{down} .. {dir 225}z5 .. cycle;
def draw_paren =
save leftindent;
- leftindent# := .2 interline#;
+ leftindent# := .2 staff_space#;
define_pixels(leftindent);
- set_char_box(0, .5 interline#+stafflinethickness#,
- interline#, interline#);
+ set_char_box(0, .5 staff_space#+stafflinethickness#,
+ staff_space#, staff_space#);
z1 = (leftindent,h);
z2 = (w-stafflinethickness,0);
z3 = (leftindent,-d);
source file of the LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include <assert.h>
source file of the LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include <assert.h>
source file of the LilyPond music typesetter
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
Han-Wen Nienhuys <hanwen@cs.uu.nl>
source file of the LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.ruu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.ruu.nl>
*/
source file of the LilyPond music typesetter
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#ifndef DURATION_HH
#define DURATION_HH
-#include "fproto.hh"
+#include "flower-proto.hh"
#include "rational.hh"
#include "plet.hh"
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
"midi2ly");
cout << endl;
- cout << _f ("Copyright (c) %s by", "1996--1999");
+ cout << _f ("Copyright (c) %s by", "1996--2000");
cout << "Han-Wen Nienhuys <hanwen@cs.uu.nl>\n"
<< "Jan Nieuwenhuizen <janneke@gnu.org>\n";
}
source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "plet.hh"
#: paper-def.cc:95
#, c-format
msgid "unknown paper variable: `%s'"
-msgstr "onbekende papier varanderlijke: `%s'"
+msgstr "onbekende papier veranderlijke: `%s'"
#: paper-def.cc:99
msgid "not a real variable"
)
)
-(define staff-symbol-properties
+(define generic-staff-symbol-properties
(cons "Staff_symbol" (list
(list 'numberOfStaffLines number? 'line-count)
(list 'staffSpace number? 'staff-space)
generic-timesig-properties
generic-clef-properties
generic-collision-properties
+ generic-staff-symbol-properties
generic-All-properties
)
)
(control->string c)
(string-append
(string-append (number->string (car c)) " ")
- (string-append (number->string (cadr c)) " ")))
+ (string-append (number->string (cdr c)) " ")))
(define (font i)
;; Score_span_bars are only visible at start of line
;; i.e. if break_dir == RIGHT == 1
(define Span_bar_engraver-visibility non-postbreak-visibility)
+(define Base_span_bar_engraver-visibility non-postbreak-visibility)
(define mark-visibility non-prebreak-visibility)
(define Span_score_bar_engraver-visibility postbreak-only-visibility)
(define Piano_bar_engraver-visibility postbreak-only-visibility)