From: fred Date: Sat, 25 Jul 1998 16:18:03 +0000 (+0000) Subject: lilypond-1.0.1 X-Git-Tag: release/1.5.59~5880 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=f730376abf6cacf7d297c449f4413d7aff545646;p=lilypond.git lilypond-1.0.1 --- diff --git a/lily/tex-outputter.cc b/lily/tex-outputter.cc new file mode 100644 index 0000000000..67ea1fe0ab --- /dev/null +++ b/lily/tex-outputter.cc @@ -0,0 +1,94 @@ +/* + tex-outputter.cc -- implement Tex_outputter + + source file of the GNU LilyPond music typesetter + + (c) 1997--1998 Han-Wen Nienhuys +*/ + +#include "tex-outputter.hh" +#include "tex-stream.hh" +#include "molecule.hh" +#include "atom.hh" +#include "array.hh" +#include "dimension.hh" +#include "tex.hh" +#include "string-convert.hh" +#include "debug.hh" + +Tex_outputter::Tex_outputter (Tex_stream *s) +{ + outstream_l_ = s; +} + +/* + 26 fonts ought to be enough for anyone. +*/ +static String +tex_font_command(int i) +{ + return "\\font" +String_convert::form_str ("%c", 'A' + i) ; +} + +void +Tex_outputter::switch_to_font (String fontname) +{ + if (!fontname.length_i () || fontname == current_font_) + return; + + current_font_ = fontname; + int i=0; + for (; i< font_arr_.size (); i++) + if (font_arr_[i] == fontname) + { + *outstream_l_ < i (m->atoms_); i.ok (); i++) + { + Offset a_off = i->offset (); + a_off += o; + + switch_to_font (i->font_); + + Array a; + String r; + + + String s ("\\placebox{%}{%}{%}"); + a.push (print_dimen (a_off.y())); + a.push (print_dimen (a_off.x())); + a.push (i->tex_); + r += substitute_args (s, a); + *outstream_l_ << r; + } +} + + +void +Tex_outputter::start_line () +{ + *outstream_l_ << "\\hbox{%\n"; +} + +void +Tex_outputter::stop_line () +{ + *outstream_l_ << "}"; + *outstream_l_ << "\\interscoreline"; + current_font_ = ""; + font_arr_.clear (); +}