diff -up xfig-3.2.6a/src/w_drawprim.c.scalable xfig-3.2.6a/src/w_drawprim.c
--- xfig-3.2.6a/src/w_drawprim.c.scalable 2017-01-05 15:08:08.000000000 +0100
+++ xfig-3.2.6a/src/w_drawprim.c 2018-03-01 18:01:52.344780986 +0100
@@ -69,6 +69,7 @@ static Pixel gc_color[NUMOPS], gc_backgr
static XRectangle clip[1];
static int parsesize(char *name);
static Boolean openwinfonts;
+static Boolean font_scalable[NUM_FONTS];
#define MAXNAMES 300
@@ -131,33 +132,42 @@ void init_font(void)
if (appres.scalablefonts) {
/* first look for OpenWindow style font names (e.g. times-roman) */
if ((fontlist = XListFonts(tool_d, ps_fontinfo[1].name, 1, &count))!=0) {
- openwinfonts = True; /* yes, use them */
- for (f=0; f<NUM_FONTS; f++) /* copy the OpenWindow font names */
- x_fontinfo[f].template = ps_fontinfo[f+1].name;
+ openwinfonts = True; /* yes, use them */
+ for (f=0; f<NUM_FONTS; f++) { /* copy the OpenWindow font names */
+ x_fontinfo[f].template = ps_fontinfo[f+1].name;
+ font_scalable[f] = True;
+ }
+ XFreeFontNames(fontlist);
} else {
- strcpy(template,x_fontinfo[0].template); /* nope, check for font size 0 */
- strcat(template,"0-0-*-*-*-*-");
- /* add ISO8859 (if not Symbol font or ZapfDingbats) to font name in non-international mode*/
- if (
+ for (f = 0; f < NUM_FONTS; f++) {
+ strcpy(template,x_fontinfo[f].template); /* nope, check for font size 0 */
+ strcat(template,"0-0-*-*-*-*-");
+ /* add ISO8859 (if not Symbol font or ZapfDingbats) to font name in non-international mode*/
+ if (
#ifdef I18N
- !appres.international &&
+ !appres.international &&
#endif
- strstr(template,"ymbol") == NULL &&
- strstr(template,"ingbats") == NULL)
- strcat(template,"ISO8859-*");
- else
- strcat(template,"*-*");
- if ((fontlist = XListFonts(tool_d, template, 1, &count))==0)
- appres.scalablefonts = False; /* none, turn off request for them */
+ strstr(template,"ymbol") == NULL &&
+ strstr(template,"ingbats") == NULL)
+ strcat(template,"ISO8859-*");
+ else
+ strcat(template,"*-*");
+
+ if ((fontlist = XListFonts(tool_d, template, 1, &count)))
+ font_scalable[f] = True;
+ else
+ font_scalable[f] = False;
+
+ XFreeFontNames(fontlist);
+ }
}
- XFreeFontNames(fontlist);
}
/* no scalable fonts - query the server for all the font
names and sizes and build a list of them */
- if (!appres.scalablefonts) {
- for (f = 0; f < NUM_FONTS; f++) {
+ for (f = 0; f < NUM_FONTS; f++) {
+ if (!font_scalable[f]) {
nf = NULL;
strcpy(template,x_fontinfo[f].template);
strcat(template,"*-*-*-*-*-*-");
@@ -210,8 +220,8 @@ void init_font(void)
nf->next = NULL;
}
} /* next size */
- } /* next font, f */
- } /* !appres.scalablefonts */
+ } /* !font_scalable[f] */
+ } /* next font, f */
}
/* parse the point size of font 'name' */
@@ -279,11 +289,11 @@ lookfont(int fnum, int size)
nf = x_fontinfo[fnum].xfontlist;
oldnf = nf;
if (nf != NULL) {
- if (nf->size > size && !appres.scalablefonts)
+ if (nf->size > size && !font_scalable[fnum])
found = True;
else {
while (nf != NULL) {
- if (nf->size == size || (!appres.scalablefonts &&
+ if (nf->size == size || (!font_scalable[fnum] &&
(nf->size >= size && oldnf->size <= size))) {
found = True;
break;
@@ -297,7 +307,7 @@ lookfont(int fnum, int size)
strcpy(fn,nf->fname); /* put the name in fn */
if (size < nf->size)
put_msg("Font size %d not found, using larger %d point",size,nf->size);
- } else if (!appres.scalablefonts) { /* not found, use largest available */
+ } else if (!font_scalable[fnum]) { /* not found, use largest available */
nf = oldnf;
strcpy(fn,nf->fname); /* put the name in fn */
if (size > nf->size)