| 205 | |
| 206 | |
| 207 | bool 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 | |
| 236 | bool x86UNIXFont::isValidChar(const UTF16 str) const |
| 237 | { |