aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Font.c
diff options
context:
space:
mode:
authorReinhard Tartler <siretart@tauware.de>2011-10-10 17:58:55 +0200
committerReinhard Tartler <siretart@tauware.de>2011-10-10 17:58:55 +0200
commitb79164001d1eb06f4591c59b7a7c2c0fb29e992b (patch)
treed211626f0f91a07ac22c1b254a6300bebf732ea6 /nx-X11/programs/Xserver/hw/nxagent/Font.c
parent1c25e92b9ea5811d8ab9c2bfdc0dcb2e4d21bd0a (diff)
downloadnx-libs-b79164001d1eb06f4591c59b7a7c2c0fb29e992b.tar.gz
nx-libs-b79164001d1eb06f4591c59b7a7c2c0fb29e992b.tar.bz2
nx-libs-b79164001d1eb06f4591c59b7a7c2c0fb29e992b.zip
Imported nxagent-3.2.0-5.tar.gznxagent/3.2.0-5
Summary: Imported nxagent-3.2.0-5.tar.gz Keywords: Imported nxagent-3.2.0-5.tar.gz into Git repository
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Font.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Font.c145
1 files changed, 6 insertions, 139 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.c b/nx-X11/programs/Xserver/hw/nxagent/Font.c
index e552f826b..6fb34f221 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Font.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Font.c
@@ -101,8 +101,6 @@ static XFontStruct *nxagentLoadQueryFont(register Display *dpy , char *fontName
int nxagentFreeFont(XFontStruct *fs);
static Bool nxagentGetFontServerPath(char * fontServerPath);
-static char * nxagentMakeScalableFontName(const char *fontName, int scalableResolution);
-
RESTYPE RT_NX_FONT;
#ifdef NXAGENT_RECONNECT_FONT_DEBUG
@@ -421,59 +419,13 @@ Bool nxagentFontFind(const char *name, int *pos)
Bool nxagentFontLookUp(const char *name)
{
int i;
- int result;
-
- char *scalable;
-
- if (name != NULL && strlen(name) == 0)
- {
- return 0;
- }
-
- result = nxagentFontFind(name, &i);
-
- scalable = NULL;
-
- /*
- * Let's try with the scalable font description.
- */
-
- if (result == 0)
- {
- scalable = nxagentMakeScalableFontName(name, 0);
-
- if (scalable != NULL)
- {
- result = nxagentFontFind(scalable, &i);
-
- free(scalable);
- }
- }
-
- /*
- * Let's try again after replacing zero to xdpi and ydpi in the pattern.
- */
-
- if (result == 0)
- {
- scalable = nxagentMakeScalableFontName(name, 1);
-
- if (scalable != NULL)
- {
- result = nxagentFontFind(scalable, &i);
-
- free(scalable);
- }
- }
-
- if (result == 0)
- {
- return 0;
- }
- else
- {
+ if (name)
+ if (!strlen(name))
+ return 0;
+ if (nxagentFontFind(name, &i))
return (nxagentRemoteFontList.list[i]->status > 0);
- }
+ else
+ return 0;
}
Bool nxagentRealizeFont(ScreenPtr pScreen, FontPtr pFont)
@@ -1746,88 +1698,3 @@ int nxagentSplitString(char *string, char *fields[], int nfields, char *sep)
return i;
}
-char *nxagentMakeScalableFontName(const char *fontName, int scalableResolution)
-{
- char *scalableFontName;
- const char *s;
- int len;
- int field;
-
- len = strlen(fontName) + 1;
-
- scalableFontName = malloc(len);
-
- if (scalableFontName == NULL)
- {
- #ifdef PANIC
- fprintf(stderr, "nxagentMakeScalableFontName: PANIC! malloc() failed.\n");
- #endif
-
- return NULL;
- }
-
- scalableFontName[0] = 0;
-
- if (*fontName != '-')
- {
- goto MakeScalableFontNameError;
- }
-
- s = fontName;
-
- field = 0;
-
- while (s != NULL)
- {
- s = strchr(s + 1, '-');
-
- if (s != NULL)
- {
- if (field == 6 || field == 7 || field == 11)
- {
- /*
- * PIXEL_SIZE || POINT_SIZE || AVERAGE_WIDTH
- */
-
- strcat(scalableFontName, "-0");
- }
- else if (scalableResolution == 1 && (field == 8 || field == 9))
- {
- /*
- * RESOLUTION_X || RESOLUTION_Y
- */
-
- strcat(scalableFontName, "-0");
- }
- else
- {
- strncat(scalableFontName, fontName, s - fontName);
- }
-
- fontName = s;
- }
- else
- {
- strcat(scalableFontName, fontName);
- }
-
- field++;
- }
-
- if (field != 14)
- {
- goto MakeScalableFontNameError;
- }
-
- return scalableFontName;
-
-MakeScalableFontNameError:
-
- free(scalableFontName);
-
- #ifdef DEBUG
- fprintf(stderr, "nxagentMakeScalableFontName: Invalid font name.\n");
- #endif
-
- return NULL;
-}