wPlot2D version: 0.1.0
A lightweight C++ library for clear and customizable 2D scientific plots.
Loading...
Searching...
No Matches
wFontComponent.hpp
Go to the documentation of this file.
1/*
2+---------------------------------------------------------------------------------------------------------------------------------------------------+
3Created by Wilfried Koch.
4Copyright @ 2025 Wilfried Koch. All rights reserved.
5+---------------------------------------------------------------------------------------------------------------------------------------------------+
6*/
7
8#ifndef W_FONT_COMPONENT_HPP
9#define W_FONT_COMPONENT_HPP
10
12
13#pragma GCC diagnostic push
14#pragma GCC diagnostic ignored "-Wfloat-equal"
15#pragma GCC diagnostic ignored "-Wswitch-default"
16#include <SFML/Graphics.hpp>
17#pragma GCC diagnostic pop
18
19namespace wEngine
20{
21
35 class FontComponent : public Component
36 {
37 public:
42 explicit FontComponent( const sf::Font& font );
43
47 ~FontComponent( ) override = default;
48
53 const sf::Font& getFont( ) const;
54
60 void setFont( const sf::Font& font );
61
65 void debugPrint( ) const;
66
67 private:
68 const sf::Font* mFont;
69 };
70
71}//End of namespace wEngine
72
73#endif
Component()
Protected constructor to restrict instantiation to derived classes.
Definition wComponent.cpp:17
void debugPrint() const
Prints debug information about the stored font.
Definition wFontComponent.cpp:45
~FontComponent() override=default
Virtual destructor.
void setFont(const sf::Font &font)
Updates the stored font reference.
Definition wFontComponent.cpp:34
FontComponent(const sf::Font &font)
Constructs the FontComponent with a reference to the font.
Definition wFontComponent.cpp:17
const sf::Font & getFont() const
Returns the stored font reference.
Definition wFontComponent.cpp:29
Definition wColorComponent.cpp:9