mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 12:58:08 +01:00
fixed cosmetic bug in geom. dpy window for 8bpp
removed --enable-kanji and added MultiByteText option rewrote font code to use WINGs made autoraise only work for the active window fixed compilation problem with OpenWindows and other non-X11R6 systems..
This commit is contained in:
@@ -37,98 +37,6 @@
|
||||
#include "pixmap.h"
|
||||
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
* wLoadFont--
|
||||
* Loads a single font into a WFont structure, initializing
|
||||
* data in it. If the font could not be loaded, fixed will be used.
|
||||
* If fixed can't be loaded either, the function returns NULL.
|
||||
*
|
||||
* Returns:
|
||||
* The font structure or NULL on error.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
WFont*
|
||||
wLoadFont(char *font_name)
|
||||
{
|
||||
WFont *font;
|
||||
#ifdef I18N_MB
|
||||
char **missing;
|
||||
int num_missing = 0;
|
||||
char *default_string;
|
||||
int skyline;
|
||||
#endif
|
||||
|
||||
font = malloc(sizeof(WFont));
|
||||
if (!font)
|
||||
return NULL;
|
||||
|
||||
#ifdef I18N_MB
|
||||
font->font = XCreateFontSet(dpy, font_name, &missing, &num_missing,
|
||||
&default_string);
|
||||
if (num_missing > 0 && font->font) {
|
||||
wwarning(_("The following character sets are missing in %s:"),
|
||||
font_name);
|
||||
for (skyline = 0; skyline < num_missing; skyline++)
|
||||
wwarning(missing[skyline]);
|
||||
XFreeStringList(missing);
|
||||
wwarning(_("The string \"%s\" will be used in place"),
|
||||
default_string);
|
||||
wwarning(_("of any characters from those sets."));
|
||||
}
|
||||
if (!font->font) {
|
||||
wwarning(_("could not create font set %s. Trying fixed"), font_name);
|
||||
font->font = XCreateFontSet(dpy, "-*-fixed-medium-r-normal-*-14-*-*-*-*-*-*-*",
|
||||
&missing, &num_missing, &default_string);
|
||||
if (num_missing > 0) {
|
||||
XFreeStringList(missing);
|
||||
}
|
||||
if (!font->font) {
|
||||
free(font);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
font->height = XExtentsOfFontSet(font->font)->max_logical_extent.height;
|
||||
font->y = font->height+XExtentsOfFontSet(font->font)->max_logical_extent.y;
|
||||
font->y = font->height-font->y;
|
||||
#else
|
||||
font->font = XLoadQueryFont(dpy, font_name);
|
||||
if (!font->font) {
|
||||
wwarning(_("could not load font %s. Trying fixed"), font_name);
|
||||
font->font = XLoadQueryFont(dpy, "fixed");
|
||||
if (!font->font) {
|
||||
free(font);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
font->height = font->font->ascent+font->font->descent;
|
||||
font->y = font->font->ascent;
|
||||
#endif /* !I18N_MB */
|
||||
|
||||
return font;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
wFreeFont(WFont *font)
|
||||
{
|
||||
#ifdef I18N_MB
|
||||
XFreeFontSet(dpy, font->font);
|
||||
#else
|
||||
XFreeFont(dpy, font->font);
|
||||
#endif
|
||||
free(font);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* wfatal(_("could not load any usable font set"));
|
||||
wfatal(_("could not load any usable font"));
|
||||
*/
|
||||
|
||||
|
||||
int
|
||||
wGetColor(WScreen *scr, char *color_name, XColor *color)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user