Package: inventor / 2.1.5-10-21

freetype.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
--- inventor-2.1.5-10.orig/libFL/ang/flfreetype.h
+++ inventor-2.1.5-10/libFL/ang/flfreetype.h
@@ -1,7 +1,8 @@
 #ifndef __flfreetype_h_
 #define __flfreetype_h_
 
-#include <freetype/freetype.h>
+#include <ft2build.h>
+#include FT_FREETYPE_H
 
 #ifndef __fl_h_
 #include "fl.h"
--- inventor-2.1.5-10.orig/libFL/ang/GNUmakefile
+++ inventor-2.1.5-10/libFL/ang/GNUmakefile
@@ -1,12 +1,16 @@
 IVDEPTH = ../..
 include $(IVDEPTH)/make/ivcommondefs
 
+LCDEFS = $(LCXXDEFS)
+
 ARCHIVE = libFL.a
 
 LCINCS += -I/usr/include/freetype2
 
 CFILES = fl.c flclient.c flfreetype.c
 
+CFLAGS += -Wall -g
+
 all install: link all_ivbin
 
 link:
--- inventor-2.1.5-10.orig/libFL/ang/flfreetype.c
+++ inventor-2.1.5-10/libFL/ang/flfreetype.c
@@ -130,6 +130,8 @@ _flFTGetScalableBitmap(FLfontStruct *_fs
 {
   FLscalableBitmap *bit3;
 
+  TRACE(("unfinished code called"));
+
   /* TODO */
   bit3 = NULL;
 
@@ -202,6 +204,8 @@ _flFTGetBitmap(FLfontStruct *_fs, GLuint
   bbox_height = BM_TRUNC(face->bbox.yMax - face->bbox.yMin);
 
   if (glyph->format == ft_glyph_format_outline) {    
+    TRACE(("  creating bitmap from outline glyph\n"));
+
     pitch     = (width + 7) >> 3;
     size      = pitch * height; 
     pitch2    = ((width + (PIXEL_ROW_ALIGNMENT << 3) - 1) >> 5) << 2;
@@ -217,7 +221,7 @@ _flFTGetBitmap(FLfontStruct *_fs, GLuint
     bit3->height    = bit2.rows;
     bit3->xorig     = bearing_x;
     bit3->yorig     = height - bearing_y;
-    bit3->xmove     = width > 0 ? width : (bbox_width / 2.0);
+    bit3->xmove     = width > 0 ? width : 10; /*(bbox_width / 2.0);*/
     bit3->ymove     = 0.0;
     bit3->bitmap    = (GLubyte *) malloc(size2 * sizeof(GLubyte));
 
@@ -235,6 +239,7 @@ _flFTGetBitmap(FLfontStruct *_fs, GLuint
     free(bit2.buffer);
   }
   else {
+    TRACE(("  creating bitmap from non-outline glyph\n"));
     bit3->width     = glyph->bitmap.width;
     bit3->height    = glyph->bitmap.rows;
     bit3->xorig     = bearing_x;
@@ -244,6 +249,18 @@ _flFTGetBitmap(FLfontStruct *_fs, GLuint
     bit3->bitmap    = glyph->bitmap.buffer;
   }
 
+  /* debugging added by Steve, 2001-08-14 */
+  TRACE(("  glyph->metrics.horiBearingX = %d\n", glyph->metrics.horiBearingX));
+  TRACE(("  glyph->metrics.width = %d\n", glyph->metrics.width ));
+  TRACE(("  left = %d\n", left ));
+  TRACE(("  right = %d\n", right ));
+  TRACE(("  width = %d\n", width ));
+  TRACE(("  height = %d\n", height ));
+  TRACE(("  face->bbox.xMax = %d\n", face->bbox.xMax ));
+  TRACE(("  face->bbox.xMin = %d\n", face->bbox.xMin ));
+  TRACE(("  bit3->xmove = %d\n", bit3->xmove ));
+  TRACE(("  bbox_width = %d\n", bbox_width ));
+
   return bit3;
 }