00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef CMSTYLE_H
00021 #define CMSTYLE_H
00022
00023 #include "fontstyle.h"
00024
00025 KFORMULA_NAMESPACE_BEGIN
00026
00027
00028 class CMAlphaTable : public AlphaTable {
00029 public:
00030
00031 CMAlphaTable();
00032
00033 virtual AlphaTableEntry entry( short pos, CharFamily family, CharStyle style ) const;
00034
00035 private:
00036
00037 };
00038
00039
00040 class CMStyle : public FontStyle {
00041 public:
00042
00047 virtual bool init( ContextStyle* context, bool install = true );
00048
00050 virtual const AlphaTable* alphaTable() const;
00051
00052 virtual Artwork* createArtwork( SymbolType type = EmptyBracket ) const;
00053
00054 static QStringList missingFonts( bool install = true );
00055
00056 static bool m_installed;
00057
00058 private:
00059
00060 static QStringList missingFontsInternal();
00061 static void installFonts();
00062
00063 CMAlphaTable m_alphaTable;
00064 };
00065
00066
00067 class CMArtwork : public Artwork {
00068 public:
00069 CMArtwork( SymbolType t );
00070
00071 virtual void calcSizes( const ContextStyle& style,
00072 ContextStyle::TextStyle tstyle,
00073 luPt parentSize );
00074 virtual void calcSizes( const ContextStyle& style,
00075 ContextStyle::TextStyle tstyle );
00076
00077 virtual void draw( QPainter& painter, const LuPixelRect& r,
00078 const ContextStyle& style,
00079 ContextStyle::TextStyle tstyle,
00080 luPt parentSize, const LuPixelPoint& origin );
00081 virtual void draw( QPainter& painter, const LuPixelRect& r,
00082 const ContextStyle& style,
00083 ContextStyle::TextStyle tstyle,
00084 const LuPixelPoint& parentOrigin );
00085
00086 virtual bool isNormalChar() const;
00087
00088 virtual double slant() const;
00089
00090 private:
00091
00092 bool calcCMDelimiterSize( const ContextStyle& context, uchar c,
00093 luPt fontSize, luPt parentSize );
00094 void calcLargest( const ContextStyle& context, uchar c, luPt fontSize );
00095 void drawCMDelimiter( QPainter& painter, const ContextStyle& style,
00096 luPixel x, luPixel y, luPt height );
00097
00098 short cmChar;
00099 };
00100
00101 KFORMULA_NAMESPACE_END
00102
00103 #endif