source file of the GNU LilyPond music typesetter
- (c) 1999--2001 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1999--2002 Jan Nieuwenhuizen <janneke@gnu.org>
some code shamelessly copied from GNU fontutils-0.6/tfm/tfm_input.c
#include "string-convert.hh"
#include "debug.hh"
#include "warn.hh"
+#include "dimensions.hh"
Box
Tex_font_char_metric::dimensions () const
}
Real d = -depth_;
- return Box (Interval (0, width_),Interval ( d <? height_, d >? height_));
+
+ Real point_constant = 1 PT;
+
+ return Box (Interval (0, width_*point_constant ),
+ Interval ((d <? height_)*point_constant,
+ (d >? height_)*point_constant));
}
Tex_font_char_metric::Tex_font_char_metric ()
Tex_font_char_metric const *
Tex_font_metric::find_ascii (int ascii, bool warn) const
{
- if (ascii < ascii_to_metric_idx_.size() && ascii_to_metric_idx_[ascii] >= 0)
+ if (ascii < ascii_to_metric_idx_.size () && ascii_to_metric_idx_[ascii] >= 0)
return & char_metrics_[ascii_to_metric_idx_ [ascii]];
else if (warn)
{
return &dummy_static_char_metric;
}
+
+/*
+ UGH: glyphs need not be consecutive in TFM.
+ */
+int
+Tex_font_metric::count () const
+{
+ for (int i = ascii_to_metric_idx_.size (); i--;)
+ {
+ if (ascii_to_metric_idx_[i] != -1)
+ return i + 1;
+ }
+ return 0;
+}
+
Box
Tex_font_metric::get_char (int a) const
{