MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / LoadFont

Method LoadFont

engine/Poseidon/UI/Text/FontRenderer.cpp:75–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75bool 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
89bool FontRenderer::LoadFontFromStream(QIStream& stream)
90{

Callers 15

setupFontTextWidthFunction · 0.45
RunMainLoopMethod · 0.45
DrawMethod · 0.45
DrawMPTableMethod · 0.45
InitMethod · 0.45
DrawNetworkStatisticsFunction · 0.45
LoadSoundMethod · 0.45
CWarrantMethod · 0.45
MsgBoxMethod · 0.45
CStaticMapMethod · 0.45
InGameUIMethod · 0.45

Calls 5

tellgMethod · 0.80
seekgMethod · 0.80
sizeMethod · 0.80
resizeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected