extra-offsets from definitions.
2005-01-08 Erlend Aasland <erlenda@gmail.com>
* scm/output-lib.scm: Rename guitar-tunings to guitar-tuning and
add tuning for 4-string bass and some common 4/5-string banjo tunings.
New function (four-string-banjo) turns a 5-string tuning into a 4-string
tuning.
New function (fret-number-tablature-format-banjo) computes correct fret
numbers on 5-string banjos.
* ly/engraver-init.ly: Default stringTunings = #guitar-tuning
Add beam correction to TabVoice.
* scm/define-grobs.scm: Adjust notehead offset. Print fret numbers
using bold font; makes tabs more readable.
2005-01-08 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * scm/define-grobs.scm (all-grob-descriptions): remove all
+ extra-offsets from definitions.
+
+2005-01-08 Erlend Aasland <erlenda@gmail.com>
+
+ * scm/output-lib.scm: Rename guitar-tunings to guitar-tuning and
+ add tuning for 4-string bass and some common 4/5-string banjo tunings.
+ New function (four-string-banjo) turns a 5-string tuning into a 4-string
+ tuning.
+ New function (fret-number-tablature-format-banjo) computes correct fret
+ numbers on 5-string banjos.
+
+ * ly/engraver-init.ly: Default stringTunings = #guitar-tuning
+ Add beam correction to TabVoice.
+
+ * scm/define-grobs.scm: Adjust notehead offset. Print fret numbers
+ using bold font; makes tabs more readable.
+
+2005-01-08 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * lily/font-select.cc (get_font_by_design_size): don't make
+ Modified_font_metric; this causes trouble, since we don't know the
+ font magnification from inside Pango_font::text_stencil()
+
+ * lily/all-font-metrics.cc (find_pango_font): take magnification argument.
+
+ * Documentation/user/notation.itely (The Lyrics context): comment out
+ broken {Small ensembles} link.
+
+ * scm/framework-svg.scm (output-framework): change calling convention.
+
* lily/object-key-dumper-scheme.cc: new file.
* lily/object-key-undumper-scheme.cc: new file.
Program reference: @internalsref{LyricCombineMusic},
@internalsref{Lyrics}, @internalsref{Melisma_translator}.
-Examples: @ref{Small ensembles},
+
+@c link broken:
+@c Examples: @ref{Small ensembles},
+
+
@inputfileref{input/@/regression,lyric@/-combine@/-new@/.ly}.
@c TODO: make separate section for melismata
}
#if HAVE_PANGO_FT2
+
Pango_font *
-All_font_metrics::find_pango_font (PangoFontDescription*description)
+All_font_metrics::find_pango_font (PangoFontDescription*description,
+ Real magnification,
+ Real output_scale)
{
+ pango_font_description_set_size (description,
+ gint (magnification *
+ pango_font_description_get_size (description)));
+
gchar *fn = pango_font_description_to_filename (description);
SCM key = ly_symbol2scm (fn);
progress_indication ("[" + String (fn));
Pango_font *pf = new Pango_font (pango_ft2_fontmap_,
RIGHT,
- description);
+ description,
+ output_scale);
val = pf->self_scm ();
pango_dict_->set (key, val);
scm_gc_unprotect_object (val);
g_free (fn);
return dynamic_cast<Pango_font*> (unsmob_metrics (val));
}
+
#endif
/*
#if HAVE_PANGO_FT2
PangoFontDescription *description
= pango_font_description_from_string (pango_description_string.to_str0 ());
- fm = all_fonts_global->find_pango_font (description);
+ return all_fonts_global->find_pango_font (description,
+ requested / size,
+ output_scale (layout));
#else
error ("Trying to retrieve pango font without HAVE_PANGO_FT2.");
#endif
if (scm_is_string (name)
&& is_pango_format_global)
{
- select_pango_font (layout, chain);
+ return select_pango_font (layout, chain);
}
else
#endif
Scheme_hash_table *otf_dict_;
File_path search_path_;
-#ifdef HAVE_PANGO16
+#ifdef HAVE_PANGO_FT2
PangoFT2FontMap *pango_ft2_fontmap_;
Scheme_hash_table *pango_dict_;
int pango_dpi_;
All_font_metrics (String search_path);
~All_font_metrics ();
- Pango_font *find_pango_font (PangoFontDescription*description);
+#ifdef HAVE_PANGO_FT2
+ Pango_font *find_pango_font (PangoFontDescription*description,
+ Real magnification,
+ Real scale);
+#endif
+
Adobe_font_metric *find_afm (String name);
Tex_font_metric *find_tfm (String);
Font_metric *find_font (String name);
PangoAttrList *attribute_list_;
Real scale_;
SCM subfonts_;
+
public:
Pango_font (PangoFT2FontMap *,
Direction leftright,
- PangoFontDescription *);
+ PangoFontDescription *,
+ Real);
~Pango_font ();
SCM font_file_name () const;
Pango_font::Pango_font (PangoFT2FontMap *fontmap,
Direction dir,
- PangoFontDescription *description)
+ PangoFontDescription *description,
+ Real output_scale)
{
subfonts_ = SCM_EOL;
PangoDirection pango_dir = (dir == RIGHT)
--hwn
*/
- scale_ = INCH_TO_BP / (Real (PANGO_SCALE) * Real (PANGO_RESOLUTION));
+ scale_ = INCH_TO_BP / (Real (PANGO_SCALE) * Real (PANGO_RESOLUTION) * output_scale);
pango_context_set_language (context_, pango_language_from_string ("en_US"));
pango_context_set_base_dir (context_, pango_dir);
exp);
}
+#if 1
+ if (!dest.extent_box ()[X_AXIS].is_empty ())
+ {
+ Stencil frame = Lookup::frame (dest.extent_box(), 0.1, 0.1);
+ dest.add_stencil (frame);
+ }
+#endif
+
return dest;
}
PangoFontDescription *pfd = properties_to_pango_description (chain,
point_constant * layout->get_dimension (ly_symbol2scm ("text-font-size")));
- Font_metric * fm = all_fonts_global->find_pango_font (pfd);
-
- return find_scaled_font (layout, fm, 1.0);
+ return all_fonts_global->find_pango_font (pfd, 1.0, output_scale (layout));
}
PangoStyle
%% One may change the strings tuning as following :
%% The lenght of the list must be equal to the number of string
- stringTunings = #guitar-tunings
+ stringTunings = #guitar-tuning
tablatureFormat = #fret-number-tablature-format
%%
%\override Beam #'damping = #100000
%\override Stem #'up-to-staff = ##t
+ % TabStaff increase the staff-space, which in turn
+ % increases beam thickness and spacing; beams are
+ % too big. We have to adjust the beam settings:
+ \override Beam #'thickness = #0.32
+ \override Beam #'space-function =
+ #(lambda (beam mult) (* 0.62 (Beam::space_function beam mult)))
+
% No accidental in tablature !
\remove Accidental_engraver
}
(X-offset-callbacks . (,Self_alignment_interface::aligned_on_self))
(self-alignment-X . 1)
- ;; hmm. why did we do this: ?
- (extra-offset . (1.3 . 0))
(meta .
((interfaces . (side-position-interface
text-interface
(Y-offset-callbacks . (,Side_position_interface::aligned_side))
(X-offset-callbacks . (,Self_alignment_interface::aligned_on_self))
(direction . 1)
- (extra-offset . (-1 . 0))
(padding . 0.5)
(staff-padding . 0.5)
(script-priority . 200)
(style . default)
(print-function . ,Text_interface::print)
(Y-offset-callbacks . (,Staff_symbol_referencer::callback))
- (extra-offset . (0 . -0.65)) ;; UGH! TODO: Clean this up!
(stem-attachment-function . ,tablature-stem-attachment-function)
+ (font-series . bold)
(meta . ((interfaces
. (rhythmic-head-interface
font-interface
,(delay (ly:font-load "emmentaler23"))
,(delay (ly:font-load "emmentaler26"))))
- (fetaBraces 100.0 #(,(delay
+ (fetaBraces ,(ly:pt 20.0) #(,(delay
(ly:font-load "aybabtu")))))))
(define-public (add-cmr-fonts node factor)
;; remove 1 because list index starts at 0 and guitar string at 1.
(- string 1)))))
+;; The 5-string banjo has got a extra string, the fifth (duh), wich
+;; starts at the fifth fret on the neck. Frets on the fifth string
+;; are referred to relative to the other frets:
+;; the "first fret" on the fifth string is really the sixth fret
+;; on the banjo neck.
+;; We solve this by defining a new fret-number-tablature function:
+(define-public (fret-number-tablature-format-banjo string tuning pitch)
+ (let ((fret (- (ly:pitch-semitones pitch) (list-ref tuning (- string 1)))))
+ (number->string (cond
+ ((and (> fret 0) (= string 5))
+ (+ fret 5))
+ (else fret)))))
+
(define-public (hammer-print-function grob)
(let* ((note-collums (ly:grob-property grob 'note-columns))
(note-column1 (cadr note-collums))
-(define-public guitar-tunings '(4 -1 -5 -10 -15 -20))
+(define-public guitar-tuning '(4 -1 -5 -10 -15 -20))
+(define-public bass-tuning '(-17 -22 -27 -32))
+
+;; tunings for 5-string banjo
+(define-public banjo-open-g-tuning '(2 -1 -5 -10 7))
+(define-public banjo-c-tuning '(2 -1 -5 -12 7))
+(define-public banjo-modal-tuning '(2 0 -5 -10 7))
+(define-public banjo-open-d-tuning '(2 -3 -6 -10 9))
+(define-public banjo-open-dm-tuning '(2 -3 -6 -10 9))
+;; convert 5-string banjo tunings to 4-string tunings by
+;; removing the 5th string
+;;
+;; example:
+;; \set TabStaff.stringTunings = #(four-string-banjo banjo-open-g-tuning)
+(define-public (four-string-banjo tuning)
+ (reverse (cdr (reverse tuning))))
;;; end of tablature functions