Commit 00553295054cb8fc4b8cd50566fd204a8d77a50b

henry 2002-08-27T07:45:55

Updated for 1.4

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
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
diff --git a/HISTORY.txt b/HISTORY.txt
index e3a1272..43e953e 100644
--- a/HISTORY.txt
+++ b/HISTORY.txt
@@ -1,11 +1,15 @@
 FTGL 1.4
+    - FTL now requires 2.0.9 or later. See below for reason.
     - Merged 1.32 branch with main tree
     - Glyph loading has been optimised for pixel based glyphs.
     - Removed mmgr
     - Added FTFont::Attach
     - Updated API docs
-    - removed stl map and vector
-
+    - Removed stl map and vector. Replaced by code supplied by Sebastien Barre
+    - Removed work around for Type1 height and width bug in freetype. It seems 
+      to be fixed in 2.0.9
+    - Added a test target to the Mac OSX project
+    - Inline some private functions.
 
 April 23 2002
     1.32 (FTGL_1_3_2)
@@ -24,160 +28,160 @@ January 30 2002
     - Forgot to update readme etc for 1.3
     
 January 27 2002
- 	1.3b5 (FTGL_1_3_BETA_5)
-	- FTBbox now uses float rather then int
-	- Fixed some more warnings (size_t)
-	- Removed the contour winding function because it didn't fix the problem!!
-	- Fixed up some state settings in fonts.
+    1.3b5 (FTGL_1_3_BETA_5)
+    - FTBbox now uses float rather then int
+    - Fixed some more warnings (size_t)
+    - Removed the contour winding function because it didn't fix the problem!!
+    - Fixed up some state settings in fonts.
 
 December 11 2001
- 	1.3b4 (FTGL_1_3_BETA_4)
-	- Added MAC OSX project (Project Builder)
-	- Added a function for extruded glyphs that calculates the winding order of
+    1.3b4 (FTGL_1_3_BETA_4)
+    - Added MAC OSX project (Project Builder)
+    - Added a function for extruded glyphs that calculates the winding order of
       the glyph contour.
-	- Added FTGL_DEBUG to include memory debugger.
-	- Added a couple of typedefs to FTGL.h, mainly to aid debugging
-	- Cleaned up the includes.
+    - Added FTGL_DEBUG to include memory debugger.
+    - Added a couple of typedefs to FTGL.h, mainly to aid debugging
+    - Cleaned up the includes.
 
 November 13 2001
- 	1.3b3 (FTGL_1_3_BETA_3)
-	- Texture fonts now behave the same as the others and can be loaded on
+    1.3b3 (FTGL_1_3_BETA_3)
+    - Texture fonts now behave the same as the others and can be loaded on
       demand. This made FTGLTextureFont MUCH simpler!!!! It has also improved 
       the grid fitting so less texture mem is needed.
-	- Refactored FTVectoriser...
-	  This now builds contours and meshes internally and then passes the raw
+    - Refactored FTVectoriser...
+      This now builds contours and meshes internally and then passes the raw
       point data onto the glyphs. The gluTess data is captured in an internal 
       non static data structure fixing a memory Leak in PolyGlyph (glCombine). 
       This has enabled...
-	- Extruded fonts. FTGLExtrdFont & FTExtrdGlyph.
-	- Reversed the winding for polyglyphs, extruded glyphs and texture glyphs to
+    - Extruded fonts. FTGLExtrdFont & FTExtrdGlyph.
+    - Reversed the winding for polyglyphs, extruded glyphs and texture glyphs to
       make them CCW
-	- Bounding box function
-	- Fixed the != and == operators in ftPoint
-	- Un-virtualised some functions in FTFont
-	- Added a demo app to dist.
+    - Bounding box function
+    - Fixed the != and == operators in ftPoint
+    - Un-virtualised some functions in FTFont
+    - Added a demo app to dist.
 
 November 9 2001
- 	1.21 (FTGL_1_2_1)
- 	- Visual Studio projects updated for .cpp source file extensions.
- 	- A couple of windows 'cast' warnings have been fixed.
+    1.21 (FTGL_1_2_1)
+    - Visual Studio projects updated for .cpp source file extensions.
+    - A couple of windows 'cast' warnings have been fixed.
 
 November 6 2001
- 	1.2 (FTGL_1_2_0)
-	- Glyphs can now be loaded on the fly instead of being pre-cached. If
+    1.2 (FTGL_1_2_0)
+    - Glyphs can now be loaded on the fly instead of being pre-cached. If
       FTFont::Open() is called with false, FTGlyphContainer will build a list of 
       null pointers. Then when ever a glyph needs to be access eg by 
       FTFont::advance or FTFont::render, it will be built and slotted into the 
       glyphlist in the correct position.
