* scm/output-gnome.scm (named-glyph): Use it.
* scm/lily.scm (ly:all-stencil-expressions): Add named-glyph.
2004-12-11 Jan Nieuwenhuizen <janneke@gnu.org>
+ * lily/font-metric.cc (ly:font-get-glyph-index): New function.
+
+ * scm/output-gnome.scm (named-glyph): Use it.
+
+ * scm/lily.scm (ly:all-stencil-expressions): Add named-glyph.
+
* flower/string.cc (substitute_char): Rename, rewrite, modify this.
(upper_string, lower_string, reverse_string): Remove.
return fm->get_ascii_char_stencil (scm_to_int (index)).smobbed_copy ();
}
+LY_DEFINE (ly_font_get_glyph_index, "ly:font-get-glyph-index",
+ 2, 0, 0,
+ (SCM font, SCM name),
+ "Return the index for @{name} in @var{font}.")
+{
+ Font_metric *fm = unsmob_metrics (font);
+ SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
+ SCM_ASSERT_TYPE (scm_is_string (name), name, SCM_ARG2, __FUNCTION__, "string");
+
+ return scm_from_int (fm->name_to_index (ly_scm2string (name)));
+}
+
LY_DEFINE (ly_text_dimension,"ly:text-dimension",
2, 0, 0,
(SCM font, SCM text),
,(delay (ly:make-virtual-font
(ly:font-load "feta20")
(ly:font-load "parmesan20")))
-; ,(delay (ly:make-virtual-font (ly:font-load "bigcheese20")))
+ ,(delay (ly:make-virtual-font (ly:font-load "bigcheese20")))
,(delay (ly:make-virtual-font
(ly:font-load "feta23")
(ly:font-load "parmesan23")))
ez-ball
filledbox
horizontal-line
+ named-glyph
polygon
repeat-slash
round-filled-box
(lineto def tx (- ty))
(set-path-def props def)
props))
-
(define (list->offsets accum coords)
(if (null? coords)
accum
(cons (cons (car coords) (cadr coords))
- (list->offsets accum (cddr coords))
- )))
+ (list->offsets accum (cddr coords)))))
+
+(define (named-glyph font name)
+ (text font (integer->char (ly:font-get-glyph-index font name))))
(define (polygon coords blotdiameter)
(let*