MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / getCharacterInfo

Method getCharacterInfo

Source/Cache/FontCache.cpp:302–310  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300}
301
302std::tuple<Texture2D*, Rect> FontCache::getCharacterInfo(Font* font, bgfx::CodePoint character) {
303 const bgfx::GlyphInfo* glyphInfo = SharedFontManager.getGlyphInfo(font->getHandle(), character);
304 bgfx::Atlas* atlas = glyphInfo->atlas;
305 const bgfx::AtlasRegion& region = atlas->getRegion(glyphInfo->regionIndex);
306 if (font->getInfo().sdf) {
307 return std::make_tuple(atlas->getTexture(), Rect(region.x, region.y, region.width, region.height));
308 }
309 return std::make_tuple(atlas->getTexture(), Rect(region.x, region.y, region.width, region.height));
310}
311
312const bgfx::GlyphInfo* FontCache::getGlyphInfo(Font* font, bgfx::CodePoint character) {
313 return SharedFontManager.getGlyphInfo(font->getHandle(), character);

Callers 1

updateCharactersMethod · 0.80

Calls 6

RectClass · 0.70
getGlyphInfoMethod · 0.45
getHandleMethod · 0.45
getRegionMethod · 0.45
getInfoMethod · 0.45
getTextureMethod · 0.45

Tested by

no test coverage detected