]> git.lyx.org Git - lyx.git/blob - src/mathed/MathSupport.h
Move metrics computation close to drawing for drawStrRed/Black
[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 #include <vector>
19
20 namespace lyx {
21
22 class PainterInfo;
23 class FontInfo;
24 class Dimension;
25 class MathData;
26 class MathAtom;
27 class InsetMath;
28
29
30 int mathed_char_width(FontInfo const &, char_type c);
31
32 int mathed_char_kerning(FontInfo const &, char_type c);
33
34 void mathed_draw_deco(PainterInfo & pi, int x, int y, int w, int h,
35         docstring const & name);
36
37 void mathed_string_dim(FontInfo const & font,
38                        docstring const & s,
39                        Dimension & dim);
40
41 int mathed_string_width(FontInfo const &, docstring const & s);
42
43 void metricsStrRedBlack(MetricsInfo & mi, Dimension & dim, docstring const & s);
44
45 void drawStrRed(PainterInfo & pi, int x, int y, docstring const & s);
46 void drawStrBlack(PainterInfo & pi, int x, int y, docstring const & s);
47
48 void math_font_max_dim(FontInfo const &, int & asc, int & desc);
49
50 void augmentFont(FontInfo & f, docstring const & cmd);
51
52 bool isFontName(docstring const & name);
53
54 bool isMathFont(docstring const & name);
55
56 bool isTextFont(docstring const & name);
57
58 // converts single cell to string
59 docstring asString(MathData const & ar);
60 // converts single inset to string
61 docstring asString(InsetMath const &);
62 docstring asString(MathAtom const &);
63 // converts string to single cell
64 void asArray(docstring const &, MathData &, Parse::flags f = Parse::NORMAL);
65
66 } // namespace lyx
67
68 #endif