MCPcopy Create free account
hub / github.com/VCVRack/Rack / loadFontWithoutFallbacks

Method loadFontWithoutFallbacks

src/window/Window.cpp:783–800  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

781
782
783std::shared_ptr<Font> Window::loadFontWithoutFallbacks(const std::string& filename) {
784 // Return cached font, even if null
785 const auto& it = internal->fontCache.find(filename);
786 if (it != internal->fontCache.end())
787 return it->second;
788
789 // Load font
790 std::shared_ptr<Font> font = std::make_shared<Font>();
791 try {
792 font->loadFile(filename, vg);
793 }
794 catch (Exception& e) {
795 WARN("%s", e.what());
796 font = NULL;
797 }
798 internal->fontCache[filename] = font;
799 return font;
800}
801
802
803std::shared_ptr<Image> Window::loadImage(const std::string& filename) {

Callers

nothing calls this directly

Calls 2

whatMethod · 0.80
loadFileMethod · 0.45

Tested by

no test coverage detected