Heavily influenced by this mornings mail. Here's
a second shot at getting this right. As far as I can see this API allows optimizing up 
the wazoo and also allows for using Font libraries other than Freetype.

Lee
__________________________________________________


/*
        The libGEL API
*/
#ifndef _GGI_GEL_H
#define _GGI_GEL_H
#include <ggi/ggi.h>
#include <freetype/freetype.h>
#include "gel_types.h"

__BEGIN_DECLS

/*
        library management
*/
int gelInit(void);
int gelExit(void);

int gelAttach(ggi_visual_t vis);
int gelDetach(ggi_visual_t vis);

/*
        fonts
*/
/* Initialization */
gel_font_t      gelInitFTFont(FT_Face font);
void            gelRemoveFont(gel_font_t handle);
void            gelClearFontCache(gel_font_t handle);

/* Colors 
        These are the colors used when printing */
int     gelSetFontForeground(gel_font_t handle, ggi_color c);
int     gelGetFontForeground(gel_font_t handle, ggi_color* c);
int     gelSetFontBackground(gel_font_t handle, ggi_color c);
int     gelGetFontBackground(gel_font_t handle, ggi_color* c);

/* Dimensions 
        These are the dimensions of the bitmap
*/
int gelCharDim(gel_font_t font, uint32 char_code, gel_font_dim* dim);
int gelVCharDim(gel_font_t font, uint32 char_code, gel_font_dim* dim);
int gelGlyphDim(gel_font_t font, uint32 index, gel_font_dim* dim);
int gelVGlyphDim(gel_font_t font, uint32 index, gel_font_dim* dim);

int gelCharSDim(gel_font_t font, const char* string, gel_font_dim* dim);
int gelVCharSDim(gel_font_t font, const char* string, gel_font_dim* dim);
int gelGlyphSDim(gel_font_t font, const uint32* indices, size_t num, gel_font_dim* 
dim);
int gelVGlyphSDim(gel_font_t font, const uint32* indices, size_t num, gel_font_dim* 
dim);

/* Bitmaps 
        These are the raw bitmaps from the 
rendering library
*/

/* size of elements in bitmap 1,2,4,8,16,32 bit */
uint32  gelFontRenderMode(gel_font_t handle);

int gelCharBitmap(gel_font_t font, uint32 char_code, void* buf);
int gelVCharBitmap(gel_font_t font, uint32 char_code, void* buf);
int gelGlyphBitmap(gel_font_t font, uint32 index, void* buf);
int gelVGlyphBitmap(gel_font_t font, uint32 index, void* buf);

int gelCharSBitmap(gel_font_t font, const char* string, void* buf);
int gelVCharSBitmap(gel_font_t font, const char* string, void* buf);
int     gelGlyphSBitmap(gel_font_t font, const uint32* indices, size_t num, void* buf);
int gelVGlyphSBitmap(gel_font_t font, const uint32* indices, size_t num, void* buf);

/* Printing 
        puts the glyphs on a visual using
        the foreground and background colors
*/
int gelPrintChar(ggi_visual_t vis, gel_font_t font, uint32 char_code, int* x, int* y);
int gelPrintVChar(ggi_visual_t vis, gel_font_t font, uint32 char_code, int* x, int* y);
int gelPrintGlyph(ggi_visual_t vis, gel_font_t font, uint32 index, int* x, int* y);
int gelPrintVGlyph(ggi_visual_t vis, gel_font_t font, uint32 index, int* x, int* y);

int gelPrintCharS(ggi_visual_t vis, gel_font_t font, const char* string, int* x, int* 
y);
int gelPrintVCharS(ggi_visual_t vis, gel_font_t font, const char* string, int* x, int* 
y);
int gelPrintGlyphS(ggi_visual_t vis, gel_font_t font, const uint32* indices, size_t 
num, int* x, int* y);
int gelPrintVGlyphS(ggi_visual_t vis, gel_font_t font, const uint32* indices, size_t 
num, int* x, int* y);

__END_DECLS

#endif
-- 
Get your free email from www.linuxmail.org 


Powered by Outblaze

Reply via email to