2 #ifndef MATH_CHARINSET_H
3 #define MATH_CHARINSET_H
5 #include "math_diminset.h"
11 /** The base character inset.
15 class MathCharInset : public MathDimInset {
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;
39 /// identifies Charinsets
40 MathCharInset const * asCharInset() const { return this; }
42 char getChar() const { return char_; }
44 MathTextCodes code() const { return code_; }
48 void validate(LaTeXFeatures & features) const;
50 void handleFont(MathTextCodes t);
52 bool match(MathInset *) const;
53 /// identifies complicated things that need braces if used as arg
54 bool needsBraces() const { return false; }
59 /// the font to be used on screen
62 mutable MathMetricsInfo mi_;