]> git.donarmstrong.com Git - lilypond.git/blob - lily/paper-outputter.cc
1e8d450c7b31b2969df751f4e66dbf555371b6c5
[lilypond.git] / lily / paper-outputter.cc
1 /*
2   paper-outputter.cc -- implement Paper_outputter
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   Jan Nieuwenhuizen <janneke@gnu.org>
8 */
9
10 #include "paper-outputter.hh"
11 #include "paper-stream.hh"
12 #include "molecule.hh"
13 #include "atom.hh"
14 #include "array.hh"
15 #include "string-convert.hh"
16 #include "debug.hh"
17 #include "lookup.hh"
18 #include "main.hh"
19
20 Paper_outputter::Paper_outputter (Paper_stream *s)
21 {
22   outstream_l_ = s;
23 }
24
25 Paper_outputter::~Paper_outputter ()
26 {
27 }
28
29 void
30 Paper_outputter::output_molecule (Molecule const*m, Offset o, char const *nm, String s)
31 {
32   if (check_debug)
33     *outstream_l_ << String ("\n%start: ") << nm << "\n";
34
35   for (PCursor <Atom*> i (m->atoms_); i.ok (); i++)
36     {
37       Offset a_off = i->offset ();
38       a_off += o;
39
40       switch_to_font (i->font_);
41
42       Array<String> a;
43       String r;
44   
45       a.push (global_lookup_l->print_dimen (a_off.y()));
46       a.push (global_lookup_l->print_dimen (a_off.x()));
47       a.push (i->str_);
48       r += global_lookup_l->substitute_args (s, a);
49       *outstream_l_ << r;
50     }
51 }