4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Alejandro Aguilar Sierra
10 * Full author contact details are available in file CREDITS.
13 #ifndef MATH_SUPPORT_H
14 #define MATH_SUPPORT_H
16 #include "MathParser_flags.h"
17 #include "support/strfwd.h"
33 int mathed_font_em(FontInfo const &);
35 int mathed_font_x_height(FontInfo const & font);
37 int mathed_mu(FontInfo const & font, double mu);
39 int mathed_thinmuskip(FontInfo const & font);
41 int mathed_medmuskip(FontInfo const & font);
43 int mathed_thickmuskip(FontInfo const & font);
45 int mathed_char_width(FontInfo const &, char_type c);
47 int mathed_char_kerning(FontInfo const &, char_type c);
49 double mathed_char_slope(MetricsBase const & mb, char_type c);
51 void mathed_draw_deco(PainterInfo & pi, int x, int y, int w, int h,
52 docstring const & name);
54 void mathed_string_dim(FontInfo const & font,
58 int mathed_string_width(FontInfo const &, docstring const & s);
60 docstring const & mathedSymbol(MetricsBase & mb, latexkeys const * sym);
62 int mathedSymbolDim(MetricsBase & mb, Dimension & dim, latexkeys const * sym);
64 void mathedSymbolDraw(PainterInfo & pi, int x, int y, latexkeys const * sym);
66 void metricsStrRedBlack(MetricsInfo & mi, Dimension & dim, docstring const & s);
68 void drawStrRed(PainterInfo & pi, int x, int y, docstring const & s);
69 void drawStrBlack(PainterInfo & pi, int x, int y, docstring const & s);
71 void math_font_max_dim(FontInfo const &, int & asc, int & desc);
73 void augmentFont(FontInfo & f, std::string const & cmd);
75 bool isFontName(std::string const & name);
77 bool isMathFont(std::string const & name);
79 bool isTextFont(std::string const & name);
81 bool isAlphaSymbol(MathAtom const & at);
83 // converts single cell to string
84 docstring asString(MathData const & ar);
85 // converts single inset to string
86 docstring asString(InsetMath const &);
87 docstring asString(MathAtom const &);
88 // converts string to single cell
89 void asArray(docstring const &, MathData &, Parse::flags f = Parse::NORMAL);
91 // simulate axis height (font dimension sigma 22)
92 int axis_height(MetricsBase & mb);
94 void validate_math_word(LaTeXFeatures & features, docstring const & word);