1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

Revert "fontaliases: revise fonts.alias for UTF-8 to display"

This reverts commit a976460e59.

This just does not look as good, and the fonts appear too tiny.  It
needs more work, andshould support all OS's since they pretty much (at
least with the linuxen and bsd's) all use the same fonts and X servers.
This commit is contained in:
Jon Trulson 2021-11-11 16:48:52 -07:00
parent 20ef417e20
commit 36ff45cc17
4 changed files with 2700 additions and 1372 deletions

View file

@ -3,11 +3,3 @@ MAINTAINERCLEANFILES = Makefile.in
include ../../../localized/templates/English.am
include ../../bdf/fonts.am
noinst_PROGRAMS = mk_fonts_alias test_fonts_alias
mk_fonts_alias_SOURCES = mk_fonts_alias.c
test_fonts_alias_SOURCES = test_fonts_alias.c
test_fonts_alias_LDADD = $(XTOOLLIB)
fonts.alias: mk_fonts_alias
./$< > $@

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,112 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* (c) Copyright 1993-2012 The Open Group
* (c) Copyright 2012-2022 CDE Project contributors, see
* CONTRIBUTORS for details
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <X11/Xlib.h>
#define BUF_SIZE 1024
int main(void) {
int ret = 0;
int line_num = 0;
int npaths;
char cwd[BUF_SIZE];
char *font_path_list[BUF_SIZE];
char **font_path_list_orig = NULL;
char *line = NULL;
size_t len = 0;
ssize_t line_len;
if (!getcwd(cwd, BUF_SIZE)) {
fprintf(stderr, "Cannot get current working directory.\n");
ret = -1;
goto done;
}
font_path_list[0] = cwd;
Display *display = XOpenDisplay(NULL);
if (display == NULL) {
fprintf(stderr, "Cannot open display.\n");
ret = -1;
goto done;
}
font_path_list_orig = XGetFontPath(display, &npaths);
for (int i = 0; i < npaths; ++i)
font_path_list[i + 1] = font_path_list_orig[i];
XSetFontPath(display, font_path_list, ++npaths);
while ((line_len = getline(&line, &len, stdin)) != -1) {
int i;
char *font_name = NULL;
size_t font_name_len = 0;
++line_num;
for (i = 0; i < line_len; ++i) {
++font_name_len;
if (!font_name && line[i] == '"') {
font_name = &line[i];
font_name_len = 0;
}
else if (font_name && line[i] == '"') break;
}
if (i >= line_len || line_len < 3) {
fprintf(stderr, "Corrupted file.\n");
ret = -1;
goto done;
}
*(++font_name + --font_name_len) = '\0';
XFontStruct *font_struct = XLoadQueryFont(display, font_name);
if (!font_struct) {
fprintf(stderr, "Bad alias: %d: %s\n", line_num, font_name);
ret = -1;
}
if (font_struct) XFreeFont(display, font_struct);
}
done:
if (font_path_list_orig) {
XSetFontPath(display, font_path_list_orig, --npaths);
XFreeFontPath(font_path_list_orig);
}
if (line) free(line);
if (display) XCloseDisplay(display);
return ret;
}