Update of /project/cells/cvsroot/cell-cultures/ftgl-int In directory common-lisp.net:/tmp/cvs-serv23354/ftgl-int
Modified Files: FTGLFromC.cpp Added Files: fgc.def Removed Files: main.cpp Log Message: Bring FTGL glue up-to-date Date: Tue Oct 19 00:16:56 2004 Author: ktilton
Index: cell-cultures/ftgl-int/FTGLFromC.cpp diff -u cell-cultures/ftgl-int/FTGLFromC.cpp:1.1 cell-cultures/ftgl-int/FTGLFromC.cpp:1.2 --- cell-cultures/ftgl-int/FTGLFromC.cpp:1.1 Sat Jun 26 20:38:42 2004 +++ cell-cultures/ftgl-int/FTGLFromC.cpp Tue Oct 19 00:16:55 2004 @@ -1,7 +1,26 @@ -/* CHANGED: frgo, 2004-02-22 */ -/* $Header: /project/cells/cvsroot/cell-cultures/ftgl-int/FTGLFromC.cpp,v 1.1 2004/06/26 18:38:42 ktilton Exp $ */ - #include <assert.h> +/* +;;; +;;; Copyright © 2004 by Kenneth William Tilton. +;;; +;;; Permission is hereby granted, free of charge, to any person obtaining a copy +;;; of this software and associated documentation files (the "Software"), to deal +;;; in the Software without restriction, including without limitation the rights +;;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +;;; copies of the Software, and to permit persons to whom the Software is furnished +;;; to do so, subject to the following conditions: +;;; +;;; The above copyright notice and this permission notice shall be included in +;;; all copies or substantial portions of the Software. +;;; +;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +;;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +;;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +;;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +;;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +;;; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +;;; IN THE SOFTWARE. +*/ #include "FTGLBitmapFont.h" #include "FTBitmapGlyph.h"
@@ -17,128 +36,116 @@ #include "FTGLPolygonFont.h" #include "FTPolyGlyph.h"
-#include "FTGLOutlineFont.h" -#include "FTOutlineGlyph.h" - -#include "FTGLExtrdFont.h" -#include "FTExtrdGlyph.h" +#include "FTGLOutlineFont.h" +#include "FTOutlineGlyph.h"
-#ifdef _WIN32 -#define __stdcall __stdcall -#else -#define __stdcall -#endif +#include "FTGLExtrdFont.h" +#include "FTExtrdGlyph.h"
-// make a new extrd ctor that takes a depth parm
-bool FTGLExtrdFont::FaceDepth( float new_depth ) -{ - Depth( new_depth ); - - return FaceSize( this->FaceSize(), 96 ); // force new glyphs -}
-#if defined(__cplusplus) extern "C" { -#endif -bool __stdcall fgcSetFaceSize( FTFont *f, - unsigned int faceSize, - unsigned int res ) -{ - return f->FaceSize( faceSize, res ); -}
-float __stdcall fgcAscender( FTFont *f ) -{ - return f->Ascender(); + void __stdcall fgcBuildGlyphs( FTFont* f ) + { + f->BuildGlyphs(); + } + + bool __stdcall fgcSetFaceSize( FTFont* f + , unsigned int faceSize + , unsigned int res ) + { + return f->FaceSize( faceSize, res ); + } + + +float __stdcall fgcAscender( FTFont* f ) { + return f->Ascender( ); }
-float __stdcall fgcDescender( FTFont *f ) -{ - return f->Descender( ); +float __stdcall fgcDescender( FTFont* f ) { + return f->Descender( ); }
-float __stdcall fgcStringAdvance( FTFont *f, - const char *string ) -{ - return f->Advance( string ); +float __stdcall fgcStringAdvance( FTFont* f, const char* string ) { + return f->Advance( string ); }
-float __stdcall fgcStringX( FTFont *f, - const char *string ) +int __stdcall fgcCharTexture( FTFont* f, int chr ) { + return ((FTGlyph *) f->FontGlyph( chr ))->glRendering(); + //return f->GlyphRendering( chr ); +} +/* +void FTFont::DoRender( const unsigned int chr, const unsigned int nextChr) { - float llx = 0.0f; /* frgo: clean inits for all vars ! */ - float lly = 0.0f; - float llz = 0.0f; - float urx = 0.0f; - float ury = 0.0f; - float urz = 0.0f; - - f->BBox( string, llx, lly, llz, urx, ury, urz ); - - return llx; /* frgo: Hm? This always returns 0.0 ... Why ? */ + CheckGlyph( chr); + + FTPoint kernAdvance = glyphList->Render( chr, nextChr, pen); + + pen.x += kernAdvance.x; + pen.y += kernAdvance.y; +}*/ + + + +float __stdcall fgcStringX( FTFont* f, const char* string ) { + float llx,lly,llz,urx,ury,urz; + + f->BBox( string, llx, lly, llz, urx, ury, urz ); + return llx; }
-void __stdcall fgcRender( FTFont *f, - const char *string ) -{ - f->Render( string ); +void __stdcall fgcRender( FTFont* f, const char *string ) { + f->Render( string ); }
-void __stdcall fgcFree( FTFont *f ) -{ - delete f; +void __stdcall fgcFree( FTFont* f ) { + delete f; }
//--------- Bitmap ----------------------------------------------
-FTGLBitmapFont * __stdcall fgcBitmapMake( const char* fontname ) -{ - return new FTGLBitmapFont( fontname ); +FTGLBitmapFont* __stdcall fgcBitmapMake( const char* fontname ) { + return new FTGLBitmapFont( fontname ); }
//--------- Pixmap ----------------------------------------------
-FTGLPixmapFont * __stdcall fgcPixmapMake( const char* fontname ) -{ - return new FTGLPixmapFont( fontname ); +FTGLPixmapFont* __stdcall fgcPixmapMake( const char* fontname ) { + return new FTGLPixmapFont( fontname ); }
//--------- Texture ----------------------------------------------
-FTGLTextureFont * __stdcall fgcTextureMake( const char* fontname ) -{ - return new FTGLTextureFont( fontname ); +FTGLTextureFont* __stdcall fgcTextureMake( const char* fontname ) { + return new FTGLTextureFont( fontname ); }
//--------- Polygon ----------------------------------------------
-FTGLPolygonFont * __stdcall fgcPolygonMake( const char* fontname ) -{ - return new FTGLPolygonFont( fontname ); +FTGLPolygonFont* __stdcall fgcPolygonMake( const char* fontname ) { + return new FTGLPolygonFont( fontname ); }
//--------- Outline ----------------------------------------------
-FTGLOutlineFont * __stdcall fgcOutlineMake( const char* fontname ) -{ - return new FTGLOutlineFont( fontname ); +FTGLOutlineFont* __stdcall fgcOutlineMake( const char* fontname ) { + return new FTGLOutlineFont( fontname ); }
//--------- Extruded Polygon -------------------------------------
-FTGLExtrdFont * __stdcall fgcExtrudedMake( const char* fontname ) -{ - return new FTGLExtrdFont( fontname ); +FTGLExtrdFont* __stdcall fgcExtrudedMake( const char* fontname ) { + return new FTGLExtrdFont( fontname ); }
-bool __stdcall fgcSetFaceDepth( FTGLExtrdFont *f, - float depth ) -{ - return f->FaceDepth( depth ); + +bool __stdcall fgcSetFaceDepth( FTGLExtrdFont* f + , float depth ) { + f->Depth( depth ); + return true; }
-#if defined(__cplusplus) -} // extern "C" -#endif + +}