+2005-01-27 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * lily/*.cc: Scheme deprecation of SCM_VECTOR_*
+
+2005-01-27 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * scm/define-markup-commands.scm (line): filter out empty stencils
+ from line command.
+
+ * lily/stencil-scheme.cc (LY_DEFINE): only allow finite real
+ amount.
+
2005-01-27 Graham Percival <gperlist@shaw.ca>
* Documentation/user/notation.itely: added info about what
-#(ly:set-option 'old-relative)
\version "2.4.0"
\header{
filename = "twinkle-pop.ly"
\context Lyrics \text
>>
\header{
- piece = "clarinet in B$\flat$"
+ piece = \markup { "clarinet in B" \flat }
}
\layout { }
}
return substitute_grob (unsmob_grob (src));
else if (ly_c_vector_p (src))
{
- int len = SCM_VECTOR_LENGTH (src);
+ int len = scm_c_vector_length (src);
SCM nv = scm_c_make_vector (len, SCM_UNDEFINED);
for (int i = 0; i < len; i++)
{
get_font_by_design_size (Output_def *layout, Real requested,
SCM font_vector)
{
- int n = SCM_VECTOR_LENGTH (font_vector);
+ int n = scm_c_vector_length (font_vector);
Real size = 1e6;
Real last_size = -1e6;
int i = 0;
String pango_description_string;
for (; i < n; i++)
{
- SCM entry = SCM_VECTOR_REF (font_vector, i);
+ SCM entry = scm_c_vector_ref (font_vector, i);
if (scm_promise_p (entry) == SCM_BOOL_T)
{
}
else
{
- fm = unsmob_metrics (scm_force (SCM_VECTOR_REF (font_vector, i)));
+ fm = unsmob_metrics (scm_force (scm_c_vector_ref (font_vector, i)));
}
return find_scaled_font (layout, fm, requested / size);
#define scm_c_string_length(x) SCM_STRING_LENGTH (x)
#define scm_is_pair(x) (SCM_CONSP (x))
+#define SCM_VECTOR_LENGTH(x) scm_c_vector_length(x)
+#define SCM_VECTOR_REF(x,y) scm_c_vector_ref(x,y)
inline double ly_scm2double (SCM x) { return scm_num2dbl (x, "ly_scm2double"); }
#define scm_to_double(x) (ly_scm2double (x))
return scm_cons (ly_deep_copy (scm_car (src)), ly_deep_copy (scm_cdr (src)));
else if (ly_c_vector_p (src))
{
- int len = SCM_VECTOR_LENGTH (src);
+ int len = scm_c_vector_length (src);
SCM nv = scm_c_make_vector (len, SCM_UNDEFINED);
for (int i = 0 ;i < len ; i++)
{
unsigned int delta = (pit->get_notename() - tonic.get_notename() + 7) % 7;
SCM style = SCM_EOL;
- if (SCM_VECTOR_LENGTH (shape_vector) > delta
+ if (scm_c_vector_length (shape_vector) > delta
&& scm_is_symbol (scm_vector_ref (shape_vector, scm_from_int (delta))))
{
style = scm_vector_ref (shape_vector, scm_from_int (delta));
binsearch_scm_vector (SCM vec, SCM key, bool (*is_less)(SCM a,SCM b))
{
int lo = 0;
- int hi = SCM_VECTOR_LENGTH (vec);
+ int hi = scm_c_vector_length (vec);
/* binary search */
do
{
int cmp = (lo + hi) / 2;
- SCM when = scm_caar (SCM_VECTOR_REF (vec, cmp));
+ SCM when = scm_caar (scm_c_vector_ref (vec, cmp));
bool result = (*is_less) (key, when);
if (result)
hi = cmp;
Moment
Quote_iterator::vector_moment (int idx) const
{
- SCM entry = SCM_VECTOR_REF (event_vector_, idx);
+ SCM entry = scm_c_vector_ref (event_vector_, idx);
return *unsmob_moment (scm_caar (entry));
}
if (quote_ok ())
{
- SCM entry = SCM_VECTOR_REF (event_vector_, event_idx_);
+ SCM entry = scm_c_vector_ref (event_vector_, event_idx_);
Pitch * quote_pitch = unsmob_pitch (scm_cdar (entry));
/*
copy_scm_hashes (SCM dest, SCM src)
{
int k = 0;
- for (int i = SCM_VECTOR_LENGTH (src); i--;)
+ for (int i = scm_c_vector_length (src); i--;)
for (SCM s = scm_vector_ref (src, scm_from_int (i)); scm_is_pair (s); s = scm_cdr (s))
{
scm_hashq_set_x (dest, scm_caar (s), scm_cdar (s));
/*
resize if getting too large.
*/
- if (elt_count_ > 2 * SCM_VECTOR_LENGTH (hash_tab_))
+ if (elt_count_ > 2 * scm_c_vector_length (hash_tab_))
{
SCM nh = scm_make_vector (scm_int2num (3* elt_count_+1), SCM_EOL);
elt_count_ = copy_scm_hashes (nh, hash_tab_);
Scheme_hash_table::to_alist () const
{
SCM lst = SCM_EOL;
- for (int i = SCM_VECTOR_LENGTH (hash_tab_); i--;)
+ for (int i = scm_c_vector_length (hash_tab_); i--;)
for (SCM s = scm_vector_ref (hash_tab_, scm_int2num (i)); scm_is_pair (s);
s = scm_cdr (s))
lst = scm_acons (scm_caar (s), scm_cdar (s), lst);
(c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
+#include <math.h>
+
+#include <libc-extension.hh> // isinf
+
#include "font-metric.hh"
#include "stencil.hh"
#include "lookup.hh"
{
Stencil *s = unsmob_stencil (stil);
SCM_ASSERT_TYPE (s, stil, SCM_ARG1, __FUNCTION__, "stencil");
- SCM_ASSERT_TYPE (scm_is_number (amount), amount, SCM_ARG2, __FUNCTION__, "number pair");
+ SCM_ASSERT_TYPE (scm_is_number (amount), amount, SCM_ARG2, __FUNCTION__, "number");
+
+ Real real_amount = scm_to_double (amount);
+ SCM_ASSERT_TYPE (!isinf (real_amount) && !isnan (real_amount),
+ amount, SCM_ARG2, __FUNCTION__, "finite number");
+
SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis");
SCM new_s = s->smobbed_copy ();
Stencil *q = unsmob_stencil (new_s);
- q->translate_axis (scm_to_double (amount), Axis (scm_to_int (axis)));
+ q->translate_axis (real_amount, Axis (scm_to_int (axis)));
return new_s;
}
determines the space between each markup in @var{args}."
(stack-stencil-line
(chain-assoc-get 'word-space props)
- (map (lambda (m) (interpret-markup layout props m)) args)))
+ (remove ly:stencil-empty?
+ (map (lambda (m) (interpret-markup layout props m)) args))))
(def-markup-command (fromproperty layout props symbol) (symbol?)
"Read the @var{symbol} from property settings, and produce a stencil
(def-markup-command (musicglyph layout props glyph-name) (string?)
"This is converted to a musical symbol, e.g. @code{\\musicglyph
-#\"accidentals-0\"} will select the natural sign from the music font.
+#\"accidentals.0\"} will select the natural sign from the music font.
See @usermanref{The Feta font} for a complete listing of the possible glyphs."
(ly:font-get-glyph
(ly:paper-get-font layout (cons '((font-encoding . fetaMusic))
(setup paper)))
(define-public (output-framework basename book scopes fields)
+ (display (gc-live-object-stats))
(let* ((filename (format "~a.ps" basename))
(outputter (ly:make-paper-outputter filename
(ly:output-backend)))