Package: xdvik-ja / 22.84.16-j1.40+t1lib-1

0008-Import_t1lib_debian_patches.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
From: Youhei SASAKI <uwabami@gfd-dennou.org>
Date: Mon, 16 Apr 2012 14:58:43 +0900
Subject: Import_t1lib_debian_patches

Signed-off-by: Youhei SASAKI <uwabami@gfd-dennou.org>
---
 libs/t1lib/t1lib-5.1.2/doc/Makefile.in      |   20 ++++++++++----------
 libs/t1lib/t1lib-5.1.2/lib/Makefile.in      |   20 ++++++++++----------
 libs/t1lib/t1lib-5.1.2/lib/t1lib/t1base.c   |    4 ++--
 libs/t1lib/t1lib-5.1.2/lib/t1lib/t1env.c    |    8 ++++++++
 libs/t1lib/t1lib-5.1.2/lib/t1lib/t1env.h    |    2 ++
 libs/t1lib/t1lib-5.1.2/lib/t1lib/t1subset.c |    2 +-
 libs/t1lib/t1lib-5.1.2/lib/type1/lines.c    |    7 +++++++
 libs/t1lib/t1lib-5.1.2/lib/type1/objects.c  |   11 ++++++-----
 libs/t1lib/t1lib-5.1.2/lib/type1/objects.h  |    2 +-
 libs/t1lib/t1lib-5.1.2/lib/type1/type1.c    |   13 +++++++++++--
 libs/t1lib/t1lib-5.1.2/type1afm/Makefile.in |    2 +-
 libs/t1lib/t1lib-5.1.2/xglyph/Makefile.in   |    4 ++--
 libs/t1lib/t1lib-5.1.2/xglyph/xglyph.c      |    3 +++
 13 files changed, 64 insertions(+), 34 deletions(-)

--- xdvik-ja.orig/libs/t1lib/t1lib-5.1.2/doc/Makefile.in
+++ xdvik-ja/libs/t1lib/t1lib-5.1.2/doc/Makefile.in
@@ -89,16 +89,16 @@
 
 
 install: dummy
-	if (test -f t1lib_doc.ps) \
-	then \
-	  $(MKINSTALLDIRS) $(DESTDIR)@T1LIB_DATA_DIR@/doc; \
-	  $(INSTALL_DATA) t1lib_doc.ps $(DESTDIR)@T1LIB_DATA_DIR@/doc; \
-	fi;
-	if (test -f t1lib_doc.pdf) \
-	then \
-	  $(MKINSTALLDIRS) $(DESTDIR)@T1LIB_DATA_DIR@/doc; \
-	  $(INSTALL_DATA) t1lib_doc.pdf $(DESTDIR)@T1LIB_DATA_DIR@/doc; \
-	fi;
+#	if (test -f t1lib_doc.ps) \
+#	then \
+#	  $(MKINSTALLDIRS) $(DESTDIR)@T1LIB_DATA_DIR@/doc; \
+#	  $(INSTALL_DATA) t1lib_doc.ps $(DESTDIR)@T1LIB_DATA_DIR@/doc; \
+#	fi;
+#	if (test -f t1lib_doc.pdf) \
+#	then \
+#	  $(MKINSTALLDIRS) $(DESTDIR)@T1LIB_DATA_DIR@/doc; \
+#	  $(INSTALL_DATA) t1lib_doc.pdf $(DESTDIR)@T1LIB_DATA_DIR@/doc; \
+#	fi;
 
 
 uninstall: dummy
--- xdvik-ja.orig/libs/t1lib/t1lib-5.1.2/lib/Makefile.in
+++ xdvik-ja/libs/t1lib/t1lib-5.1.2/lib/Makefile.in
@@ -24,7 +24,7 @@
 X_LIBS    = @X_LIBS@
 TOPSRC    = @top_srcdir@
 XPM_LIB   = -lXpm
-XLIB      = @X_PRE_LIBS@ -lXext -lX11 @X_EXTRA_LIBS@
+XLIB      = -lX11
 LDFLAGS   = @LDFLAGS@
 LDLIBS    = @LDLIBS@
 AR        = ar rc
