Lines 1-81
Link Here
|
1 |
--- xfstt.cpp.orig Sat Dec 11 19:23:45 1999 |
|
|
2 |
+++ xfstt.cpp Sat Nov 18 15:57:30 2000 |
3 |
@@ -11,8 +11,8 @@ |
4 |
#define UNSTRAPLIMIT 10500U |
5 |
|
6 |
// Change these if you don't lie being FHS complient |
7 |
-#define TTFONTDIR "/usr/share/fonts/truetype" |
8 |
-#define TTCACHEDIR "/var/cache/xfstt" |
9 |
+#define TTFONTDIR "/usr/X11R6/lib/X11/fonts/TrueType" |
10 |
+#define TTCACHEDIR "/usr/X11R6/lib/X11/fonts/TrueType" |
11 |
|
12 |
#define TTINFO_LEAF "ttinfo.dir" |
13 |
#define TTNAME_LEAF "ttname.dir" |
14 |
@@ -73,6 +73,7 @@ |
15 |
char* fontdir = TTFONTDIR; |
16 |
char* cachedir = TTCACHEDIR; |
17 |
int defaultres = 0; |
18 |
+int NoTCP = 0; |
19 |
|
20 |
uid_t newuid = (uid_t)(-2); |
21 |
gid_t newgid = (uid_t)(-2); |
22 |
@@ -95,6 +96,7 @@ |
23 |
printf( "\t--sync put ttf-fonts in \"%s\" in database\n", fontdir); |
24 |
printf( "\t--gslist print ghostscript style ttf fontlist\n "); |
25 |
printf( "\t--port change port number from default 7101\n"); |
26 |
+ printf( "\t--notcp don't open TCP socket, use unix domain only\n"); |
27 |
printf( "\t--dir use other font directory than "TTFONTDIR"\n"); |
28 |
printf( "\t--cache use other font cache directory than "TTCACHEDIR"\n"); |
29 |
printf( "\t--res force default resolution to this value\n"); |
30 |
@@ -470,10 +472,12 @@ |
31 |
raster->getFontExtent( &xfs->fe); |
32 |
|
33 |
int used = (xfs->fe.bitmaps + xfs->fe.bmplen) - xfs->fe.buffer; |
34 |
+ int bmpoff = xfs->fe.bitmaps - xfs->fe.buffer; |
35 |
xfs->fe.buffer = (U8*)shrinkMem( xfs->fe.buffer, used); |
36 |
- if( xfs->fe.buffer) |
37 |
+ if( xfs->fe.buffer) { |
38 |
xfs->fe.buflen = used; |
39 |
- else { |
40 |
+ xfs->fe.bitmaps = xfs->fe.buffer + bmpoff; |
41 |
+ } else { |
42 |
xfs->fid = 0; //### |
43 |
xfs = 0; |
44 |
} |
45 |
@@ -652,7 +656,7 @@ |
46 |
listen( sd_unix, 1); // only one connection |
47 |
} |
48 |
|
49 |
- if( !sd_inet) { |
50 |
+ if( !NoTCP && !sd_inet) { |
51 |
// prepare inet connection |
52 |
sd_inet = socket( PF_INET, SOCK_STREAM, IPPROTO_TCP); |
53 |
|
54 |
@@ -668,7 +672,8 @@ |
55 |
fd_set sdlist; |
56 |
FD_ZERO( &sdlist); |
57 |
FD_SET( sd_unix, &sdlist); |
58 |
- FD_SET( sd_inet, &sdlist); |
59 |
+ if( !NoTCP ) |
60 |
+ FD_SET( sd_inet, &sdlist); |
61 |
int maxsd = (sd_inet > sd_unix) ? sd_inet : sd_unix; |
62 |
select( maxsd+1, &sdlist, 0L, 0L, 0L); |
63 |
|
64 |
@@ -676,7 +681,7 @@ |
65 |
unsigned int saLength = sizeof(struct sockaddr); |
66 |
if( FD_ISSET( sd_unix, &sdlist)) |
67 |
sd = accept( sd_unix, (struct sockaddr*)&s_unix, &saLength); |
68 |
- else if( FD_ISSET( sd_inet, &sdlist)) |
69 |
+ else if( !NoTCP && FD_ISSET( sd_inet, &sdlist)) |
70 |
sd = accept( sd_inet, (struct sockaddr*)&s_inet, &saLength); |
71 |
dprintf2( "accept( saLength = %d) = %d\n", saLength, sd); |
72 |
|
73 |
@@ -1604,6 +1609,8 @@ |
74 |
inetdConnection = 1; |
75 |
} else if( !strcmp( argv[i], "--multi")) { |
76 |
multiConnection = 1; |
77 |
+ } else if( !strcmp( argv[i], "--notcp")) { |
78 |
+ NoTCP = 1; |
79 |
} else if( !strcmp( argv[i], "--once")) { |
80 |
multiConnection = 0; |
81 |
} else if( !strcmp( argv[i], "--unstrap")) { |