File: 07_vflib3.patch

package info (click to toggle)
dvi2ps 5.1j-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 3,424 kB
  • sloc: ansic: 15,077; sh: 10,365; makefile: 157
file content (108 lines) | stat: -rw-r--r-- 2,976 bytes parent folder | download | duplicates (6)
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
Author: <bdefreese@debian2.bddebian.com>
Description: Build with vflib3.
--- a/conf.h
+++ b/conf.h
@@ -16,6 +16,10 @@
 #define	VFLIB
 #endif
 
+#if defined(HAVE_LIBVFLIB3) && defined(HAVE_VFLIB_3_6_H)
+#define	VFLIB
+#endif
+
 #ifdef HAVE_ANSI_C89
 #define	ANSI
 #endif
--- a/configure.ac
+++ b/configure.ac
@@ -87,5 +87,14 @@
 	AC_CHECK_LIB([ttf], [TT_Init_FreeType])
 fi
 
+AC_ARG_WITH([vflib3],
+	AC_HELP_STRING([--with-vflib3@<:@=ARG@:>@],
+		       [use VFlib3 [ARG=yes]]),
+	[with_vflib3=$withval], [with_vflib3=yes])
+if test "x$with_vflib3" = xyes; then
+	AC_CHECK_LIB([VFlib3], [VF_Init])
+	AC_CHECK_HEADERS([VFlib-3_6.h])
+fi
+
 AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
--- a/psvfl.c
+++ b/psvfl.c
@@ -7,7 +7,7 @@
 #include	"bifont.h"
 #include	"rastfont.h"
 #include	"ps.h"
-#include	"VF.h"
+#include	<VFlib-3_6.h>
 
 static struct pd pd;
 
@@ -61,8 +61,8 @@
 #define	TOKEN_INITIAL	0
 #define	TOKEN_LINE	1
 #define	TOKEN_BEZ	2
-#define	ConvX(x)	((VFD_GET_X(x)-OUTLINE_OFFSET))
-#define	ConvY(x)	((OUTLINE_SIZE-(VFD_GET_Y(x)-OUTLINE_OFFSET)))
+#define	ConvX(x)	((VF_OL_GET_X(x)-VF_OL_COORD_OFFSET))
+#define	ConvY(x)	((VF_OL_COORD_RANGE-(VF_OL_GET_Y(x)-VF_OL_COORD_OFFSET)))
 
 #define	checklen(l)	\
 	{cc += l; \
@@ -83,17 +83,17 @@
     
     EMITC('{');
     EMIT(outfp, "%.3f %.3f scale\n",
-	 (float)w/OUTLINE_SIZE, (float)h/OUTLINE_SIZE);
+	 (float)w/VF_OL_COORD_RANGE, (float)h/VF_OL_COORD_RANGE);
     ptr = &outline[2];
     token = TOKEN_INITIAL;
     cc = 0;
     
     while (*ptr != 0) {
-	if (*ptr&VFD_TOKEN) {
+	if (*ptr&VF_OL_INSTR_TOKEN) {
 	    cmd = *ptr++;
 	    dat = *ptr++;;
-	    if ((cmd&VFD_CWCURV) == VFD_CWCURV ||
-		(cmd&VFD_CCWCURV) == VFD_CCWCURV) {
+	    if ((cmd&VF_OL_INSTR_CWCURV) == VF_OL_INSTR_CWCURV ||
+		(cmd&VF_OL_INSTR_CCWCURV) == VF_OL_INSTR_CCWCURV) {
 		if (token != TOKEN_INITIAL) {
 		    if (token == TOKEN_BEZ) {
 			emitdata(initialx, initialy, 'c');
@@ -109,9 +109,9 @@
 	    } else {
 		emitdata(ConvX(dat), ConvY(dat), 'l');
 	    }
-	    if ((cmd&VFD_BEZ) == VFD_BEZ)
+	    if ((cmd&VF_OL_INSTR_BEZ) == VF_OL_INSTR_BEZ)
 		token = TOKEN_BEZ;
-	    else if ((cmd&VFD_LINE) == VFD_LINE)
+	    else if ((cmd&VF_OL_INSTR_LINE) == VF_OL_INSTR_LINE)
 		token = TOKEN_LINE;
 	} else {
 	    dat = *ptr++;
--- a/vflfont.c
+++ b/vflfont.c
@@ -110,7 +110,7 @@
 	(void)fprintf(stderr, "VFlib openfont %s (for %s, %s)\n", vfln, fe->n,
 		      raster ? "raster" : "outline");
 #endif
-    if ((fid = VF_OpenFont(vfln)) < 0) {
+    if ((fid = VF_OpenFont1(vfln)) < 0) {
 	Warning("VFlib font %s cannot be opened", vfln);
 	return vflfi;
     }
@@ -130,7 +130,7 @@
 		(vflfi->ch+i)->tfmw = tfmw;
 	    memset(pixel, 0, size);
 	    c = idx94_to_std(i);
-	    VF_GetBitmap(c, fid, width, height, bwid, 0, pixel);
+	    VF_GetBitmap1(c, fid, width, height, bwid, 0, pixel);
 	    trim_bitmap(width, bwid, height, 0, depth, pixel,
 			&nwidth, &nheight, &xoff, &ndepth, &npixel);
 	    dev_jft_initfontdict(fe, vflfi, i, c, tfmw,