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
+52
View File
@@ -0,0 +1,52 @@
//+----------------------------------------------------------------------------+
//| Description: Magic Set Editor - Program to make Magic (tm) cards |
//| Copyright: (C) 2001 - 2006 Twan van Laarhoven |
//| License: GNU General Public License 2 or later (see file COPYING) |
//+----------------------------------------------------------------------------+
#ifndef HEADER_DATA_FONT
#define HEADER_DATA_FONT
// ----------------------------------------------------------------------------- : Includes
#include <util/prec.hpp>
#include <util/real_point.hpp>
#include <script/scriptable.hpp>
DECLARE_POINTER_TYPE(Font);
// ----------------------------------------------------------------------------- : Font
/// A font for rendering text
/** Contains additional information about scaling, color and shadow */
class Font {
public:
wxFont font; ///< The actual wxFont to use
double size; ///< Size of the font
double scale_down_to; ///< Smallest size to scale down to
Scriptable<Color> color; ///< Color to use
Scriptable<Color> shadow_color; ///< Color for shadow
RealSize shadow_displacement; ///< Position of the shadow
String italic_name; ///< Font name for italic text (optional)
Color separator_color; ///< Color for <sep> text
Font();
/// Update the scritables, returns true if there is a change
bool update(Context& ctx);
/// Add the given dependency to the dependent_scripts list for the variables this font depends on
virtual void initDependencies(Context&, const Dependency&) const;
/// Does this font have a shadow?
inline bool hasShadow() { return shadow_displacement.width != 0 || shadow_displacement.height != 0; }
/// Make a bold/italic version of this font
FontP make(bool bold, bool italic) const;
private:
DECLARE_REFLECTION();
};
// ----------------------------------------------------------------------------- : EOF
#endif