From 141400d8aaa81e134501404f9635daf0a8ec65ec Mon Sep 17 00:00:00 2001 From: twanvl Date: Mon, 20 Nov 2006 14:48:53 +0000 Subject: [PATCH] implemented symbol font git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@81 0fc631ac-6414-0410-93d0-97cfa31319b6 --- src/data/field/choice.hpp | 5 +- src/data/field/text.cpp | 10 +- src/data/set.cpp | 2 +- src/data/symbol_font.cpp | 233 ++++++++++++++++++++++++++++++-- src/data/symbol_font.hpp | 41 ++++-- src/render/text/element.cpp | 2 +- src/render/text/element.hpp | 5 +- src/render/text/symbol.cpp | 11 +- src/render/text/viewer.cpp | 7 +- src/script/image.hpp | 3 +- src/script/scriptable.hpp | 3 +- src/util/io/package_manager.cpp | 6 +- src/util/real_point.hpp | 35 +++++ src/util/rotation.cpp | 5 + src/util/rotation.hpp | 7 +- src/util/smart_ptr.hpp | 10 ++ src/util/string.cpp | 3 + src/util/string.hpp | 2 + 18 files changed, 346 insertions(+), 44 deletions(-) diff --git a/src/data/field/choice.hpp b/src/data/field/choice.hpp index 89885f46..682f90bc 100644 --- a/src/data/field/choice.hpp +++ b/src/data/field/choice.hpp @@ -137,7 +137,10 @@ class ChoiceStyle : public Style { /// The Value in a ChoiceField class ChoiceValue : public Value { public: - inline ChoiceValue(const ChoiceFieldP& field) : Value(field) {} + inline ChoiceValue(const ChoiceFieldP& field) + : Value(field) + , value(field->initial, true) + {} DECLARE_HAS_FIELD(Choice) Defaultable value; /// The name of the selected choice diff --git a/src/data/field/text.cpp b/src/data/field/text.cpp index f1909ed6..44f2a5ef 100644 --- a/src/data/field/text.cpp +++ b/src/data/field/text.cpp @@ -55,12 +55,14 @@ TextStyle::TextStyle(const TextFieldP& field) {} bool TextStyle::update(Context& ctx) { - return Style::update(ctx) - | font.update(ctx); + return Style ::update(ctx) + | font .update(ctx) + | symbol_font.update(ctx); } void TextStyle::initDependencies(Context& ctx, const Dependency& dep) const { - Style::initDependencies(ctx, dep); - font.initDependencies(ctx, dep); + Style ::initDependencies(ctx, dep); + font .initDependencies(ctx, dep); + symbol_font.initDependencies(ctx, dep); } IMPLEMENT_REFLECTION(TextStyle) { diff --git a/src/data/set.cpp b/src/data/set.cpp index 77458d33..f2cb14bc 100644 --- a/src/data/set.cpp +++ b/src/data/set.cpp @@ -133,7 +133,7 @@ class Set::Styling { }; IndexMap& Set::stylingDataFor(const StyleSheet& stylesheet) { - StylingP& styling = styling_data[stylesheet.stylesheetName()]; + StylingP& styling = styling_data[stylesheet.name()]; if (!styling) { styling = new_shared(); styling->data.init(stylesheet.styling_fields); diff --git a/src/data/symbol_font.cpp b/src/data/symbol_font.cpp index d8c88ee1..b0c4872a 100644 --- a/src/data/symbol_font.cpp +++ b/src/data/symbol_font.cpp @@ -9,7 +9,13 @@ #include #include #include +#include +#include // fot CharInfo #include