CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

fontserv.h

Go to the documentation of this file.
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 __CS_IVIDEO_FONTSERV_H__
00020 #define __CS_IVIDEO_FONTSERV_H__
00021 
00022 #include "csutil/scf.h"
00023 #include "csutil/ref.h"
00024 
00040 
00041 #define CSFONT_LARGE            "*large"
00042 
00043 #define CSFONT_ITALIC           "*italic"
00044 
00045 #define CSFONT_COURIER          "*courier"
00046 
00047 #define CSFONT_SMALL            "*small"
00048 
00050 struct iFont;
00051 
00052 SCF_VERSION (iFontDeleteNotify, 0, 0, 1);
00053 
00064 struct iFontDeleteNotify : public iBase
00065 {
00067   virtual void BeforeDelete (iFont* font) = 0;
00068 };
00069 
00070 SCF_VERSION (iFont, 3, 0, 0);
00071 
00076 struct iFont : public iBase
00077 {
00084   virtual void AddDeleteCallback (iFontDeleteNotify* func) = 0;
00085 
00089   virtual bool RemoveDeleteCallback (iFontDeleteNotify* func) = 0;
00090   
00097   virtual void SetSize (int iSize) = 0;
00098 
00103   virtual int GetSize () = 0;
00104 
00109   virtual void GetMaxSize (int &oW, int &oH) = 0;
00110 
00115   virtual bool GetGlyphSize (uint8 c, int &oW, int &oH) = 0;
00116 
00121   virtual bool GetGlyphSize (uint8 c, int &oW, int &oH, int &adv,
00122         int &left, int &top) = 0;
00123 
00129   virtual uint8 *GetGlyphBitmap (uint8 c, int &oW, int &oH) = 0;
00130 
00137   virtual uint8 *GetGlyphBitmap (uint8 c, int &oW, int &oH, int &adv,
00138         int &left, int &top) = 0;
00139 
00145   virtual uint8 *GetGlyphAlphaBitmap (uint8 c, int &oW, int &oH) = 0;
00146 
00153   virtual uint8 *GetGlyphAlphaBitmap (uint8 c, int &oW, int &oH, int &adv,
00154         int &left, int &top) = 0;
00155 
00159   virtual void GetDimensions (const char *text, int &oW, int &oH) = 0;
00160 
00165   virtual void GetDimensions (const char *text, int &oW, int &oH,
00166         int &desc) = 0;
00167 
00172   virtual int GetLength (const char *text, int maxwidth) = 0;
00173   
00180   virtual int GetDescent () = 0; 
00181 
00188   virtual int GetAscent () = 0; 
00189 };
00190 
00191 SCF_VERSION (iFontServer, 2, 0, 1);
00192 
00201 struct iFontServer : public iBase
00202 {
00207   virtual csPtr<iFont> LoadFont (const char *filename) = 0;
00208 
00212   virtual int GetFontCount () = 0;
00213 
00221   virtual iFont *GetFont (int iIndex) = 0;
00222 };
00223 
00226 #endif // __CS_IVIDEO_FONTSERV_H__

Generated for Crystal Space by doxygen 1.2.14