-	- Removed glext.h from FTGL.h and replaced it with a test for 
+    - Removed glext.h from FTGL.h and replaced it with a test for 
       GL_EXT_texture_object.
-	- Added padding to texture size calculations.
-	- Fixed a NASTY bug in FTGLTextureFont. Only came to light after changes to
+    - Added padding to texture size calculations.
+    - Fixed a NASTY bug in FTGLTextureFont. Only came to light after changes to
       the glyph preprocessing.
 
 October 31 2001
- 	1.1 (FTGL_1_1_0)
-	- Renamed the source to .cpp
-	- Removed the static activeTextureID from FTTextureGlyph and replaced it
+    1.1 (FTGL_1_1_0)
+    - Renamed the source to .cpp
+    - Removed the static activeTextureID from FTTextureGlyph and replaced it
       with a call to
       glGetIntegerv( GL_TEXTURE_2D_BINDING_EXT, &activeTextureID);
-	- Added an include for glext.h in FTGL.h
-	- Tidied up the glbegin/glEnd pairs in FTTextureGlyph & FTGLTextureFont
-	- Fixed the problem with doc filenames.
-	- Tidied up some implicit type conversions.
-	- Fixed FTCharMap to ensure that a valid default charmap is always created
+    - Added an include for glext.h in FTGL.h
+    - Tidied up the glbegin/glEnd pairs in FTTextureGlyph & FTGLTextureFont
+    - Fixed the problem with doc filenames.
+    - Tidied up some implicit type conversions.
+    - Fixed FTCharMap to ensure that a valid default charmap is always created
       by the c_stor.
-	
+    
 October 26 2001
-	1.01 (FTGL_1_0_1)
-	- Removed the glEnable( GL_TEXTURE_2D) from FTGLTextureFont
-	- Removed the redundant tempGlyph members in the FTGLXXXXFont classes
-	- Made a change in FTGL.h to include correct headers for MAC OSX
-	- FTGL.h now includes glu.h
-	- Minor fixes to get rid of Project Builder warnings (MAC OSX)
-	- Fixed some of the docs
+    1.01 (FTGL_1_0_1)
+    - Removed the glEnable( GL_TEXTURE_2D) from FTGLTextureFont
+    - Removed the redundant tempGlyph members in the FTGLXXXXFont classes
+    - Made a change in FTGL.h to include correct headers for MAC OSX
+    - FTGL.h now includes glu.h
+    - Minor fixes to get rid of Project Builder warnings (MAC OSX)
+    - Fixed some of the docs
 
 October 24 2001
-	1.0 (FTGL_1_0_0)
-	- Version 1.0 release
+    1.0 (FTGL_1_0_0)
+    - Version 1.0 release
 
 September 29 2001
-	1.0b7 (FTGL_1_0_BETA_7)
-	- Tesselation winding rules
-	- Fixed bug in FTContour Add point function
-	- Cleaned up disposal of FTCharmap in FTFace
-	- renamed FTVectorGlyph to FTOutlineGlyph
-	- New distribution structure
-	- Minor changes for windows (VC 6)
-	- Windows and Linux ports.
+    1.0b7 (FTGL_1_0_BETA_7)
+    - Tesselation winding rules
+    - Fixed bug in FTContour Add point function
+    - Cleaned up disposal of FTCharmap in FTFace
+    - renamed FTVectorGlyph to FTOutlineGlyph
+    - New distribution structure
+    - Minor changes for windows (VC 6)
+    - Windows and Linux ports.
 
 September 20 2001
-	1.0b6 (FTGL_1_0_BETA_6)
-	- Implemented the new FTCharmap class. The performance improvement is
+    1.0b6 (FTGL_1_0_BETA_6)
+    - Implemented the new FTCharmap class. The performance improvement is
       dramatic.
-	- Tidied up the way the freetype FT_Face object is disposed of by FTFont and
-FTFace. This was a potential crash.
-	- FTVectorGlyph and FTPolyGlyph now disposes of the freetype glyph correctly
+    - Tidied up the way the freetype FT_Face object is disposed of by FTFont and
+      FTFace. This was a potential crash.
+    - FTVectorGlyph and FTPolyGlyph now disposes of the freetype glyph correctly
       after initialsation. This was a potential crash.
-	- Preliminary support for unicode...wchar_t Tested with non european fonts.
-	- Added function to calc the advance width of a string.
-	- Minor tidy ups.
+    - Preliminary support for unicode...wchar_t Tested with non european fonts.
+    - Added function to calc the advance width of a string.
+    - Minor tidy ups.
 
 August 29 2001
-	1.0b5 (FTGL_1_0_BETA_5)
-	- Settled on integers for FTSize stuff. NOTE the FTGlyph stuff is still up
+    1.0b5 (FTGL_1_0_BETA_5)
+    - Settled on integers for FTSize stuff. NOTE the FTGlyph stuff is still up
       in the air.
