mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 04:20:27 +01:00
- Removed obsoleted options from WMGLOBAL and from the WINGs internal
structures (no longer needed with xft) - Fixed default system font names (converted from xlfd to fontconfig names) - A bit of code cleanups related to xft - Replaced harcoded xlfd font names in wmaker and WPrefs with fontconfig names.
This commit is contained in:
11
TODO
11
TODO
@@ -5,12 +5,19 @@ To do before next release:
|
||||
and give a warning if font is not converted, but let user manually convert
|
||||
it with convertfonts as the process may need manual tweaking for best
|
||||
results)
|
||||
- Append .UTF-8 to locale
|
||||
- figure out a better gnustep path for wprefs.app installation
|
||||
- figure a better fullscreen level
|
||||
- check whether window states are being saved/restored properly via netwm
|
||||
on restart/crash-restart (grep for XXX/TODO)
|
||||
|
||||
1. make AntialiasedText in WMGLOBAL work
|
||||
2. make wmaker read old xlfd, but warn about them so people use convert
|
||||
(I think it reads them, but the warning needs to be added)
|
||||
3. Set the default font
|
||||
4. Change all xlfd fonts we still use hardcoded in wmaker/wprefs
|
||||
5. Update NEWS/Changelog (remove old info that only applies to xft1)
|
||||
|
||||
=====================================================================
|
||||
|
||||
remake wrlib rule to not compile with -fomit-frame-pointer and stuff
|
||||
if its added to CFLAGS
|
||||
|
||||
|
||||
@@ -236,10 +236,6 @@ typedef struct W_Screen {
|
||||
|
||||
WMHashTable *fontCache;
|
||||
|
||||
Bool useMultiByte;
|
||||
|
||||
Bool useWideChar;
|
||||
|
||||
Bool antialiasedText;
|
||||
|
||||
unsigned int ignoredModifierMask; /* modifiers to ignore when typing txt */
|
||||
@@ -453,7 +449,6 @@ typedef struct _WINGsConfiguration {
|
||||
char *boldSystemFont;
|
||||
int defaultFontSize;
|
||||
Bool antialiasedText;
|
||||
Bool useMultiByte;
|
||||
char *floppyPath;
|
||||
unsigned doubleClickDelay;
|
||||
unsigned mouseWheelUp;
|
||||
|
||||
@@ -10,9 +10,9 @@ _WINGsConfiguration WINGsConfiguration;
|
||||
|
||||
|
||||
|
||||
#define SYSTEM_FONT "-*-helvetica-medium-r-normal-*-%d-*-*-*-*-*-*-*,-*-*-medium-r-*-*-%d-*-*-*-*-*-*-*"
|
||||
#define SYSTEM_FONT "sans:pixelsize=12"
|
||||
|
||||
#define BOLD_SYSTEM_FONT "-*-helvetica-bold-r-normal-*-%d-*-*-*-*-*-*-*,-*-*-bold-r-*-*-%d-*-*-*-*-*-*-*"
|
||||
#define BOLD_SYSTEM_FONT "sans:bold:pixelsize=12"
|
||||
|
||||
#define FLOPPY_PATH "/floppy"
|
||||
|
||||
@@ -106,28 +106,6 @@ W_ReadConfigurations(void)
|
||||
WINGsConfiguration.antialiasedText =
|
||||
WMGetUDBoolForKey(defaults, "AntialiasedText");
|
||||
|
||||
WINGsConfiguration.useMultiByte = False;
|
||||
str = WMGetUDStringForKey(defaults, "MultiByteText");
|
||||
if (str) {
|
||||
if (strcasecmp(str, "YES") == 0) {
|
||||
WINGsConfiguration.useMultiByte = True;
|
||||
} else if (strcasecmp(str, "AUTO") == 0) {
|
||||
char *locale;
|
||||
|
||||
/* if it's a multibyte language (japanese, chinese or korean)
|
||||
* then set it to True */
|
||||
locale = setlocale(LC_CTYPE, NULL);
|
||||
if (locale != NULL
|
||||
&& (strncmp(locale, "ja", 2) == 0
|
||||
|| strncmp(locale, "zh", 2) == 0
|
||||
|| strncmp(locale, "ru", 2) == 0
|
||||
|| strncmp(locale, "ko", 2) == 0)) {
|
||||
|
||||
WINGsConfiguration.useMultiByte = True;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
WINGsConfiguration.doubleClickDelay =
|
||||
WMGetUDIntegerForKey(defaults, "DoubleClickTime");
|
||||
|
||||
|
||||
@@ -442,28 +442,9 @@ arrangeLowerFrame(FontPanel *panel)
|
||||
|
||||
|
||||
|
||||
|
||||
#define ALL_FONTS_MASK "-*-*-*-*-*-*-*-*-*-*-*-*-*-*"
|
||||
|
||||
#define FOUNDRY 0
|
||||
#define FAMILY 1
|
||||
#define WEIGHT 2
|
||||
#define SLANT 3
|
||||
#define SETWIDTH 4
|
||||
#define ADD_STYLE 5
|
||||
#define PIXEL_SIZE 6
|
||||
#define POINT_SIZE 7
|
||||
#define RES_X 8
|
||||
#define RES_Y 9
|
||||
#define SPACING 10
|
||||
#define AV_WIDTH 11
|
||||
#define REGISTRY 12
|
||||
#define ENCODING 13
|
||||
|
||||
#define NUM_FIELDS 14
|
||||
|
||||
|
||||
|
||||
static int
|
||||
isXLFD(char *font, int *length_ret)
|
||||
{
|
||||
@@ -483,12 +464,12 @@ isXLFD(char *font, int *length_ret)
|
||||
typedef struct {
|
||||
char *typeface;
|
||||
WMArray *sizes;
|
||||
} Xft_Typeface;
|
||||
} Typeface;
|
||||
|
||||
typedef struct {
|
||||
char *name; /* gotta love simplicity */
|
||||
WMArray *typefaces;
|
||||
} Xft_Family;
|
||||
} Family;
|
||||
|
||||
|
||||
static int
|
||||
@@ -507,7 +488,7 @@ compare_int(const void *a, const void *b)
|
||||
|
||||
|
||||
static void
|
||||
addSizeToTypeface(Xft_Typeface *face, int size)
|
||||
addSizeToTypeface(Typeface *face, int size)
|
||||
{
|
||||
if (size == 0) {
|
||||
int j;
|
||||
@@ -529,9 +510,9 @@ addSizeToTypeface(Xft_Typeface *face, int size)
|
||||
}
|
||||
|
||||
static void
|
||||
addTypefaceToXftFamily(Xft_Family *fam, char *style)
|
||||
addTypefaceToXftFamily(Family *fam, char *style)
|
||||
{
|
||||
Xft_Typeface *face;
|
||||
Typeface *face;
|
||||
WMArrayIterator i;
|
||||
|
||||
if(fam->typefaces) {
|
||||
@@ -545,8 +526,8 @@ addTypefaceToXftFamily(Xft_Family *fam, char *style)
|
||||
fam->typefaces = WMCreateArray(4);
|
||||
}
|
||||
|
||||
face = wmalloc(sizeof(Xft_Typeface));
|
||||
memset(face, 0 , sizeof(Xft_Typeface));
|
||||
face = wmalloc(sizeof(Typeface));
|
||||
memset(face, 0 , sizeof(Typeface));
|
||||
|
||||
face->typeface = wstrdup(style);
|
||||
face->sizes = WMCreateArray(4);
|
||||
@@ -565,7 +546,7 @@ addFontToXftFamily(WMHashTable *families, char *name, char *style)
|
||||
{
|
||||
WMArrayIterator i;
|
||||
WMArray *array;
|
||||
Xft_Family *fam;
|
||||
Family *fam;
|
||||
|
||||
array = WMHashGet(families, name);
|
||||
if(array) {
|
||||
@@ -578,8 +559,8 @@ addFontToXftFamily(WMHashTable *families, char *name, char *style)
|
||||
|
||||
array = WMCreateArray(8);
|
||||
|
||||
fam = wmalloc(sizeof(Xft_Family));
|
||||
memset(fam, 0, sizeof(Xft_Family));
|
||||
fam = wmalloc(sizeof(Family));
|
||||
memset(fam, 0, sizeof(Family));
|
||||
|
||||
fam->name = wstrdup(name);
|
||||
|
||||
@@ -631,7 +612,7 @@ listFamilies(WMScreen *scr, WMFontPanel *panel)
|
||||
|
||||
while ((array = WMNextHashEnumeratorItem(&enumer))) {
|
||||
WMArrayIterator i;
|
||||
Xft_Family *fam;
|
||||
Family *fam;
|
||||
char buffer[256];
|
||||
WMListItem *item;
|
||||
|
||||
@@ -655,20 +636,20 @@ static void
|
||||
getSelectedFont(FontPanel *panel, char buffer[], int bufsize)
|
||||
{
|
||||
WMListItem *item;
|
||||
Xft_Family *family;
|
||||
Xft_Typeface *face;
|
||||
Family *family;
|
||||
Typeface *face;
|
||||
char *size;
|
||||
|
||||
|
||||
item = WMGetListSelectedItem(panel->famLs);
|
||||
if (!item)
|
||||
return;
|
||||
family = (Xft_Family*)item->clientData;
|
||||
family = (Family*)item->clientData;
|
||||
|
||||
item = WMGetListSelectedItem(panel->typLs);
|
||||
if (!item)
|
||||
return;
|
||||
face = (Xft_Typeface*)item->clientData;
|
||||
face = (Typeface*)item->clientData;
|
||||
|
||||
size = WMGetTextFieldText(panel->sizT);
|
||||
|
||||
@@ -703,8 +684,8 @@ familyClick(WMWidget *w, void *data)
|
||||
{
|
||||
WMList *lPtr = (WMList*)w;
|
||||
WMListItem *item;
|
||||
Xft_Family *family;
|
||||
Xft_Typeface *face;
|
||||
Family *family;
|
||||
Typeface *face;
|
||||
FontPanel *panel = (FontPanel*)data;
|
||||
WMArrayIterator i;
|
||||
/* current typeface and size */
|
||||
@@ -722,7 +703,7 @@ familyClick(WMWidget *w, void *data)
|
||||
|
||||
|
||||
item = WMGetListSelectedItem(lPtr);
|
||||
family = (Xft_Family*)item->clientData;
|
||||
family = (Family*)item->clientData;
|
||||
|
||||
WMClearList(panel->typLs);
|
||||
|
||||
@@ -775,7 +756,7 @@ typefaceClick(WMWidget *w, void *data)
|
||||
{
|
||||
FontPanel *panel = (FontPanel*)data;
|
||||
WMListItem *item;
|
||||
Xft_Typeface *face;
|
||||
Typeface *face;
|
||||
WMArrayIterator i;
|
||||
char buffer[32];
|
||||
|
||||
@@ -787,7 +768,7 @@ typefaceClick(WMWidget *w, void *data)
|
||||
|
||||
|
||||
item = WMGetListSelectedItem(panel->typLs);
|
||||
face = (Xft_Typeface*)item->clientData;
|
||||
face = (Typeface*)item->clientData;
|
||||
|
||||
WMClearList(panel->sizLs);
|
||||
|
||||
@@ -842,8 +823,8 @@ setFontPanelFontName(FontPanel *panel, FcChar8 *family, FcChar8 *style, double s
|
||||
char asize[64];
|
||||
void *vsize;
|
||||
WMListItem *item;
|
||||
Xft_Family *fam;
|
||||
Xft_Typeface *face;
|
||||
Family *fam;
|
||||
Typeface *face;
|
||||
WMArrayIterator i;
|
||||
|
||||
famrow = WMFindRowOfListItemWithTitle(panel->famLs, family);
|
||||
@@ -858,7 +839,7 @@ setFontPanelFontName(FontPanel *panel, FcChar8 *family, FcChar8 *style, double s
|
||||
|
||||
item = WMGetListSelectedItem(panel->famLs);
|
||||
|
||||
fam = (Xft_Family*)item->clientData;
|
||||
fam = (Family*)item->clientData;
|
||||
WM_ITERATE_ARRAY(fam->typefaces, face, i) {
|
||||
char buffer[256];
|
||||
int top=0;
|
||||
@@ -886,7 +867,7 @@ setFontPanelFontName(FontPanel *panel, FcChar8 *family, FcChar8 *style, double s
|
||||
|
||||
item = WMGetListSelectedItem(panel->typLs);
|
||||
|
||||
face = (Xft_Typeface*)item->clientData;
|
||||
face = (Typeface*)item->clientData;
|
||||
|
||||
WMClearList(panel->sizLs);
|
||||
|
||||
|
||||
@@ -591,7 +591,6 @@ WMCreateScreenWithRContext(Display *display, int screen, RContext *context)
|
||||
"WM_STATE"
|
||||
};
|
||||
Atom atoms[sizeof(atomNames)/sizeof(char*)];
|
||||
char *locale;
|
||||
int i;
|
||||
|
||||
if (!initialized) {
|
||||
@@ -754,16 +753,6 @@ WMCreateScreenWithRContext(Display *display, int screen, RContext *context)
|
||||
|
||||
scrPtr->stipple = stipple;
|
||||
|
||||
scrPtr->useMultiByte = WINGsConfiguration.useMultiByte;
|
||||
scrPtr->useMultiByte = 0;
|
||||
|
||||
locale = setlocale(LC_CTYPE, NULL);
|
||||
//printf("LC_CTYPE=%s\n", locale);
|
||||
if (!locale || strcmp(locale, "C")==0 || strcmp(locale, "POSIX")==0)
|
||||
scrPtr->useWideChar = 0;
|
||||
else
|
||||
scrPtr->useWideChar = 1;
|
||||
|
||||
scrPtr->antialiasedText = WINGsConfiguration.antialiasedText;
|
||||
|
||||
scrPtr->normalFont = WMSystemFontOfSize(scrPtr, 0);
|
||||
|
||||
@@ -20,7 +20,6 @@ WPrefs_SOURCES = \
|
||||
Configurations.c \
|
||||
Expert.c \
|
||||
Focus.c \
|
||||
Font.c \
|
||||
FontSimple.c \
|
||||
Icons.c \
|
||||
KeyboardSettings.c \
|
||||
|
||||
@@ -323,8 +323,7 @@ createMainWindow(WMScreen *scr)
|
||||
WMMoveWidget(WPrefs.banner, FRAME_LEFT, FRAME_TOP);
|
||||
WMSetFrameRelief(WPrefs.banner, WRFlat);
|
||||
|
||||
font = WMCreateFont(scr, "-*-times-bold-r-*-*-24-*-*-*-*-*-*-*,"
|
||||
"-*-fixed-medium-r-normal-*-24-*");
|
||||
font = WMCreateFont(scr, "Lucida Sans,Comic Sans MS,Times New Roman,serif:bold:pixelsize=24");
|
||||
if (!font)
|
||||
font = WMBoldSystemFontOfSize(scr, 24);
|
||||
WPrefs.nameL = WMCreateLabel(WPrefs.banner);
|
||||
|
||||
17
src/dialog.c
17
src/dialog.c
@@ -1169,7 +1169,8 @@ handleLogoPush(XEvent *event, void *data)
|
||||
/* Alternatively we can draw text in a pixmap and scroll it smoothly */
|
||||
if ((panel->oldFont = WMGetLabelFont(panel->versionL))!=NULL)
|
||||
WMRetainFont(panel->oldFont);
|
||||
font = WMCreateFont(WMWidgetScreen(panel->versionL), "-*-fixed-medium-r-*-*-13-*-*-*-*-*-*-*");
|
||||
font = WMCreateFont(WMWidgetScreen(panel->versionL),
|
||||
"Lucida Console,Courier New,monospace:pixelsize=12");
|
||||
if (font) {
|
||||
WMSetLabelFont(panel->versionL, font);
|
||||
WMReleaseFont(font);
|
||||
@@ -1215,10 +1216,11 @@ wShowInfoPanel(WScreen *scr)
|
||||
WMFont *font;
|
||||
char *strbuf = NULL;
|
||||
char buffer[256];
|
||||
char *name;
|
||||
Window parent;
|
||||
WWindow *wwin;
|
||||
char **strl;
|
||||
int i, width, sepWidth;
|
||||
int i, width=50, sepWidth;
|
||||
char *visuals[] = {
|
||||
"StaticGray",
|
||||
"GrayScale",
|
||||
@@ -1268,12 +1270,8 @@ wShowInfoPanel(WScreen *scr)
|
||||
WMResizeWidget(panel->name1L, 240, 30 - sepWidth);
|
||||
WMMoveWidget(panel->name1L, 100, 30);
|
||||
|
||||
if (WMIsAntialiasingEnabled(scr->wmscreen)) {
|
||||
font = WMBoldSystemFontOfSize(scr->wmscreen, 24);
|
||||
} else {
|
||||
font = WMCreateFont(scr->wmscreen, "-*-utopia-*-r-*-*-25-*");
|
||||
font = font ? font : WMBoldSystemFontOfSize(scr->wmscreen, 24);
|
||||
}
|
||||
name = "Lucida Sans,Comic Sans MS,URW Gothic L,Trebuchet MS,sans:bold:pixelsize=26";
|
||||
font = WMCreateFont(scr->wmscreen, name);
|
||||
strbuf = "Window Maker";
|
||||
if (font) {
|
||||
width = WMWidthOfString(font, strbuf, strlen(strbuf));
|
||||
@@ -1292,7 +1290,8 @@ wShowInfoPanel(WScreen *scr)
|
||||
panel->name2L = WMCreateLabel(panel->win);
|
||||
WMResizeWidget(panel->name2L, 240, 24);
|
||||
WMMoveWidget(panel->name2L, 100, 60);
|
||||
font = WMBoldSystemFontOfSize(scr->wmscreen, 18);
|
||||
name = "URW Gothic L,Nimbus Sans L,sans:pixelsize=16";
|
||||
font = WMCreateFont(scr->wmscreen, name);
|
||||
if (font) {
|
||||
WMSetLabelFont(panel->name2L, font);
|
||||
WMReleaseFont(font);
|
||||
|
||||
@@ -65,10 +65,6 @@ print_help()
|
||||
puts(" about what the original font was to allow hand tuning the");
|
||||
puts(" result or restoring the xlfd. The default is to not add it");
|
||||
puts(" as it results in long, unreadable and confusing names.");
|
||||
puts(" --sets-too try to approximate fontsets by using their first complete xlfd.");
|
||||
puts(" This only works for singlebyte languages. The default is to");
|
||||
puts(" replace the fontset with the default: 'sans-serif:pixelsize=12'");
|
||||
puts(" which should display properly for any language.");
|
||||
puts("");
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "../src/wconfig.h"
|
||||
|
||||
#define DEFAULT_FONT "sans-serif:pixelsize=12"
|
||||
#define DEFAULT_FONT "sans:pixelsize=12"
|
||||
|
||||
static int
|
||||
countChar(char *str, char c)
|
||||
@@ -161,7 +161,8 @@ xlfdToFc(char *xlfd, char *useFamily, Bool keepXLFD)
|
||||
|
||||
|
||||
/* return converted font (if conversion is needed) else the original font */
|
||||
char* convertFont(char *font, Bool keepXLFD)
|
||||
char*
|
||||
convertFont(char *font, Bool keepXLFD)
|
||||
{
|
||||
if (font[0]=='-') {
|
||||
char *res;
|
||||
@@ -181,3 +182,4 @@ char* convertFont(char *font, Bool keepXLFD)
|
||||
return font;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -115,8 +115,6 @@ static char *font_options[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
#define DEFAULT_FONT "sans-serif:pixelsize=12"
|
||||
|
||||
char *ProgName;
|
||||
|
||||
WMPropList *PixmapPath = NULL;
|
||||
|
||||
@@ -37,8 +37,6 @@
|
||||
|
||||
#define MAX_OPTIONS 128
|
||||
|
||||
#define DEFAULT_FONT "sans:pixelsize=12"
|
||||
|
||||
char *FontOptions[] = {
|
||||
"IconTitleFont",
|
||||
"ClipTitleFont",
|
||||
|
||||
Reference in New Issue
Block a user