MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / switchFont

Method switchFont

source/rendering/StarFontTextureGroup.cpp:16–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14}
15
16void FontTextureGroup::switchFont(String const& font) {
17 if (font.empty()) {
18 m_activeFont = m_defaultFont;
19 m_fontName.clear();
20 }
21 else if (m_fontName != font) {
22 m_fontName = font;
23 auto find = m_fonts.find(font);
24 m_activeFont = find != m_fonts.end() ? find->second : m_defaultFont;
25 }
26}
27
28String const& FontTextureGroup::activeFont() {
29 return m_fontName;

Callers 8

stringWidthMethod · 0.80
processWrapTextMethod · 0.80
setFontMethod · 0.80
clearTextStyleMethod · 0.80
applyCommandsMethod · 0.80
doRenderTextMethod · 0.80
doRenderLineMethod · 0.80

Calls 4

emptyMethod · 0.45
clearMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected