]> git.lyx.org Git - lyx.git/blob - src/mathed/math_support.h
- reduce sizeof(MathCharInset) by 20 by better font caching
[lyx.git] / src / mathed / math_support.h
1 // -*- C++ -*-
2
3 #ifndef MATH_SUPPORT_H
4 #define MATH_SUPPORT_H
5
6 #include "math_defs.h"
7 #include "LString.h"
8
9 class Painter;
10 class TextPainter;
11 class latexkeys;
12 class MathMetricsInfo;
13 class MathInset;
14 class LyXFont;
15
16 extern char const * latex_mathspace[];
17
18 void mathed_char_dim(LyXFont const &, unsigned char c,
19         int & asc, int & des, int & wid);
20 int mathed_char_height(LyXFont const &, unsigned char c, int & asc, int & des);
21 int mathed_char_width(LyXFont const &, unsigned char c);
22 int mathed_char_ascent(LyXFont const &, unsigned char c);
23 int mathed_char_descent(LyXFont const &, unsigned char c);
24
25 void mathed_draw_deco(Painter & pain, int x, int y, int w, int h,
26         string const & name);
27
28 void mathed_draw_framebox(Painter & pain, int x, int y, MathInset const *);
29
30 void mathed_string_dim(LyXFont const &,
31         string const & s, int & asc, int & des, int & wid);
32 int mathed_string_height(LyXFont const &,
33         string const & s, int & asc, int & des);
34
35 int mathed_string_width(LyXFont const &, string const & s);
36 int mathed_string_ascent(LyXFont const &, string const & s);
37 int mathed_string_descent(LyXFont const &, string const & s);
38
39 void drawStr(Painter & pain, LyXFont const &, int x, int y, string const & s);
40 void drawChar(Painter & pain, LyXFont const & font, int x, int y, char c);
41
42 void math_font_max_dim(LyXFont const &, int & asc, int & desc);
43
44 bool math_font_available(MathTextCodes code);
45
46 // decrease math size for super- and subscripts
47 void smallerStyleScript(MathMetricsInfo &);
48
49 // decrease math size for fractions
50 void smallerStyleFrac(MathMetricsInfo & st);
51
52 char const * math_font_name(MathTextCodes type);
53
54 string convertDelimToLatexName(string const & name);
55
56 void whichFont(LyXFont & f, MathTextCodes type, MathMetricsInfo const & size);
57
58 #endif