From 42b9c241f3f147e704996670c05f79d63ebe0bbf Mon Sep 17 00:00:00 2001 From: GenevensiS <66968533+G-e-n-e-v-e-n-s-i-S@users.noreply.github.com> Date: Sat, 7 Feb 2026 02:45:41 +0100 Subject: [PATCH] rename Font to FontRef for consistency with SymbolFontRef --- src/data/field/choice.hpp | 2 +- src/data/field/information.hpp | 2 +- src/data/field/package_choice.hpp | 2 +- src/data/field/text.hpp | 2 +- src/data/font.cpp | 18 +++++++++--------- src/data/font.hpp | 10 +++++----- src/data/symbol_font.cpp | 2 +- src/data/symbol_font.hpp | 2 +- src/main.cpp | 2 +- src/render/text/element.cpp | 4 ++-- src/render/text/element.hpp | 4 ++-- src/render/value/choice.cpp | 2 +- src/render/value/multiple_choice.cpp | 2 +- src/render/value/package_choice.cpp | 2 +- src/util/rotation.cpp | 4 ++-- src/util/rotation.hpp | 6 +++--- 16 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/data/field/choice.hpp b/src/data/field/choice.hpp index 4b126be8..b8386cd5 100644 --- a/src/data/field/choice.hpp +++ b/src/data/field/choice.hpp @@ -167,7 +167,7 @@ public: ChoicePopupStyle popup_style; ///< Style of popups/menus ChoiceRenderStyle render_style; ///< Style of rendering - Font font; ///< Font for drawing text (when RENDER_TEXT) + FontRef font; ///< Font for drawing text (when RENDER_TEXT) CachedScriptableImage image; ///< Image to draw (when RENDER_IMAGE) map choice_images; ///< Images for the various choices (when RENDER_IMAGE) bool choice_images_initialized; diff --git a/src/data/field/information.hpp b/src/data/field/information.hpp index f305dd61..f54eedee 100644 --- a/src/data/field/information.hpp +++ b/src/data/field/information.hpp @@ -41,7 +41,7 @@ public: InfoStyle(const InfoFieldP&); DECLARE_STYLE_TYPE(Info); - Font font; ///< Font to use for the text + FontRef font; ///< Font to use for the text Alignment alignment; ///< Alignment inside the box double padding_left, padding_right; ///< Padding double padding_top, padding_bottom; diff --git a/src/data/field/package_choice.hpp b/src/data/field/package_choice.hpp index 3350be6c..e204a49f 100644 --- a/src/data/field/package_choice.hpp +++ b/src/data/field/package_choice.hpp @@ -44,7 +44,7 @@ public: PackageChoiceStyle(const PackageChoiceFieldP& field); DECLARE_STYLE_TYPE(PackageChoice); - Font font; ///< Font to use for the text + FontRef font; ///< Font to use for the text int update(Context&) override; }; diff --git a/src/data/field/text.hpp b/src/data/field/text.hpp index 0fbac382..9a967ac4 100644 --- a/src/data/field/text.hpp +++ b/src/data/field/text.hpp @@ -73,7 +73,7 @@ public: TextStyle(const TextFieldP&); DECLARE_STYLE_TYPE(Text); - Font font; ///< Font to use for the text + FontRef 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? diff --git a/src/data/font.cpp b/src/data/font.cpp index 23155e2f..da40bc22 100644 --- a/src/data/font.cpp +++ b/src/data/font.cpp @@ -14,7 +14,7 @@ // ----------------------------------------------------------------------------- : Font -Font::Font() +FontRef::FontRef() : name() , size(1) , underline(false) @@ -33,7 +33,7 @@ Font::Font() , flags(FONT_NORMAL) {} -bool Font::PreloadResourceFonts(bool recursive) { +bool FontRef::PreloadResourceFonts(bool recursive) { #if wxUSE_PRIVATE_FONTS String pathSeparator(wxFileName::GetPathSeparator()); String appPath(wxFileName(wxStandardPaths::Get().GetExecutablePath()).GetPath()); @@ -68,7 +68,7 @@ bool Font::PreloadResourceFonts(bool recursive) { return false; } -void Font::TallyResourceFonts(String fontsDirectoryPath, vector& fontFilePaths, bool recursive) { +void FontRef::TallyResourceFonts(String fontsDirectoryPath, vector& fontFilePaths, bool recursive) { wxDir fontsDirectory(fontsDirectoryPath); String fontFileName = _(""); bool hasNext = fontsDirectory.GetFirst(&fontFileName); @@ -86,7 +86,7 @@ void Font::TallyResourceFonts(String fontsDirectoryPath, vector& fontFil } } -bool Font::update(Context& ctx) { +bool FontRef::update(Context& ctx) { bool changes = false; changes |= name .update(ctx); changes |= italic_name .update(ctx); @@ -108,7 +108,7 @@ bool Font::update(Context& ctx) { | (style() == _("italic") ? FONT_ITALIC : FONT_NORMAL); return changes; } -void Font::initDependencies(Context& ctx, const Dependency& dep) const { +void FontRef::initDependencies(Context& ctx, const Dependency& dep) const { name .initDependencies(ctx, dep); italic_name .initDependencies(ctx, dep); size .initDependencies(ctx, dep); @@ -126,8 +126,8 @@ void Font::initDependencies(Context& ctx, const Dependency& dep) const { stroke_radius .initDependencies(ctx, dep); } -FontP Font::make(int add_flags, bool add_underline, bool add_strikethrough, String const* other_family, Color const* other_color, double const* other_size) const { - FontP f(new Font(*this)); +FontRefP FontRef::make(int add_flags, bool add_underline, bool add_strikethrough, String const* other_family, Color const* other_color, double const* other_size) const { + FontRefP f(new FontRef(*this)); f->flags |= add_flags; if (add_flags & FONT_CODE_STRING) { f->color = Color(0,0,100); @@ -163,7 +163,7 @@ FontP Font::make(int add_flags, bool add_underline, bool add_strikethrough, Stri } static const String BOLD_STRING = _(" Bold"); -wxFont Font::toWxFont(double scale) const { +wxFont FontRef::toWxFont(double scale) const { int size_i = to_int(scale * size); wxFontWeight weight_i = flags & FONT_BOLD ? wxFONTWEIGHT_BOLD : wxFONTWEIGHT_NORMAL; wxFontStyle style_i = flags & FONT_ITALIC ? wxFONTSTYLE_ITALIC : wxFONTSTYLE_NORMAL; @@ -203,7 +203,7 @@ wxFont Font::toWxFont(double scale) const { return font; } -IMPLEMENT_REFLECTION_NO_SCRIPT(Font) { +IMPLEMENT_REFLECTION_NO_SCRIPT(FontRef) { REFLECT(name); REFLECT(size); REFLECT(weight); diff --git a/src/data/font.hpp b/src/data/font.hpp index a1734c1e..dda0ef8d 100644 --- a/src/data/font.hpp +++ b/src/data/font.hpp @@ -13,11 +13,11 @@ #include