3 * \file InsetMathChar.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
12 #ifndef MATH_CHARINSET_H
13 #define MATH_CHARINSET_H
15 #include "InsetMath.h"
21 /// The base character inset.
22 class InsetMathChar : public InsetMath {
25 explicit InsetMathChar(char_type c);
27 void metrics(MetricsInfo & mi, Dimension & dim) const override;
29 void draw(PainterInfo & pi, int x, int y) const override;
31 void metricsT(TextMetricsInfo const & mi, Dimension & dim) const override;
33 void drawT(TextPainter &, int x, int y) const override;
35 int kerning(BufferView const *) const override { return kerning_; }
38 void write(TeXMathStream & os) const override;
40 void validate(LaTeXFeatures & features) const override;
42 void normalize(NormalStream & ns) const override;
44 void octave(OctaveStream & os) const override;
46 void mathmlize(MathMLStream & ms) const override;
48 void htmlize(HtmlStream & ms) const override;
49 /// identifies Charinsets
50 InsetMathChar const * asCharInset() const override { return this; }
52 char_type getChar() const override { return char_; }
54 MathClass mathClass() const override;
56 InsetCode lyxCode() const override { return MATH_CHAR_CODE; }
59 Inset * clone() const override;
61 char_type const char_;
62 /// cached kerning for superscript
64 /// Inset to substitute char for, for on-screen display in math mode, as
65 /// performed by LaTeX (#9893):
66 /// * -> \ast (U+2217)
67 /// - -> \lyxminus (U+2212)
68 /// : -> \ordinarycolon (U+2236)
70 /// For cosmetic reasons, +, >, <, and = are also substituted to force the
71 /// use of CM fonts for uniformity. If CM fonts are replaced with unicode
72 /// math fonts, this should be removed, and substitutions of "'", ",", and
75 /// Null if there is no substitute.
76 latexkeys const * const subst_;