@@ -137,7 +137,7 @@
 	$(LIBTOOL) --mode=link \
 		$(CC) $(LDFLAGS) -o $@ $(T1LIBX_OBJS) \
 	         -version-info @T1LIB_LT_CURRENT@:@T1LIB_LT_REVISION@:@T1LIB_LT_AGE@ \
-	         libt1.la $(X_LIBS) $(XPM_LIB) $(XLIB)  -no-undefined -rpath $(libdir) 
+	         libt1.la $(X_LIBS) $(XLIB)  -no-undefined -rpath $(libdir) 
 	cp t1lib/t1libx.h .
 
 
@@ -161,17 +161,17 @@
 install: dummy
 	$(MKINSTALLDIRS) $(DESTDIR)$(libdir)
 	$(MKINSTALLDIRS) $(DESTDIR)$(includedir)
-	$(MKINSTALLDIRS) $(DESTDIR)@T1LIB_DATA_DIR@
+#	$(MKINSTALLDIRS) $(DESTDIR)@T1LIB_DATA_DIR@
 	$(LIBTOOL) --mode=install \
 		$(INSTALL_DATA) $(MAIN_TARGET) $(DESTDIR)$(libdir)
 	$(LIBTOOL) --mode=install \
 		$(INSTALL_DATA) $(MAIN_HEADER) $(DESTDIR)$(includedir)
-	if (test -f $(DESTDIR)@T1LIB_DATA_DIR@/t1lib.config) \
-	then \
-	  echo "Alert: Global configuration file exists, installation skipped!"; \
-	else \
-	  $(LIBTOOL) --mode=install $(INSTALL_DATA) t1lib.config $(DESTDIR)@T1LIB_DATA_DIR@; \
-	fi;
+#	if (test -f $(DESTDIR)@T1LIB_DATA_DIR@/t1lib.config) \
+#	then \
+#	  echo "Alert: Global configuration file exists, installation skipped!"; \
+#	else \
+#	  $(LIBTOOL) --mode=install $(INSTALL_DATA) t1lib.config $(DESTDIR)@T1LIB_DATA_DIR@; \
+#	fi;
 
 
 uninstall: dummy
@@ -179,7 +179,7 @@
 	-$(LIBTOOL) --mode=uninstall $(RM) $(DESTDIR)$(libdir)/libt1x.la
 	-$(LIBTOOL) --mode=uninstall $(RM) $(DESTDIR)$(includedir)/t1lib.h
 	-$(LIBTOOL) --mode=uninstall $(RM) $(DESTDIR)$(includedir)/t1libx.h
-	-$(LIBTOOL) --mode=uninstall $(RM) $(DESTDIR)@T1LIB_DATA_DIR@/t1lib.config
+#	-$(LIBTOOL) --mode=uninstall $(RM) $(DESTDIR)@T1LIB_DATA_DIR@/t1lib.config
 
 
 dummy:
--- xdvik-ja.orig/libs/t1lib/t1lib-5.1.2/lib/t1lib/t1base.c
+++ xdvik-ja/libs/t1lib/t1lib-5.1.2/lib/t1lib/t1base.c
@@ -455,7 +455,7 @@
 	   to test_for_t1_file() filename is substituted by an emty
 	   string if the file was not found: */
 	sprintf( err_warn_msg_buf, "Type 1 Font file %s.[pfa/pfb] not found (FontID=%d, SearchPath=%s)",
-		 linebuf, m-1, T1_GetFileSearchPath(T1_PFAB_PATH));
+		 linebuf, m-1, intT1_GetFileSearchPath(T1_PFAB_PATH));
 	if ((test_for_t1_file( &linebuf[0]))){
 	  T1_PrintLog( "intT1_scanFontDBase()", err_warn_msg_buf, T1LOG_WARNING);
 	  located=0;
@@ -579,7 +579,7 @@
 	   to test_for_t1_file() filename is substituted by an emty
 	   string if the file was not found: */
 	sprintf( err_warn_msg_buf, "Type 1 Font file %s.[pfa/pfb] not found (FontID=%d, SearchPath=%s)",
-		 linebuf, m-1, T1_GetFileSearchPath(T1_PFAB_PATH));
+		 linebuf, m-1, intT1_GetFileSearchPath(T1_PFAB_PATH));
 	if ((test_for_t1_file( &linebuf[0]))){
 	  T1_PrintLog( "intT1_scanFontDBase()", err_warn_msg_buf, T1LOG_WARNING);
 	  located=0;
--- xdvik-ja.orig/libs/t1lib/t1lib-5.1.2/lib/t1lib/t1env.c
+++ xdvik-ja/libs/t1lib/t1lib-5.1.2/lib/t1lib/t1env.c
@@ -818,6 +818,14 @@
 
 }
 
