* lily/include/lily-guile.hh: many new ly_ functions. Thanks to
[lilypond.git] / lily / lookup.cc
blob37a3da0b10a2f958143a2cbc91964458a7d94e01
1 /*
2 lookup.cc -- implement simple Lookup methods.
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
8 Jan Nieuwenhuizen <janneke@gnu.org>
9 */
10 #include <math.h>
11 #include <ctype.h>
13 #include "line-interface.hh"
14 #include "warn.hh"
15 #include "dimensions.hh"
16 #include "bezier.hh"
17 #include "string-convert.hh"
18 #include "file-path.hh"
19 #include "main.hh"
20 #include "lily-guile.hh"
21 #include "stencil.hh"
22 #include "lookup.hh"
23 #include "font-metric.hh"
24 #include "interval.hh"
26 Stencil
27 Lookup::dot (Offset p, Real radius)
29 SCM at = (scm_list_n (ly_symbol2scm ("dot"),
30 scm_make_real (p[X_AXIS]),
31 scm_make_real (p[Y_AXIS]),
32 scm_make_real (radius),
33 SCM_UNDEFINED));
34 Box box;
35 box.add_point (p - Offset (radius, radius));
36 box.add_point (p + Offset (radius, radius));
37 return Stencil (box, at);
43 * Horizontal Slope:
45 * /| ^
46 * / | |
47 * / | | height
48 * / | |
49 * / | v
50 * | /
51 * | /
52 * (0,0) x /slope=dy/dx
53 * | /
54 * |/
56 * <----->
57 * width
59 Stencil
60 Lookup::beam (Real slope, Real width, Real thick, Real blot)
62 Real height = slope * width;
63 Real min_y = (0 <? height) - thick/2;
64 Real max_y = (0 >? height) + thick/2;
66 Box b (Interval (0, width),
67 Interval (min_y, max_y));
69 SCM at = scm_list_n (ly_symbol2scm ("beam"),
70 scm_make_real (width),
71 scm_make_real (slope),
72 scm_make_real (thick),
73 scm_make_real (blot),
74 SCM_UNDEFINED);
75 return Stencil (b, at);
78 Stencil
79 Lookup::dashed_slur (Bezier b, Real thick, Real dash)
81 SCM l = SCM_EOL;
83 for (int i= 4; i -- ;)
85 l = scm_cons (ly_offset2scm (b.control_[i]), l);
88 SCM at = (scm_list_n (ly_symbol2scm ("dashed-slur"),
89 scm_make_real (thick),
90 scm_make_real (dash),
91 ly_quote_scm (l),
92 SCM_UNDEFINED));
94 Box box (Interval (0,0),Interval (0,0));
95 return Stencil (box, at);
100 Stencil
101 Lookup::horizontal_line (Interval w, Real th)
103 SCM at = scm_list_n (ly_symbol2scm ("horizontal-line"),
104 scm_make_real (w[LEFT]),
105 scm_make_real (w[RIGHT]),
106 scm_make_real (th),
107 SCM_UNDEFINED);
110 Box box ;
111 box[X_AXIS] = w;
112 box[Y_AXIS] = Interval (-th/2,th/2);
114 return Stencil (box, at);
118 Stencil
119 Lookup::blank (Box b)
121 return Stencil (b, scm_makfrom0str (""));
124 Stencil
125 Lookup::filled_box (Box b)
127 SCM at = (scm_list_n (ly_symbol2scm ("filledbox"),
128 scm_make_real (-b[X_AXIS][LEFT]),
129 scm_make_real (b[X_AXIS][RIGHT]),
130 scm_make_real (-b[Y_AXIS][DOWN]),
131 scm_make_real (b[Y_AXIS][UP]),
132 SCM_UNDEFINED));
134 return Stencil (b,at);
138 * round filled box:
140 * __________________________________
141 * / \ ^ / \ ^
142 * | |blot | |
143 * | | |dia | | |
144 * | |meter | |
145 * |\ _ _ / v \ _ _ /| |
146 * | | |
147 * | | | Box
148 * | <------>| | extent
149 * | blot | | (Y_AXIS)
150 * | diameter| |
151 * | | |
152 * | _ _ _ _ | |
153 * |/ \ / \| |
154 * | | |
155 * | | | | |
156 * | | |
157 * x\_____/______________\_____/|_____v
158 * |(0,0) |
159 * | |
160 * | |
161 * |<-------------------------->|
162 * Box extent (X_AXIS)
164 Stencil
165 Lookup::round_filled_box (Box b, Real blotdiameter)
167 if (b.x ().length () < blotdiameter)
169 programming_error (_f ("round filled box horizontal extent smaller than blot; decreasing blot"));
170 blotdiameter = b.x ().length ();
172 if (b.y ().length () < blotdiameter)
174 programming_error (_f ("round filled box vertical extent smaller than blot; decreasing blot"));
175 blotdiameter = b.y ().length ();
178 SCM at = (scm_list_n (ly_symbol2scm ("round-filled-box"),
179 scm_make_real (-b[X_AXIS][LEFT]),
180 scm_make_real (b[X_AXIS][RIGHT]),
181 scm_make_real (-b[Y_AXIS][DOWN]),
182 scm_make_real (b[Y_AXIS][UP]),
183 scm_make_real (blotdiameter),
184 SCM_UNDEFINED));
186 return Stencil (b,at);
192 * Create Stencil that represents a filled polygon with round edges.
194 * LIMITATIONS:
196 * (a) Only outer (convex) edges are rounded.
198 * (b) This algorithm works as expected only for polygons whose edges
199 * do not intersect. For example, the polygon ((0, 0), (q, 0), (0,
200 * q), (q, q)) has an intersection at point (q/2, q/2) and therefore
201 * will give a strange result. Even non-adjacent edges that just
202 * touch each other will in general not work as expected for non-null
203 * blotdiameter.
205 * (c) Given a polygon ((x0, y0), (x1, y1), ... , (x (n-1), y (n-1))),
206 * if there is a natural number k such that blotdiameter is greater
207 * than the maximum of { | (x (k mod n), y (k mod n)) - (x ((k+1) mod n),
208 * y ((k+1) mod n)) |, | (x (k mod n), y (k mod n)) - (x ((k+2) mod n),
209 * y ((k+2) mod n)) |, | (x ((k+1) mod n), y ((k+1) mod n)) - (x ((k+2)
210 * mod n), y ((k+2) mod n)) | }, then the outline of the rounded
211 * polygon will exceed the outline of the core polygon. In other
212 * words: Do not draw rounded polygons that have a leg smaller or
213 * thinner than blotdiameter (or set blotdiameter to a sufficiently
214 * small value -- maybe even 0.0)!
216 * NOTE: Limitations (b) and (c) arise from the fact that round edges
217 * are made by moulding sharp edges to round ones rather than adding
218 * to a core filled polygon. For details of these two different
219 * approaches, see the thread upon the ledger lines patch that started
220 * on March 25, 2002 on the devel mailing list. The below version of
221 * round_filled_polygon () sticks to the moulding model, which the
222 * majority of the list participants finally voted for. This,
223 * however, results in the above limitations and a much increased
224 * complexity of the algorithm, since it has to compute a shrinked
225 * polygon -- which is not trivial define precisely and unambigously.
226 * With the other approach, one simply could move a circle of size
227 * blotdiameter along all edges of the polygon (which is what the
228 * postscript routine in the backend effectively does, but on the
229 * shrinked polygon). --jr
231 Stencil
232 Lookup::round_filled_polygon (Array<Offset> points, Real blotdiameter)
234 /* TODO: Maybe print a warning if one of the above limitations
235 applies to the given polygon. However, this is quite complicated
236 to check. */
238 /* remove consecutive duplicate points */
239 const Real epsilon = 0.01;
240 for (int i = 0; i < points.size ();)
242 int next_i = (i + 1) % points.size ();
243 Real d = (points[i] - points[next_i]).length ();
244 if (d < epsilon)
245 points.del (next_i);
246 else
247 i++;
250 /* special cases: degenerated polygons */
251 if (points.size () == 0)
252 return Stencil ();
253 if (points.size () == 1)
254 return dot (points[0], 0.5 * blotdiameter);
255 if (points.size () == 2)
256 return Line_interface::make_line (blotdiameter, points[0], points[1]);
258 /* shrink polygon in size by 0.5 * blotdiameter */
259 Array<Offset> shrinked_points;
260 shrinked_points.set_size (points.size ());
261 bool ccw = 1; // true, if three adjacent points are counterclockwise ordered
262 for (int i = 0; i < points.size (); i++)
264 int i0 = i;
265 int i1 = (i + 1) % points.size ();
266 int i2 = (i + 2) % points.size ();
267 Offset p0 = points[i0];
268 Offset p1 = points[i1];
269 Offset p2 = points[i2];
270 Offset p10 = p0 - p1;
271 Offset p12 = p2 - p1;
272 if (p10.length () != 0.0)
273 { // recompute ccw
274 Real phi = p10.arg ();
275 // rotate (p2 - p0) by (-phi)
276 Offset q = complex_multiply (p2 - p0, complex_exp (Offset (1.0, -phi)));
278 if (q[Y_AXIS] > 0)
279 ccw = 1;
280 else if (q[Y_AXIS] < 0)
281 ccw = 0;
282 else {} // keep ccw unchanged
284 else {} // keep ccw unchanged
285 Offset p10n = (1.0 / p10.length ()) * p10; // normalize length to 1.0
286 Offset p12n = (1.0 / p12.length ()) * p12;
287 Offset p13n = 0.5 * (p10n + p12n);
288 Offset p14n = 0.5 * (p10n - p12n);
289 Offset p13;
290 Real d = p13n.length () * p14n.length (); // distance p3n to line (p1..p0)
291 if (d < epsilon)
292 // special case: p0, p1, p2 are on a single line => build
293 // vector orthogonal to (p2-p0) of length 0.5 blotdiameter
295 p13[X_AXIS] = p10[Y_AXIS];
296 p13[Y_AXIS] = -p10[X_AXIS];
297 p13 = (0.5 * blotdiameter / p13.length ()) * p13;
299 else
300 p13 = (0.5 * blotdiameter / d) * p13n;
301 shrinked_points[i1] = p1 + ((ccw) ? p13 : -p13);
304 /* build scm expression and bounding box */
305 SCM shrinked_points_scm = SCM_EOL;
306 Box box;
307 for (int i = 0; i < shrinked_points.size (); i++)
309 SCM x = scm_make_real (shrinked_points[i][X_AXIS]);
310 SCM y = scm_make_real (shrinked_points[i][Y_AXIS]);
311 shrinked_points_scm = scm_cons (x, scm_cons (y, shrinked_points_scm));
312 box.add_point (points[i]);
314 SCM polygon_scm = scm_list_n (ly_symbol2scm ("polygon"),
315 ly_quote_scm (shrinked_points_scm),
316 scm_make_real (blotdiameter),
317 SCM_UNDEFINED);
319 Stencil polygon = Stencil (box, polygon_scm);
320 shrinked_points.clear ();
321 return polygon;
326 TODO: deprecate?
328 Stencil
329 Lookup::frame (Box b, Real thick, Real blot)
331 Stencil m;
332 Direction d = LEFT;
333 for (Axis a = X_AXIS; a < NO_AXES; a = Axis (a + 1))
335 Axis o = Axis ((a+1)%NO_AXES);
338 Box edges;
339 edges[a] = b[a][d] + 0.5 * thick * Interval (-1, 1);
340 edges[o][DOWN] = b[o][DOWN] - thick/2;
341 edges[o][UP] = b[o][UP] + thick/2;
343 m.add_stencil (round_filled_box (edges, blot));
345 while (flip (&d) != LEFT);
347 return m;
351 Make a smooth curve along the points
353 Stencil
354 Lookup::slur (Bezier curve, Real curvethick, Real linethick)
356 Real alpha = (curve.control_[3] - curve.control_[0]).arg ();
357 Bezier back = curve;
358 Offset perp = curvethick * complex_exp (Offset (0, alpha + M_PI/2)) * 0.5;
359 back.reverse ();
360 back.control_[1] += perp;
361 back.control_[2] += perp;
363 curve.control_[1] -= perp;
364 curve.control_[2] -= perp;
366 SCM scontrols[8];
368 for (int i=4; i--;)
369 scontrols[ i ] = ly_offset2scm (back.control_[i]);
370 for (int i=4 ; i--;)
371 scontrols[i+4] = ly_offset2scm (curve.control_[i]);
374 Need the weird order b.o. the way PS want its arguments
376 int indices[]= {5, 6, 7, 4, 1, 2, 3, 0};
377 SCM list = SCM_EOL;
378 for (int i= 8; i--;)
380 list = scm_cons (scontrols[indices[i]], list);
384 SCM at = (scm_list_n (ly_symbol2scm ("bezier-sandwich"),
385 ly_quote_scm (list),
386 scm_make_real (linethick),
387 SCM_UNDEFINED));
388 Box b (curve.extent (X_AXIS),
389 curve.extent (Y_AXIS));
391 b[X_AXIS].unite (back.extent (X_AXIS));
392 b[Y_AXIS].unite (back.extent (Y_AXIS));
394 return Stencil (b, at);
398 * Bezier Sandwich:
400 * .|
401 * . |
402 * top . |
403 * . curve |
404 * . |
405 * . |
406 * . |
407 * | |
408 * | .|
409 * | .
410 * | bottom .
411 * | . curve
412 * | .
413 * | .
414 * | .
415 * | .
416 * |.
420 Stencil
421 Lookup::bezier_sandwich (Bezier top_curve, Bezier bottom_curve)
424 Need the weird order b.o. the way PS want its arguments
426 SCM list = SCM_EOL;
427 list = scm_cons (ly_offset2scm (bottom_curve.control_[3]), list);
428 list = scm_cons (ly_offset2scm (bottom_curve.control_[0]), list);
429 list = scm_cons (ly_offset2scm (bottom_curve.control_[1]), list);
430 list = scm_cons (ly_offset2scm (bottom_curve.control_[2]), list);
431 list = scm_cons (ly_offset2scm (top_curve.control_[0]), list);
432 list = scm_cons (ly_offset2scm (top_curve.control_[3]), list);
433 list = scm_cons (ly_offset2scm (top_curve.control_[2]), list);
434 list = scm_cons (ly_offset2scm (top_curve.control_[1]), list);
436 SCM horizontal_bend = scm_list_n (ly_symbol2scm ("bezier-sandwich"),
437 ly_quote_scm (list),
438 scm_make_real (0.0),
439 SCM_UNDEFINED);
441 Interval x_extent = top_curve.extent (X_AXIS);
442 x_extent.unite (bottom_curve.extent (X_AXIS));
443 Interval y_extent = top_curve.extent (Y_AXIS);
444 y_extent.unite (bottom_curve.extent (Y_AXIS));
445 Box b (x_extent, y_extent);
447 return Stencil (b, horizontal_bend);
451 TODO: junk me.
453 Stencil
454 Lookup::accordion (SCM s, Real staff_space, Font_metric *fm)
456 Stencil m;
457 String sym = ly_scm2string (ly_car (s));
458 String reg = ly_scm2string (ly_car (ly_cdr (s)));
460 if (sym == "Discant")
462 Stencil r = fm->find_by_name ("accordion-accDiscant");
463 m.add_stencil (r);
464 if (reg.left_string (1) == "F")
466 Stencil d = fm->find_by_name ("accordion-accDot");
467 d.translate_axis (staff_space * 2.5 PT, Y_AXIS);
468 m.add_stencil (d);
469 reg = reg.right_string (reg.length ()-1);
471 int eflag = 0x00;
472 if (reg.left_string (3) == "EEE")
474 eflag = 0x07;
475 reg = reg.right_string (reg.length ()-3);
477 else if (reg.left_string (2) == "EE")
479 eflag = 0x05;
480 reg = reg.right_string (reg.length ()-2);
482 else if (reg.left_string (2) == "Eh")
484 eflag = 0x04;
485 reg = reg.right_string (reg.length ()-2);
487 else if (reg.left_string (1) == "E")
489 eflag = 0x02;
490 reg = reg.right_string (reg.length ()-1);
492 if (eflag & 0x02)
494 Stencil d = fm->find_by_name ("accordion-accDot");
495 d.translate_axis (staff_space * 1.5 PT, Y_AXIS);
496 m.add_stencil (d);
498 if (eflag & 0x04)
500 Stencil d = fm->find_by_name ("accordion-accDot");
501 d.translate_axis (staff_space * 1.5 PT, Y_AXIS);
502 d.translate_axis (0.8 * staff_space PT, X_AXIS);
503 m.add_stencil (d);
505 if (eflag & 0x01)
507 Stencil d = fm->find_by_name ("accordion-accDot");
508 d.translate_axis (staff_space * 1.5 PT, Y_AXIS);
509 d.translate_axis (-0.8 * staff_space PT, X_AXIS);
510 m.add_stencil (d);
512 if (reg.left_string (2) == "SS")
514 Stencil d = fm->find_by_name ("accordion-accDot");
515 d.translate_axis (0.5 * staff_space PT, Y_AXIS);
516 d.translate_axis (0.4 * staff_space PT, X_AXIS);
517 m.add_stencil (d);
518 d.translate_axis (-0.8 * staff_space PT, X_AXIS);
519 m.add_stencil (d);
520 reg = reg.right_string (reg.length ()-2);
522 if (reg.left_string (1) == "S")
524 Stencil d = fm->find_by_name ("accordion-accDot");
525 d.translate_axis (0.5 * staff_space PT, Y_AXIS);
526 m.add_stencil (d);
527 reg = reg.right_string (reg.length ()-1);
530 else if (sym == "Freebase")
532 Stencil r = fm->find_by_name ("accordion-accFreebase");
533 m.add_stencil (r);
534 if (reg.left_string (1) == "F")
536 Stencil d = fm->find_by_name ("accordion-accDot");
537 d.translate_axis (staff_space * 1.5 PT, Y_AXIS);
538 m.add_stencil (d);
539 reg = reg.right_string (reg.length ()-1);
541 if (reg == "E")
543 Stencil d = fm->find_by_name ("accordion-accDot");
544 d.translate_axis (staff_space * 0.5 PT, Y_AXIS);
545 m.add_stencil (d);
548 else if (sym == "Bayanbase")
550 Stencil r = fm->find_by_name ("accordion-accBayanbase");
551 m.add_stencil (r);
552 if (reg.left_string (1) == "T")
554 Stencil d = fm->find_by_name ("accordion-accDot");
555 d.translate_axis (staff_space * 2.5 PT, Y_AXIS);
556 m.add_stencil (d);
557 reg = reg.right_string (reg.length ()-1);
559 /* include 4' reed just for completeness. You don't want to use this. */
560 if (reg.left_string (1) == "F")
562 Stencil d = fm->find_by_name ("accordion-accDot");
563 d.translate_axis (staff_space * 1.5 PT, Y_AXIS);
564 m.add_stencil (d);
565 reg = reg.right_string (reg.length ()-1);
567 if (reg.left_string (2) == "EE")
569 Stencil d = fm->find_by_name ("accordion-accDot");
570 d.translate_axis (staff_space * 0.5 PT, Y_AXIS);
571 d.translate_axis (0.4 * staff_space PT, X_AXIS);
572 m.add_stencil (d);
573 d.translate_axis (-0.8 * staff_space PT, X_AXIS);
574 m.add_stencil (d);
575 reg = reg.right_string (reg.length ()-2);
577 if (reg.left_string (1) == "E")
579 Stencil d = fm->find_by_name ("accordion-accDot");
580 d.translate_axis (staff_space * 0.5 PT, Y_AXIS);
581 m.add_stencil (d);
582 reg = reg.right_string (reg.length ()-1);
585 else if (sym == "Stdbase")
587 Stencil r = fm->find_by_name ("accordion-accStdbase");
588 m.add_stencil (r);
589 if (reg.left_string (1) == "T")
591 Stencil d = fm->find_by_name ("accordion-accDot");
592 d.translate_axis (staff_space * 3.5 PT, Y_AXIS);
593 m.add_stencil (d);
594 reg = reg.right_string (reg.length ()-1);
596 if (reg.left_string (1) == "F")
598 Stencil d = fm->find_by_name ("accordion-accDot");
599 d.translate_axis (staff_space * 2.5 PT, Y_AXIS);
600 m.add_stencil (d);
601 reg = reg.right_string (reg.length ()-1);
603 if (reg.left_string (1) == "M")
605 Stencil d = fm->find_by_name ("accordion-accDot");
606 d.translate_axis (staff_space * 2 PT, Y_AXIS);
607 d.translate_axis (staff_space PT, X_AXIS);
608 m.add_stencil (d);
609 reg = reg.right_string (reg.length ()-1);
611 if (reg.left_string (1) == "E")
613 Stencil d = fm->find_by_name ("accordion-accDot");
614 d.translate_axis (staff_space * 1.5 PT, Y_AXIS);
615 m.add_stencil (d);
616 reg = reg.right_string (reg.length ()-1);
618 if (reg.left_string (1) == "S")
620 Stencil d = fm->find_by_name ("accordion-accDot");
621 d.translate_axis (staff_space * 0.5 PT, Y_AXIS);
622 m.add_stencil (d);
623 reg = reg.right_string (reg.length ()-1);
626 /* ugh maybe try to use regular font for S.B. and B.B and only use one font
627 for the rectangle */
628 else if (sym == "SB")
630 Stencil r = fm->find_by_name ("accordion-accSB");
631 m.add_stencil (r);
633 else if (sym == "BB")
635 Stencil r = fm->find_by_name ("accordion-accBB");
636 m.add_stencil (r);
638 else if (sym == "OldEE")
640 Stencil r = fm->find_by_name ("accordion-accOldEE");
641 m.add_stencil (r);
643 else if (sym == "OldEES")
645 Stencil r = fm->find_by_name ("accordion-accOldEES");
646 m.add_stencil (r);
648 return m;
651 Stencil
652 Lookup::repeat_slash (Real w, Real s, Real t)
654 SCM wid = scm_make_real (w);
655 SCM sl = scm_make_real (s);
656 SCM thick = scm_make_real (t);
657 SCM slashnodot = scm_list_n (ly_symbol2scm ("repeat-slash"),
658 wid, sl, thick, SCM_UNDEFINED);
660 Box b (Interval (0, w + sqrt (sqr (t/s) + sqr (t))),
661 Interval (0, w * s));
663 return Stencil (b, slashnodot); // http://slashnodot.org
667 Stencil
668 Lookup::bracket (Axis a, Interval iv, Real thick, Real protude, Real blot)
670 Box b;
671 Axis other = Axis ((a+1)%2);
672 b[a] = iv;
673 b[other] = Interval (-1, 1) * thick * 0.5;
675 Stencil m = round_filled_box (b, blot);
677 b[a] = Interval (iv[UP] - thick, iv[UP]);
678 Interval oi = Interval (-thick/2, thick/2 + fabs (protude)) ;
679 oi *= sign (protude);
680 b[other] = oi;
681 m.add_stencil (round_filled_box (b, blot));
682 b[a] = Interval (iv[DOWN], iv[DOWN] +thick);
683 m.add_stencil (round_filled_box (b,blot));
685 return m;
688 Stencil
689 Lookup::triangle (Interval iv, Real thick, Real protude)
691 Box b ;
692 b[X_AXIS] = iv;
693 b[Y_AXIS] = Interval (0 <? protude , 0 >? protude);
695 SCM s = scm_list_n (ly_symbol2scm ("symmetric-x-triangle"),
696 scm_make_real (thick),
697 scm_make_real (iv.length ()),
698 scm_make_real (protude), SCM_UNDEFINED);
700 return Stencil (b, s);
704 LY_DEFINE (ly_bracket ,"ly:bracket",
705 4, 0, 0,
706 (SCM a, SCM iv, SCM t, SCM p),
707 "Make a bracket in direction @var{a}. The extent of the bracket is "
708 "given by @var{iv}. The wings protude by an amount of @var{p}, which "
709 "may be negative. The thickness is given by @var{t}.")
711 SCM_ASSERT_TYPE (is_axis (a), a, SCM_ARG1, __FUNCTION__, "axis") ;
712 SCM_ASSERT_TYPE (is_number_pair (iv), iv, SCM_ARG2, __FUNCTION__, "number pair") ;
713 SCM_ASSERT_TYPE (ly_number_p (t), a, SCM_ARG3, __FUNCTION__, "number") ;
714 SCM_ASSERT_TYPE (ly_number_p (p), a, SCM_ARG4, __FUNCTION__, "number") ;
717 return Lookup::bracket ((Axis)ly_scm2int (a), ly_scm2interval (iv),
718 ly_scm2double (t),
719 ly_scm2double (p),
720 0.95 * ly_scm2double (t)).smobbed_copy ();
725 LY_DEFINE (ly_filled_box ,"ly:round-filled-box",
726 3, 0, 0,
727 (SCM xext, SCM yext, SCM blot),
728 "Make a @code{Stencil} "
729 "that prints a black box of dimensions @var{xext}, "
730 "@var{yext} and roundness @var{blot}."
733 SCM_ASSERT_TYPE (is_number_pair (xext), xext, SCM_ARG1, __FUNCTION__, "number pair") ;
734 SCM_ASSERT_TYPE (is_number_pair (yext), yext, SCM_ARG2, __FUNCTION__, "number pair") ;
735 SCM_ASSERT_TYPE (ly_number_p (blot), blot, SCM_ARG3, __FUNCTION__, "number") ;
737 return Lookup::round_filled_box (Box (ly_scm2interval (xext), ly_scm2interval (yext)),
738 ly_scm2double (blot)).smobbed_copy ();