SUMO - Simulation of Urban MObility
polyfonts.h
Go to the documentation of this file.
00001 #ifndef _POLYFONTS_H_
00002 #define _POLYFONTS_H_
00003 
00004 /*
00005   Polyfonts is a polygon font drawing library for use with SDL. Any
00006   TTF font can be converted for use with this library. Contact the
00007   author for details.
00008 
00009   Copyright (C) 2003 Bob Pendleton
00010 
00011   This library is free software; you can redistribute it and/or
00012   modify it under the terms of the GNU Lesser General Public License
00013   as published by the Free Software Foundation, either version 3.1
00014   of the License, or (at your option) any later version.
00015 
00016   This library is distributed in the hope that it will be useful,
00017   but WITHOUT ANY WARRANTY; without even the implied warranty of
00018   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019   Lesser General Public License for more details.
00020 
00021   You should have received a copy of the GNU Lesser General Public
00022   License along with this library; if not, write to the Free
00023   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00024   02111-1307 USA
00025 
00026   If you do not wish to comply with the terms of the LGPL please
00027   contact the author as other terms are available for a fee.
00028 
00029   Bob Pendleton
00030   Bob@Pendleton.com
00031 */
00032 
00033 //
00034 #ifdef _MSC_VER
00035 #include <windows_config.h>
00036 #else
00037 #include <config.h>
00038 #endif
00039 
00040 //#include "SDL.h"
00041 #include "polyfonttypes.h"
00042 
00043 #ifdef __cplusplus
00044 extern "C"
00045 {
00046 #endif
00047 
00048     int     pfSetFont(pffont *f);
00049 #ifdef POLYFONTS_WANTS_IO
00050     pffont *pfLoadFont(char *fileName);
00051 #endif
00052     void    pfUnloadFont(pffont *f);
00053     char   *pfGetFontName();
00054     pffont *pfGetCurrentFont();
00055     int     pfGetFontBBox(SUMOReal *minx, SUMOReal *miny, SUMOReal *maxx, SUMOReal *maxy);
00056     SUMOReal   pfGetFontHeight();
00057     SUMOReal   pfGetFontWidth();
00058     SUMOReal   pfGetFontAscent();
00059     SUMOReal   pfGetFontDescent();
00060 
00061     int     pfGetFontNumGlyphs();
00062     wchar_t pfGetChar(int glyph);
00063 
00064     void    pfSetScale(SUMOReal s);
00065     void    pfSetScaleXY(SUMOReal sx, SUMOReal sy);
00066     int     pfSetScaleBox(char *c, SUMOReal w, SUMOReal h);
00067     int     pfSetScaleBoxW(wchar_t *c, SUMOReal w, SUMOReal h);
00068 
00069     void    pfSetPosition(SUMOReal x, SUMOReal y);
00070     void    pfGetPosition(SUMOReal *x, SUMOReal *y);
00071 
00072     void    pfSetSkew(SUMOReal s);
00073     void    pfSetWeight(int w);
00074     void    pfSetAngleR(SUMOReal a);
00075     void    pfSetAngleD(SUMOReal a);
00076     void    pfSetCenter(int onOff);
00077 
00078     int     pfGetCharBBox(wchar_t c, SUMOReal *minx, SUMOReal *miny, SUMOReal *maxx, SUMOReal *maxy);
00079     SUMOReal   pfGetCharAdvance(wchar_t c);
00080     SUMOReal   pfGetCharHeight(wchar_t c);
00081     SUMOReal   pfGetCharWidth(wchar_t c);
00082     SUMOReal   pfGetCharAscent(wchar_t c);
00083     SUMOReal   pfGetCharDescent(wchar_t c);
00084 
00085     SUMOReal pfdkGetStringWidth(const char *c);
00086 
00087     int     pfDrawChar(/*SDL_Surface *s,*/ wchar_t c);
00088 
00089     int     pfDrawString(/*SDL_Surface *s,*/ const char *c);
00090     int     pfDrawStringW(/*SDL_Surface *s,*/ wchar_t *c);
00091 
00092 #ifdef __cplusplus
00093 }
00094 #endif
00095 
00096 #endif
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines