]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathBoldSymbol.C
fix reading UTF8 encoded symbol file
[lyx.git] / src / mathed / InsetMathBoldSymbol.C
1 /**
2  * \file InsetMathBoldSymbol.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author André Pönitz
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "InsetMathBoldSymbol.h"
14 #include "MathStream.h"
15 #include "MathData.h"
16 #include "LaTeXFeatures.h"
17 #include "support/std_ostream.h"
18
19
20 namespace lyx {
21
22 using std::auto_ptr;
23
24
25 InsetMathBoldSymbol::InsetMathBoldSymbol()
26         : InsetMathNest(1)
27 {}
28
29
30 auto_ptr<InsetBase> InsetMathBoldSymbol::doClone() const
31 {
32         return auto_ptr<InsetBase>(new InsetMathBoldSymbol(*this));
33 }
34
35
36 void InsetMathBoldSymbol::metrics(MetricsInfo & mi, Dimension & dim) const
37 {
38         //FontSetChanger dummy(mi.base, "mathbf");
39         cell(0).metrics(mi, dim);
40         metricsMarkers(dim);
41         ++dim.wid;  // for 'double stroke'
42         dim_ = dim;
43 }
44
45
46 void InsetMathBoldSymbol::draw(PainterInfo & pi, int x, int y) const
47 {
48         //FontSetChanger dummy(pi.base, "mathbf");
49         cell(0).draw(pi, x + 1, y);
50         cell(0).draw(pi, x + 2, y);
51         drawMarkers(pi, x, y);
52 }
53
54
55 void InsetMathBoldSymbol::metricsT(TextMetricsInfo const & mi, Dimension & /*dim*/) const
56 {
57         cell(0).metricsT(mi, dim_);
58 }
59
60
61 void InsetMathBoldSymbol::drawT(TextPainter & pain, int x, int y) const
62 {
63         cell(0).drawT(pain, x, y);
64 }
65
66
67 void InsetMathBoldSymbol::validate(LaTeXFeatures & features) const
68 {
69         InsetMathNest::validate(features);
70         features.require("amssymb");
71 }
72
73
74 void InsetMathBoldSymbol::write(WriteStream & os) const
75 {
76         os << "\\boldsymbol{" << cell(0) << "}";
77 }
78
79
80 void InsetMathBoldSymbol::infoize(odocstream & os) const
81 {
82         os << "Boldsymbol ";
83 }
84
85
86 } // namespace lyx