mapping.
(index_to_charcode): New method.
* scm/output-ps.scm (glyph-string):
* scm/output-gnome.scm (glyph-string): Add FONT parameter.
+2004-12-27 Jan Nieuwenhuizen <janneke@gnu.org>
+
+ * lily/pango-font.cc (text_stencil): Quick try at glyph->charcode
+ mapping.
+ (index_to_charcode): New method.
+
+ * scm/output-ps.scm (glyph-string):
+ * scm/output-gnome.scm (glyph-string): Add FONT parameter.
+
2004-12-26 Jan Nieuwenhuizen <janneke@gnu.org>
* scm/output-gnome.scm (FIXME-glyph-string): New function. Cannot
pango_dpi_,
RIGHT,
description);
- val = pf->self_scm();
+ val = pf->self_scm ();
pango_dict_->set (key, val);
scm_gc_unprotect_object (val);
#include "smobs.hh"
#include "lily-proto.hh"
-struct Font_metric
+class Font_metric
{
public:
SCM description_;
int get_encoded_index (Font_metric *m, String input_coding, int code);
-struct Simple_font_metric : public Font_metric
+class Simple_font_metric : public Font_metric
{
public:
-
};
-
-DECLARE_UNSMOB(Font_metric, metrics);
+DECLARE_UNSMOB (Font_metric, metrics);
#endif /* FONT_METRIC_HH */
#include "font-metric.hh"
typedef std::map<FT_UInt, FT_ULong> Index_to_charcode_map;
+Index_to_charcode_map make_index_to_charcode_map (FT_Face face);
class Open_type_font : public Font_metric
{
- FT_Face face_; /* handle to face object */
+ /* handle to face object */
+ FT_Face face_;
SCM lily_subfonts_;
SCM lily_character_table_;
-
/*
pango-font.hh -- declare Pango_font
source file of the GNU LilyPond music typesetter
(c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
*/
#ifndef PANGO_FONT_HH
#include <pango/pangoft2.h>
#include "font-metric.hh"
-struct Pango_font : Font_metric
+#include "open-type-font.hh"
+
+class Pango_font : public Font_metric
{
+ /** handle to face object */
+ FT_Face face_;
PangoContext *context_;
PangoAttrList *attribute_list_;
Real scale_;
SCM subfonts_;
+ Index_to_charcode_map index_to_charcode_map_;
+
public:
- virtual SCM sub_fonts () const;
- SCM font_file_name () const;
- virtual void derived_mark () const;
- void register_font_file (String, String);
- Stencil text_stencil (String) const;
Pango_font (PangoFT2FontMap *,
int dpi,
Direction leftright,
PangoFontDescription *);
~Pango_font ();
+
+ SCM font_file_name () const;
+ void register_font_file (String, String);
+ Stencil text_stencil (String) const;
+
+ virtual SCM sub_fonts () const;
+ virtual void derived_mark () const;
+ virtual int name_to_index (String) const;
+ virtual unsigned index_to_charcode (int) const;
};
-PangoFontDescription*
-symbols_to_pango_font_description(SCM family,
- SCM style,
- SCM variant,
- SCM weight,
- SCM stretch,
- Real size);
+
+PangoFontDescription *
+symbols_to_pango_font_description (SCM family,
+ SCM style,
+ SCM variant,
+ SCM weight,
+ SCM stretch,
+ Real size);
Font_metric *
select_pango_font (Output_def *layout, SCM chain);
-#endif
+#endif /* HAVE_PANGO16 */
+
#endif /* PANGO_FONT_HH */
source file of the GNU LilyPond music typesetter
(c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
*/
#include <map>
FT_Byte *
load_table (char const *tag_str, FT_Face face, FT_ULong *length)
{
- FT_ULong tag = FT_MAKE_TAG(tag_str[0], tag_str[1], tag_str[2], tag_str[3]);
+ FT_ULong tag = FT_MAKE_TAG (tag_str[0], tag_str[1], tag_str[2], tag_str[3]);
int error_code = FT_Load_Sfnt_Table (face, tag, 0, NULL, length);
if (!error_code)
error_code = FT_Load_Sfnt_Table (face, tag, 0, buffer, length );
if (error_code)
- {
- error (_f ("Could not load %s font table", tag_str));
- }
+ error (_f ("Could not load %s font table", tag_str));
return buffer;
}
return tab;
}
-
Index_to_charcode_map
make_index_to_charcode_map (FT_Face face)
{
Pango_font::Pango_font (PangoFT2FontMap *fontmap,
int resolution,
Direction dir,
- PangoFontDescription * description)
+ PangoFontDescription *description)
{
subfonts_ = SCM_EOL;
- PangoDirection pango_dir = (dir==RIGHT)
+ PangoDirection pango_dir = (dir == RIGHT)
? PANGO_DIRECTION_LTR
: PANGO_DIRECTION_RTL;
context_ = pango_ft2_font_map_create_context (fontmap);
pango_context_set_font_description (context_, description);
}
-
Pango_font::~Pango_font ()
{
g_object_unref (context_);
{
scm_gc_mark (subfonts_);
}
+
Stencil
Pango_font::text_stencil (String str) const
{
- GList * items = pango_itemize (context_,
- str.to_str0 (),
- 0, str.length (), attribute_list_,
- NULL);
+ GList *items = pango_itemize (context_,
+ str.to_str0 (),
+ 0, str.length (), attribute_list_,
+ NULL);
const int GLYPH_NAME_LEN = 256;
char glyph_name[GLYPH_NAME_LEN];
- GList * ptr = items;
+ GList *ptr = items;
Stencil dest;
while (ptr)
{
+
+ // FIXME: factor this out
PangoItem *item = (PangoItem*) ptr->data;
PangoAnalysis *pa = &(item->analysis);
- PangoGlyphString *pgs = pango_glyph_string_new();
+ PangoGlyphString *pgs = pango_glyph_string_new ();
pango_shape (str.to_str0 (), str.length (), pa, pgs);
PangoRectangle logical_rect;
pango_glyph_string_extents (pgs, pa->font, NULL, &logical_rect);
- PangoFcFont * fcfont = G_TYPE_CHECK_INSTANCE_CAST(pa->font,
- PANGO_TYPE_FC_FONT,
- PangoFcFont);
+ PangoFcFont *fcfont = G_TYPE_CHECK_INSTANCE_CAST(pa->font,
+ PANGO_TYPE_FC_FONT,
+ PangoFcFont);
FT_Face ftface = pango_fc_font_lock_face (fcfont);
Box b (Interval (0, logical_rect.width),
Interval (0, logical_rect.height));
+ if (!face_)
+ {
+ /* FIXME. This obvious shortcut apparently does not work.
+ It seems there are different faces per text string and a
+ map of face_ and charcode mapping is needed. */
+ Pango_font *barf = (Pango_font*) this;
+ barf->face_ = ftface;
+ barf->index_to_charcode_map_ = make_index_to_charcode_map (face_);
+ }
+
b.translate (Offset (- logical_rect.x, -logical_rect.y));
b.scale (scale_);
scm_from_double (ggeo.y_offset * scale_),
scm_makfrom0str (glyph_name)),
SCM_EOL);
- tail = SCM_CDRLOC(*tail);
+ tail = SCM_CDRLOC (*tail);
}
FcPattern *fcpat = fcfont->font_pattern;
char const *ps_name = FT_Get_Postscript_Name (ftface);
((Pango_font *) this)->register_font_file (filename, ps_name);
- SCM expr = scm_list_3 (ly_symbol2scm ("glyph-string"),
+ SCM expr = scm_list_4 (ly_symbol2scm ("glyph-string"),
+ self_scm (),
scm_makfrom0str (ps_name),
ly_quote_scm (glyph_exprs));
return SCM_BOOL_F;
}
-LY_DEFINE(ly_pango_font_p, "ly:pango-font?",
- 1,0,0,
- (SCM f),
- "Is @var{f} a pango font?")
+int
+Pango_font::name_to_index (String nm) const
+{
+ char *nm_str = (char*) nm.to_str0 ();
+ if (int idx = FT_Get_Name_Index (face_, nm_str))
+ return idx;
+ return -1;
+}
+
+unsigned
+Pango_font::index_to_charcode (int i) const
+{
+ return ((Pango_font*) this)->index_to_charcode_map_[i];
+}
+LY_DEFINE (ly_pango_font_p, "ly:pango-font?",
+ 1, 0, 0,
+ (SCM f),
+ "Is @var{f} a pango font?")
{
return scm_from_bool (dynamic_cast<Pango_font*> (unsmob_metrics (f)));
}
+
#endif
+
(define (fig-to-markup fig-music)
(let* ((align-accs
(eq? #t (ly:context-property context 'alignBassFigureAccidentals)))
- (fig (ly:music-property fig-music 'figure))
- (acc (ly:music-property fig-music 'alteration))
+ (fig (ly:music-property fig-music 'figure))
+ (acc (ly:music-property fig-music 'alteration))
(acc-markup #f)
(fig-markup
(if (markup? fig)
(filter-brackets (1+ i) (cdr figs)
(append
- (if (eq? (ly:music-property (car figs) 'bracket-start) #t)
+ (if (eq? (ly:music-property (car figs) 'bracket-start) #t)
(list i)
'())
- (if (eq? (ly:music-property (car figs) 'bracket-stop) #t)
+ (if (eq? (ly:music-property (car figs) 'bracket-stop) #t)
(list i)
'())
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; type predicates.
-(define-public (number-pair? x)
+(define-public (number-pair? x)
(and (pair? x)
(number? (car x)) (number? (cdr x))))
(define-public (grob-list? x)
(list? x))
-(define-public (moment-pair? x)
+(define-public (moment-pair? x)
(and (pair? x)
(ly:moment? (car x)) (ly:moment? (cdr x))))
(define-public (object-type obj)
(match-predicate obj type-p-name-alist))
-(define-public (type-name predicate)
+(define-public (type-name predicate)
(let ((entry (assoc predicate type-p-name-alist)))
(if (pair? entry) (cdr entry)
"unknown")))
;;;; chord-entry.scm -- Generate chord names for the parser.
;;;;
;;;; source file of the GNU LilyPond music typesetter
-;;;;
+;;;;
;;;; (c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
(define-public (construct-chord root duration modifications)
Notes: natural 11 is left from chord if not explicitly specified.
-Entry point for the parser.
+Entry point for the parser.
"
(let* ((flat-mods (flatten-list modifications))
(set! inversion (cadr mods))
(set! mods (cddr mods))))
(interpret-bass chord mods))
-
+
(define (interpret-bass chord mods)
- "Read /+FOO part. Side effect: BASS is set."
- (if (and (> (length mods) 1) (eq? (car mods) 'chord-bass))
+ "Read /+FOO part. Side effect: BASS is set."
+ (if (and (> (length mods) 1) (eq? (car mods) 'chord-bass))
(begin
(set! bass (cadr mods))
(set! mods (cddr mods))))
(if (pair? mods)
- (scm-error 'chord-format "construct-chord" "Spurious garbage following chord: ~A" mods #f))
+ (scm-error 'chord-format "construct-chord" "Spurious garbage following chord: ~A" mods #f))
chord)
-
+
(define (interpret-removals chord mods)
(define (inner-interpret chord mods)
(if (and (pair? mods) (ly:pitch? (car mods)))
(if (and (pair? mods) (eq? (car mods) 'chord-caret))
(inner-interpret chord (cdr mods))
(interpret-inversion chord mods)))
-
- (define (interpret-additions chord mods)
+
+ (define (interpret-additions chord mods)
"Interpret additions. TODO: should restrict modifier use?"
(cond ((null? mods) chord)
((ly:pitch? (car mods))
0 -1))
(ly:pitch-notename p)
(ly:pitch-alteration p)))
-
+
(define (process-inversion complete-chord)
"Take out inversion from COMPLETE-CHORD, and put it at the bottom.
Return (INVERSION . REST-OF-CHORD).
Side effect: put original pitch in INVERSION.
If INVERSION is not in COMPLETE-CHORD, it will be set as a BASS, overriding
-the bass specified.
+the bass specified.
"
(let* ((root (car complete-chord))
rest-of-chord)))
;; root is always one octave too low.
;; something weird happens when this is removed,
- ;; every other chord is octavated. --hwn... hmmm.
+ ;; every other chord is octavated. --hwn... hmmm.
(set! root (ly:pitch-transpose root (ly:make-pitch 1 0 0)))
;; skip the leading : , we need some of the stuff following it.
(if (pair? flat-mods)
- (if (eq? (car flat-mods) 'chord-colon)
+ (if (eq? (car flat-mods) 'chord-colon)
(set! flat-mods (cdr flat-mods))
(set! start-additions #f)))
;; remember modifier
(begin
(set! lead-mod (car flat-mods))
(set! flat-mods (cdr flat-mods))))
- ;; extract first number if present, and build pitch list.
+ ;; extract first number if present, and build pitch list.
(if (and (pair? flat-mods)
(ly:pitch? (car flat-mods))
(not (eq? lead-mod sus-modifier)))
(get-step 3 complete-chord)
(= 0 (ly:pitch-alteration (get-step 11 complete-chord)))
(= 0 (ly:pitch-alteration (get-step 3 complete-chord))))
- (set! complete-chord (remove-step 11 complete-chord)))
+ (set! complete-chord (remove-step 11 complete-chord)))
;; must do before processing inversion/bass, since they are
- ;; not relative to the root.
+ ;; not relative to the root.
(set! complete-chord (map (lambda (x) (ly:pitch-transpose x root))
complete-chord))
(if inversion
(write-me "\n*******\n" flat-mods)
(write-me "root: " root)
(write-me "base chord: " base-chord)
- (write-me "complete chord: " complete-chord)
+ (write-me "complete chord: " complete-chord)
(write-me "inversion: " inversion)
(write-me "bass: " bass)))
(if inversion
UPPER-STEP separately."
(cond ((null? base) '())
((> (ly:pitch-steps upper-step) (ly:pitch-steps (car base)))
- (cons (car base) (stack-thirds upper-step (cdr base))))
+ (cons (car base) (stack-thirds upper-step (cdr base))))
((<= (ly:pitch-steps upper-step) (ly:pitch-steps (car base)))
(list upper-step))
(else '())))
nn)))
(define (is-natural-alteration? p)
- (= (natural-chord-alteration p) (ly:pitch-alteration p)))
+ (= (natural-chord-alteration p) (ly:pitch-alteration p)))
(define (ignatzek-format-chord-name
root
(alterations '()))
(if exception
- (ignatzek-format-exception root exception bass-note)
+ (ignatzek-format-exception root exception bass-note)
(begin
;; no exception.
;; handle sus4 and sus2 suffix: if there is a 3 together with
- ;; sus2 or sus4, then we explicitly say add3.
+ ;; sus2 or sus4, then we explicitly say add3.
(map
(lambda (j)
(if (get-step j pitches)
(begin
(set! add-steps (cons (get-step 3 pitches) add-steps))
(set! pitches (remove-step 3 pitches))))
- (set! suffixes (cons (get-step j pitches) suffixes)))))
+ (set! suffixes (cons (get-step j pitches) suffixes)))))
'(2 4))
;; do minor-3rd modifier.
(make-normal-size-super-markup
(accidental->markup (cdr n-a)))))))
-(define-public (note-name->german-markup pitch)
+(define-public (note-name->german-markup pitch)
(let* ((name (ly:pitch-notename pitch))
(alt (ly:pitch-alteration pitch))
(n-a (if (member (cons name alt) `((6 . ,FLAT) (6 . ,DOUBLE-FLAT)))
(make-line-markup
(list
(string-append
- (list-ref '("c" "d" "e" "f" "g" "a" "h" "b") (car n-a))
+ (list-ref '("c" "d" "e" "f" "g" "a" "h" "b") (car n-a))
(if (or (equal? (car n-a) 2) (equal? (car n-a) 5))
- (list-ref '( "ses" "s" "" "is" "isis") (+ 2 (/ (cdr n-a) 2)))
+ (list-ref '( "ses" "s" "" "is" "isis") (+ 2 (/ (cdr n-a) 2)))
(list-ref '("eses" "es" "" "is" "isis") (+ 2 (/ (cdr n-a) 2)))))))))
;; fixme we should standardize on omit-root (or the other one.)
-;; perhaps the default should also be reversed --hwn
+;; perhaps the default should also be reversed --hwn
(define-public (sequential-music-to-chord-exceptions seq . rest)
"Transform sequential music SEQ of type <<c d e>>-\\markup{ foobar }
to (cons CDE-PITCHES FOOBAR-MARKUP), or to (cons DE-PITCHES
;;;; clef.scm -- Clef settings
;;;;
;;;; source file of the GNU LilyPond music typesetter
-;;;;
+;;;;
;;;; (c) 2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
("percussion" . ("clefs.percussion" 0 0))
("tab" . ("clefs.tab" 0 0))
- ;; should move mensural stuff to separate file?
+ ;; should move mensural stuff to separate file?
("vaticana-do1" . ("clefs.vaticana-do" -1 0))
("vaticana-do2" . ("clefs.vaticana-do" 1 0))
("vaticana-do3" . ("clefs.vaticana-do" 3 0))
(- (string->number (match:substring match 3)) 1)))))
(set! e (assoc clef-name supported-clefs))
(if (pair? e)
- (let* ((musics (map make-prop-set
+ (let* ((musics (map make-prop-set
`(((symbol . clefGlyph) (value . ,(cadr e)))
((symbol . middleCPosition)
(value . ,(+ oct
(define (translator-property-description symbol type? description)
(if (not (equal? #f (object-property symbol 'translation-doc)))
(begin
- (ly:warn "Redefining ~S " symbol)
+ (ly:warn "Redefining ~S " symbol)
(exit 2)))
(set-object-property! symbol 'translation-type? type?)
(alignBassFigureAccidentals ,boolean?
"If true, then the accidentals are aligned in bass figure context.")
- (allowBeamBreak ,boolean? "If true allow line breaks for beams over bar lines.")
+ (allowBeamBreak ,boolean? "If true allow line breaks for beams over bar lines.")
(associatedVoice ,string? "Name of the
@code{Voice} that has the melody for this @code{Lyrics} line.")
(autoBeamSettings ,list? "Specifies
@example
@@lilypond[fragment,verbatim,center]
-r1 r1*3 R1*3 \\\\property Score.skipBars= ##t r1*3 R1*3
+r1 r1*3 R1*3 \\\\property Score.skipBars= ##t r1*3 R1*3
@@end lilypond
@end example
")
(skipTypesetting ,boolean?
"When true, all no typesetting is done, speeding
-up the interpretation phase. This speeds up debugging large scores.")
+up the interpretation phase. This speeds up debugging large scores.")
(soloIIText ,string? "text for begin of solo for voice ``two'' when part-combining.")
(soloText ,string? "text for begin of solo when part-combining.")
(squashedPosition ,integer? " Vertical position of
(tupletSpannerDuration ,ly:moment? "
Normally a tuplet bracket is as wide as the
-@code{\\times} expression that gave rise to it. By setting this
-property, you can make brackets last shorter. Example
+@code{\\times} expression that gave rise to it. By setting this
+property, you can make brackets last shorter. Example
@example
@@lilypond[verbatim,fragment]
@end example
-This does not work for Voice or any other context that doesn't form a
+This does not work for Voice or any other context that doesn't form a
vertical group.")
(verticallySpacedContexts ,list? "List of symbols, containing
(localKeySignature ,list? "the key signature at this point in the
measure. The format is the same as for keySignature, but can also
contain ((@var{octave} . @var{name}) . (@var{alter} . @var{barnumber}))
-pairs. It is reset at every bar line." )
+pairs. It is reset at every bar line.")
(localKeySignatureChanges ,list? "Experimental. [DOCME]")
conses. This is for internal (C++) use only. This property contains
the grobs which are still busy (e.g. note heads, spanners, etc.)
")
- (barCheckLastFail ,ly:moment? "Where in the measure did the last barcheck fail?")
+ (barCheckLastFail ,ly:moment? "Where in the measure did the last barcheck fail?")
(associatedVoiceContext ,ly:context? "The context object of the Voice that has the melody for this Lyrics.")
(acceptHashTable ,vector? "Internal
variable: store table with MusicName to Engraver entries.")
(ly:add-interface
'vertically-spaceable-interface
"Objects that should be kept at constant vertical distances. Typically:
-@internalsref{VerticalAxisGroup} objects of @internalsref{Staff} contexts."
+@internalsref{VerticalAxisGroup} objects of @internalsref{Staff} contexts."
'())
arrow on the arpeggio squiggly line.")
(auto-knee-gap ,ly:dimension? "If a gap is found between note heads
-where a horizontal beam fits that is larger than this number, make a kneed beam.")
+where a horizontal beam fits that is larger than this number, make a kneed beam.")
(axes ,list? "list of axis numbers.
In the case of alignment grobs, this should contain only one number.")
(beamed-extreme-minimum-free-lengths ,list? "list of extreme minimum free stem lengths (chord to beams) given beam multiplicity.")
(beamed-stem-shorten ,list? "How much to shorten beamed stems,
-when their direction is forced. It is a list, since the value is different
+when their direction is forced. It is a list, since the value is different
depending on the number flags/beams.")
(beaming ,pair?
"Pair of number lists. Each number list specifies which
direction of a beam. Choices include:
@table @code
-@item beam-dir-majority
+@item beam-dir-majority
number count of up or down notes
@item beam-dir-mean
mean center distance of all notes
-@item beam-dir-median.
+@item beam-dir-median.
mean center distance weighted per note
@end table
(interfaces ,list? "list of symbols indicating the interfaces supported by this object. Is initialized from the @code{meta} field.")
(shorten ,ly:dimension? "The amount of space that a
stem. Internally used to distribute beam shortening over stems. ")
- (slur ,ly:grob? "A pointer to a slur object")
+ (slur ,ly:grob? "A pointer to a slur object")
(use-breve-rest ,boolean? "Use breve rests for measures longer
than a whole rest.")
-;;;; define-grobs.scm --
+;;;; define-grobs.scm --
;;;;
;;;; source file of the GNU LilyPond music typesetter
-;;;;
+;;;;
;;;; (c) 1998--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
;;;; Jan Nieuwenhuizen <janneke@gnu.org>
;;;; staffspace (distances)
;;;; WARNING: the meta field should be the last one.
-;;;; WARNING: don't use anonymous functions for initialization.
+;;;; WARNING: don't use anonymous functions for initialization.
;; TODO: junk the meta field in favor of something more compact?
(define-public all-grob-descriptions
(Accidental
. (
(print-function . ,Accidental_interface::print)
- (inside-slur . #t)
+ (inside-slur . #t)
(cautionary-style . parentheses)
(after-line-breaking-callback . ,Accidental_interface::after_line_breaking) (meta . ((interfaces . (item-interface accidental-interface
font-interface))))
))
-
+
(AccidentalPlacement
. ((X-extent-callback . ,Axis_group_interface::group_extent_callback)
(left-padding . 0.2)
(clef . (extra-space . 0.5))
(key-signature . (extra-space . 0.0))
(staff-bar . (extra-space . 0.0))
- (time-signature . (extra-space . 0.0))
+ (time-signature . (extra-space . 0.0))
(first-note . (fixed-space . 0.0))
))
(breakable . #t)
(break-align-symbol . ambitus)
(break-visibility . ,begin-of-line-visible)
- (meta . ((interfaces . (axis-group-interface break-aligned-interface ambitus-interface item-interface ))))
+ (meta . ((interfaces . (axis-group-interface break-aligned-interface ambitus-interface item-interface))))
))
(AmbitusLine
(join-heads . #t)
(thickness . 2)
(X-offset-callbacks . (,Self_alignment_interface::centered_on_parent))
-
- (meta . ((interfaces . (ambitus-interface staff-symbol-referencer-interface item-interface font-interface))))
+
+ (meta . ((interfaces . (ambitus-interface staff-symbol-referencer-interface item-interface font-interface))))
))
(AmbitusAccidental
. (
(font-family . music)
(padding . 0.5)
(X-offset-callbacks . (,Side_position_interface::aligned_side))
- (direction . -1)
+ (direction . -1)
(cautionary-style . parentheses)
(after-line-breaking-callback . ,Accidental_interface::after_line_breaking) (meta . ((interfaces . (item-interface accidental-interface break-aligned-interface side-position-interface font-interface))))
))
-
+
(AmbitusNoteHead
. (
(duration-log . 2)
(style . default)
(print-function . ,Note_head::print)
(glyph-name-procedure . ,find-notehead-symbol)
- (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
+ (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
(meta . ((interfaces . (font-interface note-head-interface
ambitus-interface
staff-symbol-referencer-interface
ledgered-interface
item-interface ))))
))
-
+
(Arpeggio
. (
(X-extent-callback . ,Arpeggio::width_callback)
- (Y-extent-callback . #f)
+ (Y-extent-callback . #f)
(print-function . ,Arpeggio::print)
(Y-offset-callbacks . (,Staff_symbol_referencer::callback))
(X-offset-callbacks . (,Side_position_interface::aligned_side))
(direction . -1)
- (padding . 0.5)
+ (padding . 0.5)
(staff-position . 0.0)
(meta . ((interfaces . (arpeggio-interface staff-symbol-referencer-interface side-position-interface item-interface font-interface))))
))
(glyph . "|")
(break-glyph-function . ,default-break-barline)
(bar-size-procedure . ,Bar_line::get_staff_bar_size)
- (print-function . ,Bar_line::print)
+ (print-function . ,Bar_line::print)
(break-visibility . ,all-visible)
(breakable . #t)
(before-line-breaking-callback . ,Bar_line::before_line_breaking)
(space-alist . (
- (time-signature . (extra-space . 0.75))
+ (time-signature . (extra-space . 0.75))
(custos . (minimum-space . 2.0))
- (clef . (minimum-space . 1.0))
+ (clef . (minimum-space . 1.0))
(key-signature . (extra-space . 1.0))
(key-cancellation . (extra-space . 1.0))
(first-note . (fixed-space . 1.3))
;; Ross. page 151 lists other values, we opt for a leaner look
;;
;; TODO:
- ;; kern should scale with linethickness too.
+ ;; kern should scale with linethickness too.
(kern . 3.0)
(thin-kern . 3.0)
(hair-thickness . 1.9)
(thick-thickness . 6.0)
- (meta . ((interfaces . (bar-line-interface item-interface break-aligned-interface font-interface))))
+ (meta . ((interfaces . (bar-line-interface item-interface break-aligned-interface font-interface))))
))
-
+
(BarNumber
. (
(print-function . ,Text_interface::print)
(X-offset-callbacks . (,Self_alignment_interface::aligned_on_self))
(self-alignment-X . 1)
- ;; hmm. why did we do this: ?
+ ;; hmm. why did we do this: ?
(extra-offset . (1.3 . 0))
(meta .
((interfaces . (side-position-interface
text-interface
self-alignment-interface
- font-interface item-interface break-aligned-interface))))
+ font-interface item-interface break-aligned-interface))))
))
(BreakAlignGroup
. (
- (axes . (0))
+ (axes . (0))
(X-offset-callbacks . (,Break_align_interface::alignment_callback))
(X-extent-callback . ,Axis_group_interface::group_extent_callback)
(meta . ((interfaces . (break-aligned-interface item-interface axis-group-interface item-interface ))))
(key-signature . (minimum-space . 1.5))
(staff-bar . (minimum-space . 1.5))
(clef . (minimum-space . 2.0))
- (first-note . (fixed-space . 1.0)) ;huh?
+ (first-note . (fixed-space . 1.0)) ;huh?
(right-edge . (extra-space . 0.1))
))
(print-function . ,Text_interface::print)
(print-function . ,Clef::print)
(before-line-breaking-callback . ,Clef::before_line_breaking)
(breakable . #t)
- (font-family . music)
+ (font-family . music)
(break-align-symbol . clef)
(break-visibility . ,begin-of-line-visible)
(space-alist . ((ambitus . (extra-space . 2.0))
(next-note . (extra-space . 0.5))
(right-edge . (extra-space . 0.5))
))
- (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
+ (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
(meta . ((interfaces . (clef-interface staff-symbol-referencer-interface font-interface break-aligned-interface item-interface ))))
))
-
+
(ClusterSpannerBeacon
. (
(print-function . #f)
(Y-extent-callback . ,Cluster_beacon::height)
(meta . ((interfaces . (cluster-beacon-interface item-interface))))
))
-
+
(ClusterSpanner
. (
(print-function . ,Cluster::print)
))
(DynamicTextSpanner
. ((print-function . ,Dynamic_text_spanner::print)
- (font-series . bold)
+ (font-series . bold)
(font-shape . italic)
(style . dashed-line)
; need to blend with dynamic texts.
(font-size . 2)
- (bound-padding . 0.75)
+ (bound-padding . 0.75)
(dash-fraction . 0.2)
(dash-period . 3.0)
(meta . ((interfaces . (font-interface
- text-interface
+ text-interface
dynamic-interface dynamic-text-spanner-interface
item-interface))))
))
-
+
(DynamicLineSpanner
. (
(axes . (1))
(LeftEdge
. (
(break-align-symbol . left-edge)
- (X-extent . (0 . 0))
+ (X-extent . (0 . 0))
(breakable . #t)
(space-alist . (
(custos . (extra-space . 0.0))
(ambitus . (extra-space . 2.0))
- (time-signature . (extra-space . 0.0))
+ (time-signature . (extra-space . 0.0))
(staff-bar . (extra-space . 0.0))
- (breathing-sign . (minimum-space . 0.0))
+ (breathing-sign . (minimum-space . 0.0))
(clef . (extra-space . 0.85))
(first-note . (fixed-space . 1.0))
(right-edge . (extra-space . 0.0))
(zigzag-width . 0.75)
(breakable . #t)
(X-extent-callback . #f)
- (Y-extent-callback . #f)
+ (Y-extent-callback . #f)
(after-line-breaking-callback . ,Line_spanner::after_line_breaking)
(print-function . ,Line_spanner::print)
(meta . ((interfaces . (line-interface line-spanner-interface spanner-interface))))
(Y-offset-callbacks . (,Side_position_interface::aligned_side))
(padding . 0.2)
(direction . -1)
- (bracket-flare . (0.5 . 0.5))
+ (bracket-flare . (0.5 . 0.5))
(meta . ((interfaces . (horizontal-bracket-interface
side-position-interface
line-interface
(baseline-skip . 2)
(meta . ((interfaces . (font-interface self-alignment-interface side-position-interface text-interface break-aligned-interface item-interface ))))
))
-
+
(VocalName
. (
(breakable . #t)
(print-function . ,Key_signature_interface::print)
(space-alist . (
(time-signature . (extra-space . 1.25))
- (staff-bar . (extra-space . 0.6))
+ (staff-bar . (extra-space . 0.6))
(key-signature . (extra-space . 0.5))
(right-edge . (extra-space . 0.5))
(first-note . (fixed-space . 2.5))
(print-function . ,Key_signature_interface::print)
(space-alist . (
(time-signature . (extra-space . 1.25))
- (staff-bar . (extra-space . 1.1))
+ (staff-bar . (extra-space . 1.1))
(right-edge . (extra-space . 0.5))
(first-note . (fixed-space . 2.5))
))
(print-function . ,Ledger_line_spanner::print)
(meta . ((interfaces . (spanner-interface ledger-line-interface))))
))
-
+
(LigatureBracket
. (
(ligature-primitive-callback . ,Note_head::print)
(before-line-breaking-callback . ,Tuplet_bracket::before_line_breaking)
(after-line-breaking-callback . ,Tuplet_bracket::after_line_breaking)
(print-function . ,Tuplet_bracket::print)
- (meta . ((interfaces . (tuplet-bracket-interface line-interface spanner-interface))))
+ (meta . ((interfaces . (tuplet-bracket-interface line-interface spanner-interface))))
))
(LyricHyphen
(length . 0.66)
(spacing-procedure . ,Hyphen_spanner::set_spacing_rods)
(print-function . ,Hyphen_spanner::print)
- (Y-extent . (0 . 0))
+ (Y-extent . (0 . 0))
(meta . ((interfaces . (lyric-interface lyric-hyphen-interface
spanner-interface))))
))
(padding . 1)
(meta . ((interfaces . (multi-measure-rest-interface multi-measure-interface rest-interface font-interface staff-symbol-referencer-interface))))
))
-
+
(MultiMeasureRestNumber
. (
(print-function . ,Text_interface::print)
(print-function . ,Note_head::print)
(ligature-primitive-callback . ,Note_head::print)
(glyph-name-procedure . ,find-notehead-symbol)
- (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
+ (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
(stem-attachment-function . ,note-head-style->attachment-coordinates)
(meta . ((interfaces . (rhythmic-grob-interface
rhythmic-head-interface font-interface note-head-interface
(gap . 0.5)
(breakable . #t)
(X-extent-callback . #f)
- (Y-extent-callback . #f)
+ (Y-extent-callback . #f)
(print-function . ,Line_spanner::print)
(after-line-breaking-callback . ,Line_spanner::after_line_breaking)
(meta . ((interfaces . (line-spanner-interface line-interface spanner-interface))))
; (print-function . ,Paper_column::print) (font-name . "ecrm8") (Y-extent-callback . #f)
- (meta . ((interfaces . (paper-column-interface axis-group-interface spaceable-grob-interface item-interface ))))
+ (meta . ((interfaces . (paper-column-interface axis-group-interface spaceable-grob-interface item-interface ))))
))
(PercentRepeat
(slope . 1.0)
(thickness . 0.48)
(font-encoding . fetaMusic)
- (meta . ((interfaces . (multi-measure-rest-interface spanner-interface font-interface percent-repeat-interface))))
+ (meta . ((interfaces . (multi-measure-rest-interface spanner-interface font-interface percent-repeat-interface))))
))
- (PianoPedalBracket ;; an example of a text spanner
+ ;; an example of a text spanner
+ (PianoPedalBracket
. (
(print-function . ,Piano_pedal_bracket::print)
(style . line)
(Y-extent-callback . ,Hara_kiri_group_spanner::y_extent)
(remove-first . #t)
(axes . (1))
- (meta . ((interfaces . (axis-group-interface vertically-spaceable-interface hara-kiri-group-interface item-interface spanner-interface))))
+ (meta . ((interfaces . (axis-group-interface vertically-spaceable-interface hara-kiri-group-interface item-interface spanner-interface))))
))
(RepeatSlash
(SpacingSpanner
. (
- (spacing-procedure . ,Spacing_spanner::set_springs)
+ (spacing-procedure . ,Spacing_spanner::set_springs)
(grace-space-factor . 0.6)
(shortest-duration-space . 2.0)
(spacing-increment . 1.2)
(SpanBar
. (
(break-align-symbol . staff-bar)
- (bar-size-procedure . ,Span_bar::get_bar_size)
+ (bar-size-procedure . ,Span_bar::get_bar_size)
(print-function . ,Span_bar::print)
(X-extent-callback . ,Span_bar::width_callback)
(Y-extent-callback . ())
(breakable . #t)
(before-line-breaking-callback . ,Span_bar::before_line_breaking)
- ;; ugh duplication!
+ ;; ugh duplication!
;;
;; Ross. page 151 lists other values, we opt for a leaner look
- ;;
+ ;;
(kern . 3.0)
(thin-kern . 3.0)
(hair-thickness . 1.6)
(font-series . bold)
(padding . 1.0)
(X-offset-callbacks . (,Side_position_interface::aligned_side))
- (direction . ,LEFT)
+ (direction . ,LEFT)
(meta . ((interfaces . (side-position-interface stanza-number-interface text-interface font-interface item-interface ))))
))
(padding . 0.0) ;; padding relative to SostenutoPedalLineSpanner
(font-shape . italic)
(self-alignment-X . 0)
- (meta . ((interfaces . (text-interface self-alignment-interface font-interface item-interface))))
+ (meta . ((interfaces . (text-interface self-alignment-interface font-interface item-interface))))
))
- (SostenutoPedalLineSpanner
+ (SostenutoPedalLineSpanner
. (
(axes . (1))
(Y-extent-callback . ,Axis_group_interface::group_extent_callback)
(padding . 1.2)
(minimum-space . 1.0)
(direction . -1)
- (meta . ((interfaces . (piano-pedal-interface axis-group-interface side-position-interface spanner-interface))))
+ (meta . ((interfaces . (piano-pedal-interface axis-group-interface side-position-interface spanner-interface))))
))
(StaffSymbol
. (
(print-function . ,Staff_symbol::print)
(line-count . 5)
- (ledger-line-thickness . (1.0 . 0.1))
+ (ledger-line-thickness . (1.0 . 0.1))
(layer . 0)
(meta . ((interfaces . (staff-symbol-interface spanner-interface))))
))
(meta . ((interfaces . (piano-pedal-interface text-spanner-interface text-interface self-alignment-interface font-interface item-interface))))
))
- (SustainPedalLineSpanner
+ (SustainPedalLineSpanner
. (
(axes . (1))
(Y-extent-callback . ,Axis_group_interface::group_extent_callback)
(Y-offset-callbacks . (,Side_position_interface::aligned_side))
(X-offset-callbacks . (,Self_alignment_interface::aligned_on_self))
(direction . 1)
- (extra-offset . (-1 . 0))
+ (extra-offset . (-1 . 0))
(padding . 0.5)
(staff-padding . 0.5)
(script-priority . 200)
;; todo: add X self alignment?
(baseline-skip . 2)
(font-series . bold)
- (meta . ((interfaces . (text-script-interface text-interface side-position-interface font-interface item-interface ))))
+ (meta . ((interfaces . (text-script-interface text-interface side-position-interface font-interface item-interface ))))
))
(TextSpanner
. (
(Y-offset-callbacks . (,Side_position_interface::aligned_side))
(meta . ((interfaces . (text-spanner-interface side-position-interface font-interface spanner-interface))))
))
-
+
(OttavaBracket
. (
(Y-offset-callbacks . (,Side_position_interface::aligned_side))
(font-shape . italic)
(shorten-pair . (0.0 . -0.6))
(staff-padding . 1.0)
- (padding . 0.5)
+ (padding . 0.5)
(minimum-length . 1.0)
(dash-fraction . 0.3)
(edge-height . (0 . 1.2))
line-interface side-position-interface
font-interface text-interface spanner-interface))))
))
-
+
(TabNoteHead
. (
(style . default)
(print-function . ,Text_interface::print)
- (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
+ (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
(extra-offset . (0 . -0.65)) ;; UGH! TODO: Clean this up!
(stem-attachment-function . ,tablature-stem-attachment-function)
(meta . ((interfaces
(thickness . 1.2)
(x-gap . -0.1)
(y-offset . 0.6)
- (minimum-length . 2.5)
+ (minimum-length . 2.5)
(meta . ((interfaces . (tie-interface spanner-interface))))
))
(space-alist . (
(first-note . (fixed-space . 2.0))
(right-edge . (extra-space . 0.5))
- (staff-bar . (minimum-space . 2.0))
+ (staff-bar . (minimum-space . 2.0))
))
(breakable . #t)
(style . C)
-; (text . (,time-signature-glue-markup))
+; (text . (,time-signature-glue-markup))
(meta . ((interfaces . (time-signature-interface break-aligned-interface font-interface item-interface ))))
))
(font-series . bold)
(font-size . -2)
- (meta . ((interfaces . (text-interface line-interface tuplet-bracket-interface font-interface spanner-interface))))
+ (meta . ((interfaces . (text-interface line-interface tuplet-bracket-interface font-interface spanner-interface))))
))
(UnaCordaPedal
(meta . ((interfaces . (text-interface self-alignment-interface font-interface item-interface ))))
))
- (UnaCordaPedalLineSpanner
+ (UnaCordaPedalLineSpanner
. (
(axes . (1))
(Y-extent-callback . ,Axis_group_interface::group_extent_callback)
(padding . 1)
(font-encoding . fetaNumber)
(Y-offset-callbacks . (,Side_position_interface::aligned_side))
- (thickness . 1.6) ; linethickness
- (height . 2.0) ; staffspace;
+ (thickness . 1.6) ;; linethickness
+ (height . 2.0) ;; staffspace;
(minimum-space . 5)
(font-size . -4)
(meta . ((interfaces . (volta-bracket-interface line-interface text-interface side-position-interface font-interface spanner-interface))))
))
-
+
(VerticalAlignment
. (
(axes . (1))
(Y-extent-callback . ,Axis_group_interface::group_extent_callback)
(X-extent-callback . ,Axis_group_interface::group_extent_callback)
(stacking-dir . -1)
- ;; (threshold . (6 . 1000))
+ ;; (threshold . (6 . 1000))
(meta . ((interfaces . (align-interface axis-group-interface spanner-interface))))
))
(set! all-grob-descriptions (map completize-grob-entry all-grob-descriptions))
-;; (display (map pair? all-grob-descriptions))
+;; (display (map pair? all-grob-descriptions))
;; make sure that \property Foo.Bar =\turnOff doesn't complain
(map (lambda (x)
;; (display (car x)) (newline)
-
+
(set-object-property! (car x) 'translation-type? list?)
(set-object-property! (car x) 'is-grob? #t))
all-grob-descriptions)
(ly:warn "No systems found in \\score markup. Did you forget \\layout?")
empty-markup)
(begin
- (let* ((stencil (ly:paper-system-stencil (vector-ref systems 0))))
+ (let* ((stencil (ly:paper-system-stencil (vector-ref systems 0))))
(ly:stencil-align-to! stencil Y CENTER)
stencil)))))
@verbatim
gsave /ecrm10 findfont
10.0 output-scale div
- scalefont setfont 90 rotate (hello) show grestore
+ scalefont setfont 90 rotate (hello) show grestore
@end verbatim
"
;; FIXME
(ly:make-stencil
(list 'embedded-ps str)
- '(0 . 0) '(0 . 0) ))
+ '(0 . 0) '(0 . 0)))
;;(def-markup-command (fill-line layout props line-width markups)
;; (number? markup-list?)
(map (lambda (stc)
(if (ly:stencil-empty? stc)
point-stencil
- stc)) orig-stencils))
+ stc)) orig-stencils))
(text-width (apply +
(map (lambda (stc)
(if (ly:stencil-empty? stc)
"LilyPondBraces"
family)))
+(define (pango-font-name font)
+ (debugf "FONT-NAME:~S:~S\n" (ly:font-name font) (ly:font-design-size font))
+ (debugf "FONT-FAMILY:~S:~S\n" (font-family font) (otf-name-mangling font (font-family font)))
+ (otf-name-mangling font (font-family font)))
+
+(define (pango-font-size font)
+ (let* ((designsize (ly:font-design-size font))
+ (magnification (* (ly:font-magnification font)))
+
+ ;;font-name: "GNU-LilyPond-feta-20"
+ ;;font-file-name: "feta20"
+ ;;pango-font-name: "lilypond-feta, regular 32"
+ ;;OPS:2.61
+ ;;scaling:29.7046771653543
+ ;;magnification:0.569055118110236
+ ;;design:20.0
+
+ ;; ugh, experimental sizing
+ ;; where does factor ops come from?
+ ;; Hmm, design size: 26/20
+ (ops 2.60)
+
+ (scaling (* ops magnification designsize)))
+ (debugf "OPS:~S\n" ops)
+ (debugf "scaling:~S\n" scaling)
+ (debugf "magnification:~S\n" magnification)
+ (debugf "design:~S\n" designsize)
+
+ scaling))
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Wrappers from guile-gnome TLA
;;; guile-gnome-devel@gnu.org--2004
;; FIXME: the framework-gnome backend needs to see every item that
;; gets created. All items created here must should be put in a group
;; that gets returned.
-(define (FIXME-glyph-string postscript-font-name named-glyphs)
+(define (glyph-string font postscript-font-name x-y-named-glyphs)
(for-each
(lambda (x)
+
+ ;; UGR, glyph names not found
+ (stderr "GLYPH:~S\n" (caddr x))
+ (stderr "ID:~S\n" (ly:font-glyph-name-to-charcode font (caddr x)))
(placebox (car x) (cadr x)
(make <gnome-canvas-text>
#:parent (canvas-root)
#:x 0.0 #:y 0.0
#:anchor 'west
- ;; FIXME:
- #:font postscript-font-name
+ ;;#:font postscript-font-name
+ #:font (pango-font-name font)
#:size-points 12
#:size-set #t
#:text
- ;; FIXME: need FONT to get to charcode
(integer->utf8-string
- (ly:font-glyph-name-to-charcode font caddr x)))))
- text-snippets))
+ (ly:font-glyph-name-to-charcode font (caddr x))))))
+ x-y-named-glyphs))
(define (grob-cause grob)
grob)
(define (text font s)
- (define (pango-font-name font)
- (debugf "FONT-NAME:~S:~S\n" (ly:font-name font) (ly:font-design-size font))
- (debugf "FONT-FAMILY:~S:~S\n" (font-family font) (otf-name-mangling font (font-family font)))
- (otf-name-mangling font (font-family font)))
-
- (define (pango-font-size font)
- (let* ((designsize (ly:font-design-size font))
- (magnification (* (ly:font-magnification font)))
-
- ;;font-name: "GNU-LilyPond-feta-20"
- ;;font-file-name: "feta20"
- ;;pango-font-name: "lilypond-feta, regular 32"
- ;;OPS:2.61
- ;;scaling:29.7046771653543
- ;;magnification:0.569055118110236
- ;;design:20.0
-
- ;; ugh, experimental sizing
- ;; where does factor ops come from?
- ;; Hmm, design size: 26/20
- (ops 2.60)
-
- (scaling (* ops magnification designsize)))
- (debugf "OPS:~S\n" ops)
- (debugf "scaling:~S\n" scaling)
- (debugf "magnification:~S\n" magnification)
- (debugf "design:~S\n" designsize)
-
- scaling))
-
(make <gnome-canvas-text>
#:parent (canvas-root)
;; ugh, experimental placement corections
(string-append (ly:numbers->string (list breapth width depth height))
" draw_box"))
-(define (glyph-string postscript-font-name x-y-named-glyphs)
+(define (glyph-string font postscript-font-name x-y-named-glyphs)
(apply
string-append
(cons