Basic text rendering working;

Added Font (done) and SymbolFont (skeleton);
Added styling to set;
Added CountourMap;
Some script fixes

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@73 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-11-17 17:57:04 +00:00
parent ea5be88bdb
commit ce6a83e34b
45 changed files with 1595 additions and 84 deletions
+23 -12
View File
@@ -12,7 +12,10 @@
#include <util/prec.hpp>
#include <util/defaultable.hpp>
#include <data/field.hpp>
#include <data/font.hpp>
#include <data/symbol_font.hpp>
#include <script/scriptable.hpp>
#include <gfx/gfx.hpp>
// ----------------------------------------------------------------------------- : TextField
@@ -31,7 +34,9 @@ class TextField : public Field {
bool multi_line; ///< Are newlines allowed in the text?
bool move_cursor_with_sort; ///< When the text is reordered by a script should the cursor position be updated?
String default_name; ///< Name of "default" value
virtual void initDependencies(Context&, const Dependency&) const;
private:
DECLARE_REFLECTION();
};
@@ -44,21 +49,25 @@ class TextStyle : public Style {
TextStyle(const TextFieldP&);
DECLARE_STYLE_TYPE(Text);
// FontInfo font; ///< Font to use for the text
// SymbolFontInfo symbol_font; ///< Symbol font for symbols in the text
bool always_symbol; ///< Should everything be drawn as symbols?
bool allow_formating; ///< Is formating (bold/italic/..) allowed?
Alignment alignment; ///< Alignment inside the box
int angle; ///< Angle of the text inside the box
Font font; ///< Font to use for the text
SymbolFontRef symbol_font; ///< Symbol font for symbols in the text
bool always_symbol; ///< Should everything be drawn as symbols?
bool allow_formating; ///< Is formating (bold/italic/..) allowed?
Alignment alignment; ///< Alignment inside the box
int angle; ///< Angle of the text inside the box
double padding_left, padding_left_min; ///< Padding
double padding_right, padding_right_min; ///< Padding
double padding_top, padding_top_min; ///< Padding
double padding_bottom, padding_bottom_min; ///< Padding
double line_height_soft; ///< Line height for soft linebreaks
double line_height_hard; ///< Line height for hard linebreaks
double line_height_line; ///< Line height for <line> tags
String mask_filename; ///< Filename of the mask
// ContourMaskP mask; ///< Mask to fit the text to (may be null)
double line_height_soft; ///< Line height for soft linebreaks
double line_height_hard; ///< Line height for hard linebreaks
double line_height_line; ///< Line height for <line> tags
String mask_filename; ///< Filename of the mask
ContourMask mask; ///< Mask to fit the text to (may be null)
virtual bool update(Context&);
virtual void initDependencies(Context&, const Dependency&) const;
private:
DECLARE_REFLECTION();
};
@@ -74,6 +83,8 @@ class TextValue : public Value {
Defaultable<String> value; ///< The text of this value
virtual String toString() const;
virtual bool update(Context&);
private:
DECLARE_REFLECTION();
};