2 ps-outputter.cc -- implement Ps_outputter
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 Jan Nieuwenhuizen <janneke@gnu.org>
10 #include "ps-outputter.hh"
11 #include "ps-stream.hh"
12 #include "molecule.hh"
15 #include "string-convert.hh"
20 Ps_outputter::Ps_outputter (Paper_stream *s)
25 Ps_outputter::~Ps_outputter ()
30 26 fonts ought to be enough for anyone.
33 ps_font_command(int i)
36 // return "%\\font" + String_convert::form_str ("%c", 'A' + i) + "\n";
37 return "\n/feta20 findfont 12 scalefont setfont ";
41 Ps_outputter::switch_to_font (String fontname)
43 if (!fontname.length_i () || fontname == current_font_)
46 current_font_ = fontname;
48 for (; i< font_arr_.size (); i++)
49 if (font_arr_[i] == fontname)
51 *outstream_l_ <<ps_font_command (i) << "\n";
56 font_arr_.push (fontname);
57 *outstream_l_ << "%\\font" + ps_font_command (i) << "% =" + fontname << "\n";
58 *outstream_l_<< ps_font_command (i) << "\n";
62 Ps_outputter::output_molecule (Molecule const*m, Offset o, char const *nm)
65 *outstream_l_ << String ("\n%start: ") << nm << "\n";
67 Paper_outputter::output_molecule (m, o, nm, "% % {%}placebox \n", "'ps");
71 Ps_outputter::start_line ()
73 *outstream_l_ << "\nstart_line {\n";
77 Ps_outputter::stop_line ()
79 *outstream_l_ << "}\nstop_line\n";