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

Method loadFont

source/rendering/StarTextPainter.cpp:527–540  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

525}
526
527FontPtr TextPainter::loadFont(String const& fontPath, Maybe<String> fontName) {
528 if (!fontName) {
529 auto name = AssetPath::filename(fontPath);
530 fontName.emplace(name.substr(0, name.findLast(".")));
531 }
532
533 auto assets = Root::singleton().assets();
534
535 auto font = assets->font(fontPath)->clone();
536 if (auto fontConfig = assets->json("/interface.config:font").opt(*fontName)) {
537 font->setAlphaThreshold(fontConfig->getUInt("alphaThreshold", 0));
538 }
539 return font;
540}
541}

Callers

nothing calls this directly

Calls 11

singletonClass · 0.85
assetsMethod · 0.80
fontMethod · 0.80
jsonMethod · 0.80
setAlphaThresholdMethod · 0.80
getUIntMethod · 0.80
emplaceMethod · 0.45
substrMethod · 0.45
findLastMethod · 0.45
cloneMethod · 0.45
optMethod · 0.45

Tested by

no test coverage detected