144 public utility::Cache<MeasureTextCacheKey, utility::graphic::SizeF>,
146 components::Transform, components::Color>
149 std::shared_ptr<utility::RessourceProvider>
152 utility::Engine &_engine;
153 std::string _defaultFontPath;
166 std::shared_ptr<utility::RessourceProvider> ressourceProvider,
167 utility::Engine &engine);
void cleanup(void) override
Does nothing: the cache is kept from one frame to the next.
MeasureText(std::shared_ptr< utility::RessourceProvider > ressourceProvider, utility::Engine &engine)
Create the system in the Measure phase, with an empty cache.
virtual void update(const ecs::Entity::Identifier &entityIdentifier) override
Write the size of one text into its components::Bound, measuring it with the engine when it is not in...
~MeasureText(void)
Destroy the system and its cache.
void prepare(void) override
Does nothing: the system needs no per-frame setup.
Key of the size cache of MeasureText: everything a measured size is looked up by.
float fontSize
Font size the string was measured at.
bool operator<(const MeasureTextCacheKey &other) const
Order two keys by content, then font size, then color, then font weight.
theme::FontWeight fontWeight
Font weight, which selects the font file measured with.
utility::graphic::Color32Bit color
std::string content
The string that was measured.
bool operator==(const MeasureTextCacheKey &other) const
Compare two keys field by field.
bool operator!=(const MeasureTextCacheKey &other) const
Negation of operator==.