[cello-cvs] CVS cello/cl-ftgl/ftgl-int

ktilton ktilton at common-lisp.net
Wed May 17 16:14:29 UTC 2006


Update of /project/cello/cvsroot/cello/cl-ftgl/ftgl-int
In directory clnet:/tmp/cvs-serv22618/cl-ftgl/ftgl-int

Added Files:
	FTGLFromC.cpp fgc.def 
Log Message:
CVS re-organization bringing auxiliary packages under one Cello module


--- /project/cello/cvsroot/cello/cl-ftgl/ftgl-int/FTGLFromC.cpp	2006/05/17 16:14:29	NONE
+++ /project/cello/cvsroot/cello/cl-ftgl/ftgl-int/FTGLFromC.cpp	2006/05/17 16:14:29	1.1
#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"

#include "FTGLPixmapFont.h"
#include "FTPixmapGlyph.h"

#include "FTGLTextureFont.h"
#include "FTTextureGlyph.h"

#include "FTGlyphContainer.h"
#include "FTBBox.h"

#include "FTGLPolygonFont.h"
#include "FTPolyGlyph.h"

#include    "FTGLOutlineFont.h"
#include    "FTOutlineGlyph.h"

#include    "FTGLExtrdFont.h"
#include    "FTExtrdGlyph.h"



extern "C" {

	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 fgcStringAdvance( FTFont* f, const char* string ) {
	return f->Advance( 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)
{
    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 fgcFree( FTFont* f ) {
	delete f;
}

//--------- Bitmap ----------------------------------------------

FTGLBitmapFont* __stdcall fgcBitmapMake( const char* fontname ) {
	return new FTGLBitmapFont( fontname );
}

//--------- Pixmap ----------------------------------------------

FTGLPixmapFont* __stdcall fgcPixmapMake( const char* fontname ) {
	return new FTGLPixmapFont( fontname );
}

//--------- Texture ----------------------------------------------

FTGLTextureFont* __stdcall fgcTextureMake( const char* fontname ) {
	return new FTGLTextureFont( fontname );
}

//--------- Polygon ----------------------------------------------

FTGLPolygonFont* __stdcall fgcPolygonMake( const char* fontname ) {
	return new FTGLPolygonFont( fontname );
}

//--------- Outline ----------------------------------------------

FTGLOutlineFont* __stdcall fgcOutlineMake( const char* fontname ) {
	return new FTGLOutlineFont( fontname );
}

//--------- Extruded Polygon -------------------------------------

FTGLExtrdFont* __stdcall fgcExtrudedMake( const char* fontname ) {
	return new FTGLExtrdFont( fontname );
}


bool __stdcall fgcSetFaceDepth( FTGLExtrdFont* f
							  , float depth ) {
	f->Depth( depth );
	return true;
}


}

--- /project/cello/cvsroot/cello/cl-ftgl/ftgl-int/fgc.def	2006/05/17 16:14:29	NONE
+++ /project/cello/cvsroot/cello/cl-ftgl/ftgl-int/fgc.def	2006/05/17 16:14:29	1.1
DESCRIPTION 'C Interface to FTGL'

VERSION 0.1

EXPORTS
	fgcSetFaceSize
	fgcCharTexture
	fgcStringX
	fgcAscender
	fgcDescender
	fgcStringAdvance
	fgcRender
	fgcFree
	fgcBitmapMake
	fgcPixmapMake
	fgcTextureMake
	fgcPolygonMake
	fgcOutlineMake
	fgcExtrudedMake
	fgcSetFaceDepth
	fgcBuildGlyphs
	



More information about the Cello-cvs mailing list