-/*
+/*
font-metric.cc -- implement Font_metric
-
+
source file of the GNU LilyPond music typesetter
-
+
(c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
- Mats Bengtsson <matsb@s3.kth.se> (the ugly TeX parsing in text_dimension)
+ Mats Bengtsson <matsb@s3.kth.se> (the ugly TeX parsing in text_dimension)
*/
#include "font-metric.hh"
return 1.0 * point_constant;
}
-
Stencil
Font_metric::find_by_name (String s) const
{
s.substitute_char ('-', "M");
int idx = name_to_index (s);
Box b;
-
+
SCM expr = SCM_EOL;
if (idx >= 0)
{
expr = scm_list_3 (ly_symbol2scm ("named-glyph"),
self_scm (),
- scm_makfrom0str (s.to_str0 ())
- );
+ scm_makfrom0str (s.to_str0 ()));
b = get_indexed_char (idx);
}
-
+
Stencil q (b, expr);
return q;
}
{
}
-
Font_metric::~Font_metric ()
{
}
return 0;
}
-Box
+Box
Font_metric::get_ascii_char (int) const
{
return Box (Interval (0, 0), Interval (0, 0));
}
-Box
+Box
Font_metric::get_indexed_char (int k) const
{
return get_ascii_char (k);
SCM
Font_metric::mark_smob (SCM s)
{
- Font_metric *m = (Font_metric*) SCM_CELL_WORD_1 (s);
+ Font_metric *m = (Font_metric *) SCM_CELL_WORD_1 (s);
m->derived_mark ();
return m->description_;
}
return 1;
}
-
-
IMPLEMENT_SMOBS (Font_metric);
IMPLEMENT_DEFAULT_EQUAL_P (Font_metric);
IMPLEMENT_TYPE_P (Font_metric, "ly:font-metric?");
-
-SCM
+SCM
Font_metric::font_file_name () const
{
return scm_car (description_);
#include "afm.hh"
-
int
Font_metric::index_to_ascii (int i) const
{
return Stencil (b, at);
}
-
Offset
Font_metric::attachment_point (String) const
{
SCM lst = scm_list_3 (ly_symbol2scm ("text"),
this->self_scm (),
scm_makfrom0str (str.to_str0 ()));
-
+
Box b = text_dimension (str);
return Stencil (b, lst);
}