]> git.donarmstrong.com Git - lilypond.git/blob - lily/tex-lookup.cc
c87589f1a13d476abaf22ffcfb982077efd4bced
[lilypond.git] / lily / tex-lookup.cc
1 /*
2   tex-lookup.cc -- implement Tex_lookup
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--1998 Jan Nieuwenhuizen <janneke@gnu.org>
7   Jan Nieuwenhuizen <janneke@gnu.org>
8 */
9
10 #include "tex-lookup.hh"
11 #include "debug.hh"
12 #include "symtable.hh"
13 #include "scalar.hh"
14 #include "paper-def.hh"
15 #include "string-convert.hh"
16 #include "main.hh"
17 #include "file-results.hh"
18 #include "header.hh"
19 #include "paper-stream.hh"
20 #include "tex-stream.hh"
21 #include "tex-outputter.hh"
22
23 Tex_lookup::Tex_lookup ()
24   : Ps_lookup ()
25 {
26 }
27
28 Tex_lookup::Tex_lookup (Lookup const& s)
29   : Ps_lookup (s)
30 {
31 }
32
33 Tex_lookup::Tex_lookup (Symtables const& s)
34   : Ps_lookup (s)
35 {
36 }
37
38 Tex_lookup::~Tex_lookup()
39 {
40 }
41
42 Atom
43 Tex_lookup::afm_find (String s) const
44 {
45   return Lookup::afm_find (s, String ("\\char%d"));
46 }
47
48 Atom*
49 Tex_lookup::atom_p (String s, int n, Box b) const
50 {
51   if (s.length_i ())
52     s.prepend ("\\");
53   for (int i = 0; i < n; i++)
54     s += "{%}";
55   return new Atom (s, b);
56 }
57
58 String
59 Tex_lookup::character_str (int i) const
60 {
61   return Lookup::character_str (i);
62 }
63
64 Atom
65 Tex_lookup::dashed_slur (Array<Offset> controls, Real thick, Real dash) const
66 {
67   return embed (Ps_lookup::dashed_slur (controls, thick, dash));
68 }
69
70 Atom
71 Tex_lookup::embed (Atom a) const
72 {
73   a.str_ = "\\embeddedps{\n" + a.str_ + "}";
74   return a;
75 }
76
77 Atom
78 Tex_lookup::hairpin (Real width, bool decresc, bool continued) const
79 {
80   return embed (Ps_lookup::hairpin (width, decresc, continued));
81 }
82
83 Atom
84 Tex_lookup::plet (Real dy , Real dx, Direction dir) const
85 {
86   return embed (Ps_lookup::plet (dy, dx, dir));
87 }
88
89 Atom
90 Tex_lookup::ps_beam (Real slope, Real width, Real thick) const
91 {
92   return embed (Ps_lookup::ps_beam (slope, width, thick));
93 }
94
95 Atom
96 Tex_lookup::slur (Array<Offset> controls) const
97 {
98   return embed (Ps_lookup::slur (controls));
99 }
100
101 Atom
102 Tex_lookup::stem (Real y1, Real y2) const
103 {
104   return Lookup::stem (y1, y2, "\\kern %\\vrule width % height % depth %");
105 }
106
107 Atom
108 Tex_lookup::text (String style, String text) const
109 {
110   return Lookup::text (style, text);
111 }
112
113 Atom
114 Tex_lookup::vbracket (Real &y) const
115 {
116   return embed (Ps_lookup::vbracket (y));
117 }
118