From: Jan Nieuwenhuizen Date: Mon, 27 Dec 2004 15:22:06 +0000 (+0000) Subject: * lily/pango-font.cc (text_stencil): Quick try at glyph->charcode X-Git-Tag: release/2.5.14~350 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=42c8f04fe971525561dde0ee757ffebe3e6c0703;p=lilypond.git * 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. --- diff --git a/ChangeLog b/ChangeLog index 2c52e55590..1e67c8a718 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2004-12-27 Jan Nieuwenhuizen + + * 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 * scm/output-gnome.scm (FIXME-glyph-string): New function. Cannot diff --git a/lily/all-font-metrics.cc b/lily/all-font-metrics.cc index c9b4b5d5e0..c681c03c9d 100644 --- a/lily/all-font-metrics.cc +++ b/lily/all-font-metrics.cc @@ -69,7 +69,7 @@ All_font_metrics::find_pango_font (PangoFontDescription*description) pango_dpi_, RIGHT, description); - val = pf->self_scm(); + val = pf->self_scm (); pango_dict_->set (key, val); scm_gc_unprotect_object (val); diff --git a/lily/include/font-metric.hh b/lily/include/font-metric.hh index b9da9002b9..6de18c5bdc 100644 --- a/lily/include/font-metric.hh +++ b/lily/include/font-metric.hh @@ -15,7 +15,7 @@ #include "smobs.hh" #include "lily-proto.hh" -struct Font_metric +class Font_metric { public: SCM description_; @@ -53,13 +53,11 @@ protected: 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 */ diff --git a/lily/include/open-type-font.hh b/lily/include/open-type-font.hh index b730c560fc..8bdbd45429 100644 --- a/lily/include/open-type-font.hh +++ b/lily/include/open-type-font.hh @@ -15,10 +15,12 @@ #include "font-metric.hh" typedef std::map 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_; diff --git a/lily/include/pango-font.hh b/lily/include/pango-font.hh index e6241c9493..13038a6ee5 100644 --- a/lily/include/pango-font.hh +++ b/lily/include/pango-font.hh @@ -1,11 +1,9 @@ - /* pango-font.hh -- declare Pango_font source file of the GNU LilyPond music typesetter (c) 2004 Han-Wen Nienhuys - */ #ifndef PANGO_FONT_HH @@ -19,35 +17,47 @@ #include #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 */ diff --git a/lily/open-type-font.cc b/lily/open-type-font.cc index 03dfa0c6df..da29e1884a 100644 --- a/lily/open-type-font.cc +++ b/lily/open-type-font.cc @@ -4,7 +4,6 @@ source file of the GNU LilyPond music typesetter (c) 2004 Han-Wen Nienhuys - */ #include @@ -22,7 +21,7 @@ const Real point_constant = 1 PT; 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) @@ -33,9 +32,7 @@ load_table (char const *tag_str, FT_Face face, FT_ULong *length) 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; } @@ -61,7 +58,6 @@ load_scheme_table (char const *tag_str, FT_Face face) return tab; } - Index_to_charcode_map make_index_to_charcode_map (FT_Face face) { diff --git a/lily/pango-font.cc b/lily/pango-font.cc index 7529ae8115..4e9dfd8061 100644 --- a/lily/pango-font.cc +++ b/lily/pango-font.cc @@ -21,10 +21,10 @@ 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); @@ -36,7 +36,6 @@ Pango_font::Pango_font (PangoFT2FontMap *fontmap, pango_context_set_font_description (context_, description); } - Pango_font::~Pango_font () { g_object_unref (context_); @@ -56,37 +55,50 @@ Pango_font::derived_mark () const { 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_); @@ -105,7 +117,7 @@ Pango_font::text_stencil (String str) const 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; @@ -114,7 +126,8 @@ Pango_font::text_stencil (String str) const 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)); @@ -141,13 +154,29 @@ Pango_font::font_file_name () const 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 (unsmob_metrics (f))); } + #endif + diff --git a/scm/bass-figure.scm b/scm/bass-figure.scm index a44f5216c0..713cd4e054 100644 --- a/scm/bass-figure.scm +++ b/scm/bass-figure.scm @@ -16,8 +16,8 @@ (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) @@ -39,10 +39,10 @@ (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) '()) diff --git a/scm/c++.scm b/scm/c++.scm index bcd343470a..30a1784113 100644 --- a/scm/c++.scm +++ b/scm/c++.scm @@ -10,7 +10,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; type predicates. -(define-public (number-pair? x) +(define-public (number-pair? x) (and (pair? x) (number? (car x)) (number? (cdr x)))) @@ -20,7 +20,7 @@ (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)))) @@ -47,7 +47,7 @@ (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"))) diff --git a/scm/chord-entry.scm b/scm/chord-entry.scm index ea7f87e00d..ccfa0877d0 100644 --- a/scm/chord-entry.scm +++ b/scm/chord-entry.scm @@ -1,7 +1,7 @@ ;;;; chord-entry.scm -- Generate chord names for the parser. ;;;; ;;;; source file of the GNU LilyPond music typesetter -;;;; +;;;; ;;;; (c) 2004 Han-Wen Nienhuys (define-public (construct-chord root duration modifications) @@ -10,7 +10,7 @@ have duration DURATION.. 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)) @@ -29,17 +29,17 @@ Entry point for the parser. (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))) @@ -49,8 +49,8 @@ Entry point for the parser. (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)) @@ -71,14 +71,14 @@ Entry point for the parser. 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)) @@ -100,11 +100,11 @@ the bass specified. 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 @@ -112,7 +112,7 @@ the bass specified. (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))) @@ -137,9 +137,9 @@ the bass specified. (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 @@ -151,7 +151,7 @@ the bass specified. (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 @@ -229,7 +229,7 @@ DURATION, and 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 '()))) diff --git a/scm/chord-ignatzek-names.scm b/scm/chord-ignatzek-names.scm index 19e30fac63..d53c13b9e6 100644 --- a/scm/chord-ignatzek-names.scm +++ b/scm/chord-ignatzek-names.scm @@ -79,7 +79,7 @@ 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 @@ -212,12 +212,12 @@ work than classifying the pitches." (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) @@ -226,7 +226,7 @@ work than classifying the 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. diff --git a/scm/chord-name.scm b/scm/chord-name.scm index 2c63a7d4e9..e964da8bfb 100644 --- a/scm/chord-name.scm +++ b/scm/chord-name.scm @@ -56,7 +56,7 @@ (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))) @@ -65,13 +65,13 @@ (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 <>-\\markup{ foobar } to (cons CDE-PITCHES FOOBAR-MARKUP), or to (cons DE-PITCHES diff --git a/scm/clef.scm b/scm/clef.scm index 69f2bc79c3..e8304b0622 100644 --- a/scm/clef.scm +++ b/scm/clef.scm @@ -1,7 +1,7 @@ ;;;; clef.scm -- Clef settings ;;;; ;;;; source file of the GNU LilyPond music typesetter -;;;; +;;;; ;;;; (c) 2004 Han-Wen Nienhuys @@ -28,7 +28,7 @@ ("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)) @@ -108,7 +108,7 @@ (- (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 diff --git a/scm/define-context-properties.scm b/scm/define-context-properties.scm index f5404a7d8b..6cb8ecc3bb 100644 --- a/scm/define-context-properties.scm +++ b/scm/define-context-properties.scm @@ -11,7 +11,7 @@ (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?) @@ -28,7 +28,7 @@ (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 @@ -312,13 +312,13 @@ with other voices is preserved. @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 @@ -370,8 +370,8 @@ is called to determine the text to print on a tuplet bracket.") (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] @@ -394,7 +394,7 @@ to 10 (5+5) staffspaces high. @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 @@ -457,7 +457,7 @@ for this staff.") (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]") @@ -467,7 +467,7 @@ pairs. It is reset at every bar line." ) 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.") diff --git a/scm/define-grob-interfaces.scm b/scm/define-grob-interfaces.scm index 287c452288..412917ab4f 100644 --- a/scm/define-grob-interfaces.scm +++ b/scm/define-grob-interfaces.scm @@ -107,5 +107,5 @@ are interesting enough to maintain a hara-kiri staff." (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." '()) diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm index 7ec6cd8847..f116d1a452 100644 --- a/scm/define-grob-properties.scm +++ b/scm/define-grob-properties.scm @@ -52,7 +52,7 @@ called first. The functions take a grob and axis argument. ") 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.") @@ -81,7 +81,7 @@ Choices include @code{curved} and @code{straight}.") (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 @@ -157,11 +157,11 @@ line).") 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 @@ -616,7 +616,7 @@ functions set spanner positions.") (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.") diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index 343f261a6e..5b8ea469c5 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -1,7 +1,7 @@ -;;;; define-grobs.scm -- +;;;; define-grobs.scm -- ;;;; ;;;; source file of the GNU LilyPond music typesetter -;;;; +;;;; ;;;; (c) 1998--2004 Han-Wen Nienhuys ;;;; Jan Nieuwenhuizen @@ -9,7 +9,7 @@ ;;;; 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 @@ -17,12 +17,12 @@ (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) @@ -41,13 +41,13 @@ (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 @@ -56,8 +56,8 @@ (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 . ( @@ -65,18 +65,18 @@ (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 @@ -84,16 +84,16 @@ 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)))) )) @@ -104,14 +104,14 @@ (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)) @@ -123,15 +123,15 @@ ;; 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) @@ -145,13 +145,13 @@ (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)))) )) @@ -246,7 +246,7 @@ (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 )))) @@ -262,7 +262,7 @@ (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) @@ -277,7 +277,7 @@ (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)) @@ -289,17 +289,17 @@ (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) @@ -389,21 +389,21 @@ )) (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)) @@ -420,14 +420,14 @@ (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)) @@ -463,7 +463,7 @@ (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)))) @@ -489,7 +489,7 @@ (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 @@ -514,7 +514,7 @@ (baseline-skip . 2) (meta . ((interfaces . (font-interface self-alignment-interface side-position-interface text-interface break-aligned-interface item-interface )))) )) - + (VocalName . ( (breakable . #t) @@ -537,7 +537,7 @@ (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)) @@ -555,7 +555,7 @@ (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)) )) @@ -575,7 +575,7 @@ (print-function . ,Ledger_line_spanner::print) (meta . ((interfaces . (spanner-interface ledger-line-interface)))) )) - + (LigatureBracket . ( (ligature-primitive-callback . ,Note_head::print) @@ -588,7 +588,7 @@ (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 @@ -599,7 +599,7 @@ (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)))) )) @@ -683,7 +683,7 @@ (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) @@ -731,7 +731,7 @@ (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 @@ -756,7 +756,7 @@ (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)))) @@ -819,7 +819,7 @@ ; (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 @@ -829,10 +829,11 @@ (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) @@ -852,7 +853,7 @@ (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 @@ -924,7 +925,7 @@ (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) @@ -935,17 +936,17 @@ (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) @@ -959,7 +960,7 @@ (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 )))) )) @@ -980,10 +981,10 @@ (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) @@ -993,14 +994,14 @@ (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)))) )) @@ -1087,7 +1088,7 @@ (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) @@ -1163,14 +1164,14 @@ (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 . ( @@ -1195,7 +1196,7 @@ (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)) @@ -1203,7 +1204,7 @@ (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)) @@ -1212,12 +1213,12 @@ 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 @@ -1237,7 +1238,7 @@ (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)))) )) @@ -1258,11 +1259,11 @@ (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 )))) )) @@ -1279,7 +1280,7 @@ (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 @@ -1294,7 +1295,7 @@ (meta . ((interfaces . (text-interface self-alignment-interface font-interface item-interface )))) )) - (UnaCordaPedalLineSpanner + (UnaCordaPedalLineSpanner . ( (axes . (1)) (Y-extent-callback . ,Axis_group_interface::group_extent_callback) @@ -1322,20 +1323,20 @@ (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)))) )) @@ -1372,13 +1373,13 @@ (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) diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index 5c1c745d3b..120b25568d 100644 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -26,7 +26,7 @@ (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))))) @@ -77,14 +77,14 @@ For the postscript backend, use the following @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?) @@ -103,7 +103,7 @@ gsave /ecrm10 findfont (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) diff --git a/scm/output-gnome.scm b/scm/output-gnome.scm index c4791998de..15fdff495f 100644 --- a/scm/output-gnome.scm +++ b/scm/output-gnome.scm @@ -149,6 +149,36 @@ lilypond -fgnome input/simple-song.ly "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 @@ -306,23 +336,26 @@ lilypond -fgnome input/simple-song.ly ;; 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 #: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) @@ -375,36 +408,6 @@ lilypond -fgnome input/simple-song.ly (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 #:parent (canvas-root) ;; ugh, experimental placement corections diff --git a/scm/output-ps.scm b/scm/output-ps.scm index db74518d94..6899b74780 100644 --- a/scm/output-ps.scm +++ b/scm/output-ps.scm @@ -169,7 +169,7 @@ (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