-	- Fixed the positional stuff.
-	- Added Java Doc comments. NOT COMPLETE
-	- Fixes for linux, mainly to clear warnings.
-	- changed the return type for FTFace::Glyph() from a reference to a pointer
+    - Fixed the positional stuff.
+    - Added Java Doc comments. NOT COMPLETE
+    - Fixes for linux, mainly to clear warnings.
+    - changed the return type for FTFace::Glyph() from a reference to a pointer
       so it can return NULL on failure.
-	- Related to above...better error handling and reporting in
+    - Related to above...better error handling and reporting in
       FTGLXXXFont::MakeGlyphList()
-	- Fixed a bug in FTVectoriser that was ignoring non printing characters.
+    - Fixed a bug in FTVectoriser that was ignoring non printing characters.
       This meant that the pen wasn't advanced for spaces etc. It affected
       polygon and outline font rendering.
-	- Minor tidy ups.
+    - Minor tidy ups.
 
 August 21 2001
-	1.0b4
-	- Changed the mode for FT_Load_Glyph to FT_LOAD_NO_HINTING |
+    1.0b4
+    - Changed the mode for FT_Load_Glyph to FT_LOAD_NO_HINTING |
       FT_LOAD_NO_BITMAP for outline and polygon fonts & FT_LOAD_NO_HINTING for 
       texture fonts. Seems to produce better looking glyphs.
-	- FTGLTextureFont can now use multiple textures to render glyphs if they
+    - FTGLTextureFont can now use multiple textures to render glyphs if they
       don't fit within one GL_MAX_TEXTURE_SIZE texture. 
-	- Changed FTSize to use bbox for global width and height. Needs more work
+    - Changed FTSize to use bbox for global width and height. Needs more work
       (eg float or int?) and need to check inconsistancies in freetype.
-	- Being more strict with types eg integer indices and sizes are now
+    - Being more strict with types eg integer indices and sizes are now
       unsigned.
 
 August 8 2001
-	1.0b3 (FTGL_1_0_BETA_3)
-	- I've made fundamental change to the way the glyphlist is built. This is to
+    1.0b3 (FTGL_1_0_BETA_3)
+    - I've made fundamental change to the way the glyphlist is built. This is to
       get round the problems I was having with charmaps. At this stage it is a
       temporary solution. Previously the glyphList was indexed by char code. Now
       it's indexed by glyph index and the conversion is done by the freetype
       function FT_Get_Char_Index(). If this proves to be too slow I'll make my
       own charmap and use it to index into the glyphlist. This has fixed all the
       charmap related problems/bugs.
