3 * Purpose: Implementation of insets for mathed
4 * Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
5 * Created: January 1996
8 * Dependencies: Xlib, XForms
10 * Copyright: 1996, 1997 Alejandro Aguilar Sierra
14 * You are free to use and modify this code under the terms of
15 * the GNU General Public Licence version 2 or later.
21 #pragma implementation
24 #include "math_iter.h"
25 #include "math_inset.h"
26 #include "symbol_def.h"
28 #include "mathed/support.h"
31 int MathedInset::df_asc;
32 int MathedInset::df_des;
33 int MathedInset::df_width;
34 int MathedInset::workWidth;
37 MathedInset::MathedInset(MathedInset * inset)
40 name = inset->GetName();
41 objtype = inset->GetType();
42 size = inset->GetStyle();
43 width = inset->Width();
44 ascent = inset->Ascent();
45 descent = inset->Descent();
47 objtype = LM_OT_UNDEF;
49 width = ascent = descent = 0;
55 MathedInset::MathedInset(string const & nm, short ot, short st):
56 name(nm), objtype(ot), size(st)
58 width = ascent = descent = 0;
62 // In a near future maybe we use a better fonts renderer
63 void MathedInset::drawStr(Painter & pain, short type, int siz,
64 int x, int y, string const & s)
67 if (MathIsBinary(type))
68 for (string::const_iterator it = s.begin(); it != s.end(); ++it) {
76 LyXFont const mf = mathed_get_font(type, siz);
77 pain.text(x, y, st, mf);