]> git.lyx.org Git - lyx.git/blob - src/mathed/MathSupport.h
nullptr
[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 MetricsBase;
22 class MetricsInfo;
23 class PainterInfo;
24 class FontInfo;
25 class Dimension;
26 class MathData;
27 class MathAtom;
28 class InsetMath;
29 class latexkeys;
30 class LaTeXFeatures;
31
32
33 int mathed_font_em(FontInfo const &);
34
35 int mathed_font_x_height(FontInfo const & font);
36
37 int mathed_mu(FontInfo const & font, double mu);
38
39 int mathed_thinmuskip(FontInfo const & font);
40
41 int mathed_medmuskip(FontInfo const & font);
42
43 int mathed_thickmuskip(FontInfo const & font);
44
45 int mathed_char_width(FontInfo const &, char_type c);
46
47 int mathed_char_kerning(FontInfo const &, char_type c);
48
49 void mathed_draw_deco(PainterInfo & pi, int x, int y, int w, int h,
50         docstring const & name);
51
52 void mathed_string_dim(FontInfo const & font,
53                        docstring const & s,
54                        Dimension & dim);
55
56 int mathed_string_width(FontInfo const &, docstring const & s);
57
58 docstring const & mathedSymbol(MetricsBase & mb, latexkeys const * sym);
59
60 int mathedSymbolDim(MetricsBase & mb, Dimension & dim, latexkeys const * sym);
61
62 void mathedSymbolDraw(PainterInfo & pi, int x, int y, latexkeys const * sym);
63
64 void metricsStrRedBlack(MetricsInfo & mi, Dimension & dim, docstring const & s);
65
66 void drawStrRed(PainterInfo & pi, int x, int y, docstring const & s);
67 void drawStrBlack(PainterInfo & pi, int x, int y, docstring const & s);
68
69 void math_font_max_dim(FontInfo const &, int & asc, int & desc);
70
71 void augmentFont(FontInfo & f, std::string const & cmd);
72
73 bool isFontName(std::string const & name);
74
75 bool isMathFont(std::string const & name);
76
77 bool isTextFont(std::string const & name);
78
79 bool isAlphaSymbol(MathAtom const & at);
80
81 // converts single cell to string
82 docstring asString(MathData const & ar);
83 // converts single inset to string
84 docstring asString(InsetMath const &);
85 docstring asString(MathAtom const &);
86 // converts string to single cell
87 void asArray(docstring const &, MathData &, Parse::flags f = Parse::NORMAL);
88
89 // simulate axis height (font dimension sigma 22)
90 int axis_height(MetricsBase & mb);
91
92 void validate_math_word(LaTeXFeatures & features, docstring const & word);
93
94 } // namespace lyx
95
96 #endif