28#include <utility/ressource_provider.hpp>
30#include <utility/cache.hpp>
32#include <utility/graphic/text/code_points.hpp>
34#include <utility/engine.hpp>
36#include "guillaume/ecs/system_filler.hpp"
38#include "guillaume/components/bound.hpp"
39#include "guillaume/components/glyph.hpp"
40#include "guillaume/components/transform.hpp"
41#include "guillaume/components/color.hpp"
59 utility::graphic::Color32Bit
92 return !(*
this == other);
148 public utility::Cache<MeasureGlyphCacheKey, utility::graphic::SizeF>,
150 components::Transform, components::Color>
153 std::shared_ptr<utility::RessourceProvider>
156 utility::Engine &_engine;
157 std::string _defaultFontPath;
158 std::string _glyphCodePath;
160 std::shared_ptr<utility::graphic::CodePoints>
163 bool _hasFont {
false };
177 std::shared_ptr<utility::RessourceProvider> ressourceProvider,
178 utility::Engine &engine);
Style
Family of the Material Symbols font the icon belongs to.
std::size_t Identifier
The key under which an entity's components are stored. Systems and components refer to entities by th...
The base class to derive a system from: a System whose signature is the list of component types given...
void prepare(void) override
Does nothing: the system needs no per-frame setup.
virtual void update(const ecs::Entity::Identifier &entityIdentifier) override
Write the size of one icon into its components::Bound, measuring it with the engine when it is not in...
~MeasureGlyph(void)
Destroy the system and its cache.
void cleanup(void) override
Does nothing: the cache is kept from one frame to the next.
MeasureGlyph(std::shared_ptr< utility::RessourceProvider > ressourceProvider, utility::Engine &engine)
Create the system in the Measure phase and load the icon font and its code point table.
Rules. Every class here runs each frame on the entities that have the components it declares.
Key of the size cache of MeasureGlyph: everything a measured icon size is looked up by.
bool operator==(const MeasureGlyphCacheKey &other) const
Compare two keys field by field.
components::Glyph::Style glyphStyle
Style of the icon (outlined, rounded, sharp).
utility::graphic::Color32Bit color
std::string glyphName
Name of the icon, such as "home".
float fontSize
Font size the icon was measured at.
bool operator!=(const MeasureGlyphCacheKey &other) const
Negation of operator==.
bool operator<(const MeasureGlyphCacheKey &other) const
Order two keys by name, then font size, then style, then color.