+/* intT1_GetFileSearchPath(): 
+ call T1_GetFileSearchPath and truncate the line to avoid overflowing
+ error buffers*/ 
+char *intT1_GetFileSearchPath( int type)
+{
+   char  *res = T1_GetFileSearchPath(type);
+   res[900] = 0;
+}
 
 /* T1_AddToFileSearchPath(): Add the specified path element to
    the specified search path. If the existing path is the default path,
--- xdvik-ja.orig/libs/t1lib/t1lib-5.1.2/lib/t1lib/t1env.h
+++ xdvik-ja/libs/t1lib/t1lib-5.1.2/lib/t1lib/t1env.h
@@ -35,6 +35,7 @@
 int T1_SetFileSearchPath( int type, char *pathname);
 int T1_AddToFileSearchPath( int pathtype, int mode, char *pathname);
 char *T1_GetFileSearchPath( int type);
+char *intT1_GetFileSearchPath( int type);
 int T1_SetFontDataBase( char *filename);
 int T1_AddFontDataBase( int mode, char *filename);
 int T1_SetFontDataBaseXLFD( char *filename);
@@ -49,6 +50,7 @@
 extern int T1_SetFileSearchPath( int type, char *pathname);
 extern int T1_AddToFileSearchPath( int pathtype, int mode, char *pathname);
 extern char *T1_GetFileSearchPath( int type);
+extern char *intT1_GetFileSearchPath( int type);
 extern int T1_SetFontDataBase( char *filename);
 extern int T1_AddFontDataBase( int mode, char *filename);
 extern int T1_SetFontDataBaseXLFD( char *filename);
--- xdvik-ja.orig/libs/t1lib/t1lib-5.1.2/lib/t1lib/t1subset.c
+++ xdvik-ja/libs/t1lib/t1lib-5.1.2/lib/t1lib/t1subset.c
@@ -759,7 +759,7 @@
 	     tr_len);
     T1_PrintLog( "T1_SubsetFont()", err_warn_msg_buf,
 		 T1LOG_DEBUG);
-    l+=sprintf( &(trailerbuf[l]), linebuf); /* contains the PostScript trailer */
+    l+=sprintf( &(trailerbuf[l]), "%s", linebuf); /* contains the PostScript trailer */
   }
   
   /* compute size of output file */
--- xdvik-ja.orig/libs/t1lib/t1lib-5.1.2/lib/type1/lines.c
+++ xdvik-ja/libs/t1lib/t1lib-5.1.2/lib/type1/lines.c
@@ -67,6 +67,10 @@
 None.
 */
  
