Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

fontserv.h

00001 /*
00002     Copyright (C) 2000 by Norman Krämer
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     License as published by the Free Software Foundation; either
00007     version 2 of the License, or (at your option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012     Library General Public License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public
00015     License along with this library; if not, write to the Free
00016     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017 */
00018 
00019 #ifndef __IVIDEO_FONTSERV_H__
00020 #define __IVIDEO_FONTSERV_H__
00021 
00022 #include "csutil/scf.h"
00023 
00024 /*
00025  * Some alias names for basic fonts.
00026  * Any font server should provide these fonts, since most
00027  * programs expect they to be available. Other fonts may or
00028  * may be not available but these should be always available.
00029  * Default font names always start with "*" to avoid confusion
00030  * with real file names.
00031  */
00032 
00034 #define CSFONT_LARGE            "*large"
00035 
00036 #define CSFONT_ITALIC           "*italic"
00037 
00038 #define CSFONT_COURIER          "*courier"
00039 
00040 #define CSFONT_SMALL            "*small"
00041 
00042 struct iFont;
00043 
00044 SCF_VERSION (iFontDeleteNotify, 0, 0, 1);
00045 
00056 struct iFontDeleteNotify : public iBase
00057 {
00059   virtual void BeforeDelete (iFont* font) = 0;
00060 };
00061 
00062 SCF_VERSION (iFont, 2, 0, 1);
00063 
00068 struct iFont : public iBase
00069 {
00076   virtual void SetSize (int iSize) = 0;
00077 
00082   virtual int GetSize () = 0;
00083 
00088   virtual void GetMaxSize (int &oW, int &oH) = 0;
00089 
00094   virtual bool GetGlyphSize (uint8 c, int &oW, int &oH) = 0;
00095 
00100   virtual bool GetGlyphSize (uint8 c, int &oW, int &oH, int &adv, int &left, int &top) = 0;
00101 
00107   virtual uint8 *GetGlyphBitmap (uint8 c, int &oW, int &oH) = 0;
00108 
00115   virtual uint8 *GetGlyphBitmap (uint8 c, int &oW, int &oH, int &adv, int &left, int &top) = 0;
00116 
00120   virtual void GetDimensions (const char *text, int &oW, int &oH) = 0;
00121 
00125   virtual void GetDimensions (const char *text, int &oW, int &oH, int &desc) = 0;
00126 
00131   virtual int GetLength (const char *text, int maxwidth) = 0;
00132 
00139   virtual void AddDeleteCallback (iFontDeleteNotify* func) = 0;
00140 
00144   virtual bool RemoveDeleteCallback (iFontDeleteNotify* func) = 0;
00145 };
00146 
00147 SCF_VERSION (iFontServer, 2, 0, 0);
00148 
00157 struct iFontServer : public iBase
00158 {
00163   virtual iFont *LoadFont (const char *filename) = 0;
00164 
00168   virtual int GetFontCount () = 0;
00169 
00177   virtual iFont *GetFont (int iIndex) = 0;
00178 };
00179 
00180 #endif // __IVIDEO_FONTSERV_H__

Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000