2 #ifndef MATH_CHARINSET_H
3 #define MATH_CHARINSET_H
5 #include "math_inset.h"
11 /** The base character inset.
15 class MathCharInset : public MathInset {
18 explicit MathCharInset(char c);
20 MathCharInset(char c, MathTextCodes t);
22 MathInset * clone() const;
24 static MathTextCodes nativeCode(char c);
26 void metrics(MathMetricsInfo const & st) const;
28 void draw(Painter &, int x, int y) const;
30 void write(WriteStream & os) const;
32 void writeHeader(std::ostream &) const;
34 void writeTrailer(std::ostream &) const;
36 void writeRaw(std::ostream &) const;
38 void normalize(NormalStream &) const;
45 /// identifies Charinsets
46 MathCharInset const * asCharInset() const { return this; }
48 char getChar() const { return char_; }
50 MathTextCodes code() const { return code_; }
54 void validate(LaTeXFeatures & features) const;
56 void handleFont(MathTextCodes t);
58 bool match(MathInset *) const;
63 /// the font to be used on screen
66 mutable MathMetricsInfo mi_;