MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / load

Method load

Engine/source/gfx/gFont.cpp:85–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85GFont* GFont::load( const Torque::Path& path )
86{
87 FileStream stream;
88
89 stream.open( path.getFullPath(), Torque::FS::File::Read );
90 if ( stream.getStatus() != Stream::Ok )
91 return NULL;
92
93 GFont *ret = new GFont;
94 ret->mGFTFile = path;
95
96 if(!ret->read(stream))
97 {
98 Con::errorf( "GFont::load - error reading '%s'", path.getFullPath().c_str() );
99 SAFE_DELETE(ret);
100 }
101 else
102 {
103 PlatformFont *platFont = createPlatformFont(ret->getFontFaceName(), ret->getFontSize(), ret->getFontCharSet());
104
105 if ( platFont == NULL )
106 {
107 Con::errorf( "GFont::load - error creating platform font for '%s'", path.getFullPath().c_str() );
108 SAFE_DELETE(ret);
109 }
110 else
111 ret->setPlatformFont(platFont);
112 }
113
114 return ret;
115}
116
117Resource<GFont> GFont::create(const String &faceName, U32 size, const char *cacheDirectory, U32 charset /* = TGE_ANSI_CHARSET */)
118{

Callers 15

createMethod · 0.45
preloadMethod · 0.45
setObjectModelMethod · 0.45
setMountedObjectMethod · 0.45
setObjectModelMethod · 0.45
_createDataFileMethod · 0.45
loadDecalsMethod · 0.45
loadShapeMethod · 0.45
enumDTSForImportFunction · 0.45
initializeAssetMethod · 0.45
loadTerrainMethod · 0.45
createEditorResourcesMethod · 0.45

Calls 10

getFontFaceNameMethod · 0.80
getFontSizeMethod · 0.80
getFontCharSetMethod · 0.80
setPlatformFontMethod · 0.80
openMethod · 0.65
errorfFunction · 0.50
createPlatformFontFunction · 0.50
getStatusMethod · 0.45
readMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected