| 73 | } |
| 74 | |
| 75 | bool FontRenderer::LoadFont(const std::string& path) |
| 76 | { |
| 77 | std::ifstream file(path, std::ios::binary | std::ios::ate); |
| 78 | if (!file) |
| 79 | return false; |
| 80 | auto size = file.tellg(); |
| 81 | if (size <= 0) |
| 82 | return false; |
| 83 | _fontData.resize(static_cast<size_t>(size)); |
| 84 | file.seekg(0); |
| 85 | file.read(reinterpret_cast<char*>(_fontData.data()), size); |
| 86 | return LoadFontFromMemory(_fontData.data(), _fontData.size()); |
| 87 | } |
| 88 | |
| 89 | bool FontRenderer::LoadFontFromStream(QIStream& stream) |
| 90 | { |
no test coverage detected