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

Method create

Engine/source/platformX11/X11Font.client.cpp:207–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205
206
207bool x86UNIXFont::create(const char *name, dsize_t size, U32 charset)
208{
209 Display *display = XOpenDisplay(getenv("DISPLAY"));
210 if (display == NULL)
211 AssertFatal(false, "createFont: cannot connect to X server");
212
213 XftFont *font = loadFont(name, size, display);
214
215 if (!font)
216 {
217 Con::errorf("Error: Could not load font -%s-", name);
218 return false;
219 }
220 char xfontname[1024];
221 XftNameUnparse(font->pattern, xfontname, 1024);
222#ifdef DEBUG
223 Con::printf("CreateFont: request for %s %d, using %s", name, size, xfontname);
224#endif
225 // store some info about the font
226 baseline = font->ascent;
227 height = font->height;
228 mFontName = StringTable->insert(xfontname);
229 XftFontClose (display, font);
230 // DISPLAY
231 XCloseDisplay(display);
232
233 return true;
234}
235
236bool x86UNIXFont::isValidChar(const UTF16 str) const
237{

Callers 1

createPlatformFontFunction · 0.45

Calls 5

getenvFunction · 0.85
printfFunction · 0.85
loadFontFunction · 0.70
errorfFunction · 0.50
insertMethod · 0.45

Tested by

no test coverage detected