| 781 | |
| 782 | |
| 783 | std::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 | |
| 803 | std::shared_ptr<Image> Window::loadImage(const std::string& filename) { |