]> git.lyx.org Git - lyx.git/blob - src/mathed/MathSupport.h
Display properly math characters that behave like symbols
[lyx.git] / src / mathed / MathSupport.h
1 // -*- C++ -*-
2 /**
3  * \file MathSupport.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Alejandro Aguilar Sierra
8  * \author André Pönitz
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef MATH_SUPPORT_H
14 #define MATH_SUPPORT_H
15
16 #include "MathParser_flags.h"
17 #include "support/strfwd.h"
18
19 namespace lyx {
20
21 class MetricsInfo;
22 class PainterInfo;
23 class FontInfo;
24 class Dimension;
25 class MathData;
26 class MathAtom;
27 class InsetMath;
28 class latexkeys;
29
30
31 int mathed_font_em(FontInfo const &);
32
33 int mathed_thinmuskip(FontInfo font);
34
35 int mathed_medmuskip(FontInfo font);
36
37 int mathed_thickmuskip(FontInfo font);
38
39 int mathed_char_width(FontInfo const &, char_type c);
40
41 int mathed_char_kerning(FontInfo const &, char_type c);
42
43 void mathed_draw_deco(PainterInfo & pi, int x, int y, int w, int h,
44         docstring const & name);
45
46 void mathed_string_dim(FontInfo const & font,
47                        docstring const & s,
48                        Dimension & dim);
49
50 int mathed_string_width(FontInfo const &, docstring const & s);
51
52 void mathedSymbolDim(MetricsInfo & mi, Dimension & dim, latexkeys const * sym);
53
54 void mathedSymbolDraw(PainterInfo & pi, int x, int y, latexkeys const * sym);
55
56 void metricsStrRedBlack(MetricsInfo & mi, Dimension & dim, docstring const & s);
57
58 void drawStrRed(PainterInfo & pi, int x, int y, docstring const & s);
59 void drawStrBlack(PainterInfo & pi, int x, int y, docstring const & s);
60
61 void math_font_max_dim(FontInfo const &, int & asc, int & desc);
62
63 void augmentFont(FontInfo & f, std::string const & cmd);
64
65 bool isFontName(std::string const & name);
66
67 bool isMathFont(std::string const & name);
68
69 bool isTextFont(std::string const & name);
70
71 bool isAlphaSymbol(MathAtom const & at);
72
73 // converts single cell to string
74 docstring asString(MathData const & ar);
75 // converts single inset to string
76 docstring asString(InsetMath const &);
77 docstring asString(MathAtom const &);
78 // converts string to single cell
79 void asArray(docstring const &, MathData &, Parse::flags f = Parse::NORMAL);
80
81 } // namespace lyx
82
83 #endif