argument.
* lily/tfm.cc (name_to_index): new function, use encoding_table_.
* lily/scaled-font-metric.cc (text_dimension): init
coding_{permutation,table}_ too
(LY_DEFINE): ly:font-encoding, new function return
2004-04-06 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * scm/output-tex.scm: remove fontify; text and char take a font
+ argument.
+
+ * lily/tfm.cc (name_to_index): new function, use encoding_table_.
+
+ * lily/scaled-font-metric.cc (text_dimension): init
+ coding_{permutation,table}_ too
+ (LY_DEFINE): ly:font-encoding, new function return
+
+ * lily/paper-def.cc (find_scaled_font): take input coding from
+ inputcoding paper var.
+
* lily/performance.cc (output): remap modulo 16.
* lily/text-item.cc (interpret_markup): whoops, variable
w += b[X_AXIS].length ();
ydims.unite (b[Y_AXIS]);
}
+ if (ydims.is_empty ())
+ ydims = Interval (0, 0);
+
+ b = Box(Interval(0,w), ydims);
}
else
{
Box char_box;
- if (!gh_symbol_p (sym))
+ if (!gh_symbol_p (sym) && !gh_string_p (sym))
continue;
-
- int idx = orig_->name_to_index (SCM_SYMBOL_CHARS(sym));
+ char const * chars = gh_symbol_p (sym)
+ ? SCM_SYMBOL_CHARS(sym) : SCM_STRING_CHARS(sym);
+
+
+ int idx = orig_->name_to_index (chars);
if (idx >= 0)
{
char_box = orig_->get_indexed_char (idx);
}
+
if (!char_box[X_AXIS].is_empty ())
w += char_box[X_AXIS][RIGHT]; // length ?
ydims.unite (char_box[Y_AXIS]);
}
+ if (ydims.is_empty ())
+ ydims = Interval (0, 0);
+
b = Box (Interval (0, w), ydims);
}
"Given the Modified_font_metric @var{font}, return a "
"list containing (input-coding, output-coding, permutation).")
{
- Modified_font_metric * fm = dynamic_cast<Modified_font_metric *> ( unsmob_metrics (font));
- SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "Modified_font_metric");
+ Modified_font_metric * fm
+ = dynamic_cast<Modified_font_metric*> (unsmob_metrics (font));
+ SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "Modified_font_metric");
return scm_list_3 (fm->coding_vector_,
fm->coding_table_,
fm->coding_permutation_);
Stencil::moved_to_edge (Axis a, Direction d, Stencil const &s, Real padding,
Real minimum) const
{
- Real my_extent= is_empty () ? 0.0 : dim_[a][d];
+ Interval my_extent= dim_[a];
+
+
Interval i (s.extent (a));
Real his_extent;
if (i.is_empty ())
else
his_extent = i[-d];
- Real offset = (my_extent - his_extent) + d * padding;
+ Real offset = (my_extent. is_empty () ? 0.0 : my_extent[d] - his_extent)
+ + d * padding;
Stencil toadd (s);
toadd.translate_axis (offset,a);
/* See scheme Function. */
void
Stencil::add_at_edge (Axis a, Direction d, Stencil const &s, Real padding,
- Real minimum)
+ Real minimum)
{
add_stencil (moved_to_edge (a,d,s,padding, minimum));
}
int
Tex_font_metric::name_to_index (String s) const
{
- SCM sym = ly_symbol2scm (s.to_str0 ());
+ SCM sym = scm_makfrom0str (s.to_str0 ());
SCM idx = scm_hash_ref (encoding_table_, sym, SCM_BOOL_F);
- if (scm_integer_p (idx) == SCM_BOOL_T)
+ if (gh_char_p (idx))
{
- return gh_scm2int (idx);
+ return (unsigned char) gh_scm2char (idx);
}
else
return -1;
(inexact->exact (round (* 1000 (ly:font-magnification font)))))))
(define (define-fonts paper font-list)
-
- (define (fontname->designsize fontname)
- (let ((i (string-index fontname char-numeric?)))
- (string->number (substring fontname i))))
-
(define (define-font command fontname scaling)
(string-append
"/" command " { /" fontname " findfont "
(define (text font s)
(let*
((perm (caddr (ly:font-encoding font))))
- (display (ly:font-encoding font))
(string-append "\\hbox{\\" (font-command font) "{}"
(output-tex-string
(if (vector? perm)