MCPcopy Create free account
hub / github.com/SFML/SFML / ShaperImpl

Method ShaperImpl

src/SFML/Graphics/Text.cpp:199–207  ·  view source on GitHub ↗

HarfBuzz font objects are linked to a specific FreeType face and a specific character size If we need to shape text using another font or another character size we will have to create a new shaper

Source from the content-addressed store, hash-verified

197 // If we need to shape text using another font or another
198 // character size we will have to create a new shaper
199 ShaperImpl(void* fontHandle, std::uint64_t theFontId, unsigned int theCharacterSize) :
200 fontId(theFontId),
201 characterSize(theCharacterSize),
202 shaper(hb_ft_font_create(static_cast<FT_Face>(fontHandle), nullptr)),
203 shapingBuffer(hb_buffer_create())
204 {
205 // Make HarfBuzz use FreeType font functions
206 hb_ft_font_set_funcs(shaper.get());
207 }
208
209 // To save on memory, instead of every sf::Text object having
210 // its own shaper, we try to share shapers among multiple

Callers

nothing calls this directly

Calls 1

getMethod · 0.80

Tested by

no test coverage detected