+#define  BITS         (sizeof(LONG)*8)
+#define  HIGHTEST(p)  (((p)>>(BITS-2)) != 0)  /* includes sign bit */
+#define  TOOBIG(xy)   ((xy < 0) ? HIGHTEST(-xy) : HIGHTEST(xy))
+
 /*
 :h2.StepLine() - Produces Run Ends for a Line After Checks
  
@@ -84,6 +88,9 @@
        IfTrace4((LineDebug > 0), ".....StepLine: (%d,%d) to (%d,%d)\n",
                                             x1, y1, x2, y2);
  
+      if ( TOOBIG(x1) || TOOBIG(x2) || TOOBIG(y1) || TOOBIG(y2))
+              abort("Lines this big not supported", 49);
+
        dy = y2 - y1;
  
 /*
--- xdvik-ja.orig/libs/t1lib/t1lib-5.1.2/lib/type1/objects.c
+++ xdvik-ja/libs/t1lib/t1lib-5.1.2/lib/type1/objects.c
@@ -957,7 +957,7 @@
  
        sprintf(typemsg, "Wrong object type in %s; expected %s, found %s.\n",
                   name, TypeFmt(expect), TypeFmt(obj->type));
-       IfTrace0(TRUE,typemsg);
+       IfTrace1(TRUE, "%s", typemsg);
  
        ObjectPostMortem(obj);
  
@@ -1137,12 +1137,13 @@
     "Context:  out of them", /* 46 */
     "MatrixInvert:  can't", /* 47 */
     "xiStub called", /* 48 */
-    "Illegal access type1 abort() message" /* 49 */
+    "Lines this big not supported", /* 49 */
+    "Illegal access type1 abort() message" /* 50 */
   };
 
-  /* no is valid from 1 to 48 */
-  if ( (number<1)||(number>48))
-    number=49;
+  /* no is valid from 1 to 49 */
+  if ( (number<1)||(number>49))
+    number=50;
   return( err_msgs[number-1]);
     
 }
--- xdvik-ja.orig/libs/t1lib/t1lib-5.1.2/lib/type1/objects.h
+++ xdvik-ja/libs/t1lib/t1lib-5.1.2/lib/type1/objects.h
@@ -214,7 +214,7 @@
 /*SHARED*/
 /* NDW: personally, I want to see status and error messages! */
 #define IfTrace0(condition,model)                                 \
-        {if (condition) printf(model);}
+        {if (condition) fputs(model,stdout);}
 #define IfTrace1(condition,model,arg0)                            \
         {if (condition) printf(model,arg0);}
 #define IfTrace2(condition,model,arg0,arg1)                       \
--- xdvik-ja.orig/libs/t1lib/t1lib-5.1.2/lib/type1/type1.c
+++ xdvik-ja/libs/t1lib/t1lib-5.1.2/lib/type1/type1.c
@@ -1012,6 +1012,7 @@
   double nextdtana = 0.0;   /* tangent of post-delta against horizontal line */ 
   double nextdtanb = 0.0;   /* tangent of post-delta against vertical line */ 
   
+  if (ppoints == NULL || numppoints < 1) Error0v("FindStems: No previous point!\n");
  
   /* setup default hinted position */
   ppoints[numppoints-1].ax     = ppoints[numppoints-1].x;