-	- Enabled alpha blend in Pixmap font.
-	- Enabled LINE_SMOOTH in Outline font
-	- Fixed bug that prevented the display of chars >127
-	- Moved pixel store stuff out of BitmapGlyph into BitmapFont.
-	- Minor changes for IRIX (compiles but isn't tested)
-	- Pixmap fonts can now be in colour. It uses the current colour when the
+    - Enabled alpha blend in Pixmap font.
+    - Enabled LINE_SMOOTH in Outline font
+    - Fixed bug that prevented the display of chars >127
+    - Moved pixel store stuff out of BitmapGlyph into BitmapFont.
+    - Minor changes for IRIX (compiles but isn't tested)
+    - Pixmap fonts can now be in colour. It uses the current colour when the
       font is CREATED. This isn't ideal but is better than the alternatives.
-	- Tidied up the error handling.
-	- Minor code clean ups.
+    - Tidied up the error handling.
+    - Minor code clean ups.
 
 August 6 2001
-	BETA release 1.0b2 (FTGL_1_0_BETA_2)
-	- Minor tidy ups for first public release.
-	
+    BETA release 1.0b2 (FTGL_1_0_BETA_2)
+    - Minor tidy ups for first public release.
+    
 August 3 2001
-	First BETA release 1.0b1 (FTGL_1_0_BETA_1)
-	- All font types are now working, Bitmaps, Pixmaps, Texture, Outline and
+    First BETA release 1.0b1 (FTGL_1_0_BETA_1)
+    - All font types are now working, Bitmaps, Pixmaps, Texture, Outline and
       Polygons. Quality of output and performance varies wildly:)
 
 July 22 2001
-	First ALPHA Release 1.0a1
+    First ALPHA Release 1.0a1
diff --git a/README.txt b/README.txt
index 642b865..a5a1d2a 100755
--- a/README.txt
+++ b/README.txt
@@ -1,5 +1,5 @@
-FTGL 1.32
-April 23 2002
+FTGL 1.4
+August 26 2002
 
 
 DESCRIPTION:
@@ -40,7 +40,7 @@ Demo, Linux port, extrusion code and gltt maintainance by Gerard Lanois
 Linux port by Matthias Kretz
 Windows port by Max Rheiner & Ellers
 Bug fixes by Robert Osfield, Marcelo E. Magallon, Markku Rontu
-Sebastiene Barre
+Containers and optimisations by Sebastien Barre
 
 Please contact me if you have any suggestions, feature requests, or problems.
 
@@ -48,88 +48,3 @@ Henry Maddocks
 henryj@paradise.net.nz
 http://homepages.paradise.net.nz/henryj/
 
-
-
-//==============================================================================
-
-Version 2??????
-My initial design of FTGL was in 2 distinct parts...the freetype stuff and
-the FTGL stuff. The freetype side contained wrappers for the freetype stuff
-(surprise) and the ftgl side handled all the opengl stuff. All communication
-was done via FTFace <-> FTFont. This felt right from a design point of view
-because conceptually it made sense, it was clean, simple and it insulated
-FTGL from changes in freetype. Up to version 1.3 I have rigidly stuck to
-this 'rule'. Unfortunately this has been at the expense of the code. This
-became most evident when dealing with char maps. Common sense would argue
-that charmaps and the glyph container are intimately related, but because
-of the 'rule' the communication path between them is...
-FTGlyphContainer <-> FTFont <-> FTFace <-> FTCharMap
-This is bollocks and has lead to some ugly code.
-I am not about abandon the design completely, just the rule that says all
-communication should be via FTFace <-> FTFont. I will still maintain
-wrappers for freetype objects, but they will interface with ftgl in places
-that make the most sense from a code efficiency point of view.
-
-move glyph creation out of constructor, but load the freetype glyph and get
-the metrics.
-Change all dim stuff to float. Make my own floating point version of
-FT_Vector.
-Move Charmap to be owned by glyph container. See above
-Try out cbloom sorted vector in charmap. faster than std::map?
-Enable access to raw glyph data
-State handling...
-inline base class methods
-
-Extreme Programming...
-
-
-Things to think about...
-
-The whole char size thing is major headache.
-At the moment if you call font.CharSize( x) the glyph list is destroyed and
-rebuilt, which will be really, really, really inefficient if you change sizes
-often. Will the freetype cache stuff help? What about the new (FT 2.0.5)
-FTSize public api.
-
-When is the best time to construct the glyphList? After the call to Size(x)
-is the earliest but what happens if the client doesn't set the char size?
-Define a default size, check if glyphlist is valid in render function, if
-not call size with default size.
-
-good sites...
-http://cgm.cs.mcgill.ca/~luc/
-http://www.blackpawn.com/texts/lightmaps/default.html
-
-glGetIntegerv( GL_TEXTURE_2D_BINDING_EXT, &activeTextureID);
-should really check at run time.
-
-
-
-Check that I do this properly..
-============================
-
-Dave Williss a ˇcrit :
-
-Question:
-
-If I do this...
-
-    TT_New_Glyph(face, &glyph);
-    for (i = 0 ; i < n ; ++i) {
-        TT_Load_Glyph(instance, glyph, index[i], flags);
-            ... use glyph...
-    }
-
-    TT_Done_Glyph(glyph)
-
-Will I be leaking memory on each call to Load Glyph or
-should I create and destroy the glyph handle for each call?
-Seems terribily inefficient but to do that, but doing it as
-above I seem to be leaking memory.
-
-
-No, this is the correct behavior. Each call to TT_Load_Glyph
-overwrites the previous content.. and this was designed on
-purpose because the real content of a TT_Glyph object is
-_really_ complex with TrueType, and you don't want to create
-them on each glyph load..
diff --git a/TODO.txt b/TODO.txt
index 0bb9ed5..681a312 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -1,5 +1,5 @@
-FTGL 1.32
-April 23 2002
+FTGL 1.4
+August 26 2002
 
 TODO:
 	- use float for all font metrics and advance metrics.
@@ -10,8 +10,6 @@ FUTURE:
 	- Multiple sizes
 	- Optimise performance and mem usage.
 	- gl/glu errors
-	- check and confirm the glPixelStore stuff. Data Alignment. Tightly
-	  packed at the moment.
 	- Use the Freetype Cache mechanism. FTC_xxx
 	- Vertical formats
 	- Multiple Masters
@@ -44,9 +42,5 @@ BUGS:
 	  I will probably have to make my own struct with floats.
 	- The texture co-ords in the Texture Font may be wrong for non
 	  scalable fonts.
-	- There is an inconsistancy in the way the global bounding box is
-	  stored in Freetype. It is supposed to be in font units but in some
-	  cases it is in 16.16 format. I have implemented a work around but
-	  hopefully the freetype guys will sort this.
-	- FTVectoriser seems to position some points incorrectly. confusing
+	- FTVectoriser seems to position some points incorrectly. Confusing
 	  line point with control point at start or end????