@@ -1289,7 +1290,7 @@
 static int DoRead(CodeP)
   int *CodeP;
 {
-  if (strindex >= CharStringP->len) return(FALSE); /* end of string */
+  if (!CharStringP || strindex >= CharStringP->len) return(FALSE); /* end of string */
   /* We handle the non-documented Adobe convention to use lenIV=-1 to
      suppress charstring encryption. */
   if (blues->lenIV==-1) {
@@ -1700,6 +1701,7 @@
   long pindex = 0;
   
   /* compute hinting for previous segment! */
+  if (ppoints == NULL || numppoints < 2) Error0i("RLineTo: No previous point!\n");
   FindStems( currx, curry, currx-ppoints[numppoints-2].x, curry-ppoints[numppoints-2].y, dx, dy);
 
   /* Allocate a new path point and pre-setup data */
@@ -1728,6 +1730,7 @@
   long pindex = 0;
   
   /* compute hinting for previous point! */
+  if (ppoints == NULL || numppoints < 2) Error0i("RRCurveTo: No previous point!\n");
   FindStems( currx, curry, currx-ppoints[numppoints-2].x, curry-ppoints[numppoints-2].y, dx1, dy1);
 
   /* Allocate three new path points and pre-setup data */
@@ -1786,7 +1789,9 @@
   long tmpind;
   double deltax = 0.0;
   double deltay = 0.0;
-  
+ 
+  if (ppoints == NULL || numppoints < 1) Error0i("DoClosePath: No previous point!");
+ 
   /* If this ClosePath command together with the starting point of this
      path completes to a segment aligned to a stem, we would miss
      hinting for this point. --> Check and explicitly care for this! */
@@ -1801,6 +1806,7 @@
     deltax = ppoints[i].x - ppoints[numppoints-1].x;
     deltay = ppoints[i].y - ppoints[numppoints-1].y;
 
+    if (ppoints == NULL || numppoints <= i + 1) Error0i("DoClosePath: No previous point!");
     /* save nummppoints and reset to move point */
     tmpind = numppoints;
     numppoints = i + 1;
@@ -1903,6 +1909,7 @@
     FindStems( currx, curry, 0, 0, dx, dy);
   }
   else {
+    if (ppoints == NULL || numppoints < 2) Error0i("RMoveTo: No previous point!\n");
     FindStems( currx, curry, ppoints[numppoints-2].x, ppoints[numppoints-2].y, dx, dy);
   }
   
@@ -2152,6 +2159,7 @@
   DOUBLE cx, cy;
   DOUBLE ex, ey;
 
+  if (ppoints == NULL || numppoints < 8) Error0v("FlxProc: No previous point!");
 
   /* Our PPOINT list now contains 7 moveto commands which
      are about to be consumed by the Flex mechanism. --> Remove these
@@ -2321,6 +2329,7 @@
 /*   Returns currentpoint on stack          */
 static void FlxProc2()
 {
+  if (ppoints == NULL || numppoints < 1) Error0v("FlxProc2: No previous point!");
   /* Push CurrentPoint on fake PostScript stack */
   PSFakePush( ppoints[numppoints-1].x);
   PSFakePush( ppoints[numppoints-1].y);
--- xdvik-ja.orig/libs/t1lib/t1lib-5.1.2/type1afm/Makefile.in
+++ xdvik-ja/libs/t1lib/t1lib-5.1.2/type1afm/Makefile.in
@@ -70,7 +70,7 @@
 
 type1afm: $(OBJS) ../lib/t1lib.h
 	$(LIBTOOL) --mode=link \
-		$(CC) -o type1afm $(LDFLAGS) $(OBJS) $(T1LIB) $(LDLIBS)
+		$(CC) -o type1afm $(LDFLAGS) $(OBJS) $(T1LIB)
 
 .SUFFIXES: .lo
 .c.lo:
--- xdvik-ja.orig/libs/t1lib/t1lib-5.1.2/xglyph/Makefile.in
+++ xdvik-ja/libs/t1lib/t1lib-5.1.2/xglyph/Makefile.in
@@ -24,7 +24,7 @@
 X_LIBS    = @X_LIBS@
 TOPSRC    = @top_srcdir@
 XPM_LIB   = -lXpm
-XLIB      = @X_PRE_LIBS@ -lXext -lX11 @X_EXTRA_LIBS@
+XLIB      = -lX11 @X_EXTRA_LIBS@
 LDFLAGS   = @LDFLAGS@
 LDLIBS    = @LDLIBS@ 
 AR        = ar rc
@@ -65,7 +65,7 @@
 
 T1LIB  = ../lib/libt1.la
 T1LIBX = ../lib/libt1x.la
-XAWLIB = -lXaw -lXt -lXmu
+XAWLIB = -lXaw -lXt
 
 
 all: xglyph
--- xdvik-ja.orig/libs/t1lib/t1lib-5.1.2/xglyph/xglyph.c
+++ xdvik-ja/libs/t1lib/t1lib-5.1.2/xglyph/xglyph.c
@@ -526,9 +526,12 @@
   
   /* Check for environment entry. If not set, set it to current
      directory so that configuration file is found there */
+  /* It violates the Debian Policy */
+#if 0
   if (getenv("T1LIB_CONFIG")==NULL){
     putenv( "T1LIB_CONFIG=./t1lib.config");
   }
+#endif
 
   
   /* Set log-level: */