SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
polyfonts.h
Go to the documentation of this file.
1 #ifndef _POLYFONTS_H_
2 #define _POLYFONTS_H_
3 
4 /*
5  Polyfonts is a polygon font drawing library for use with SDL. Any
6  TTF font can be converted for use with this library. Contact the
7  author for details.
8 
9  Copyright (C) 2003 Bob Pendleton
10 
11  This library is free software; you can redistribute it and/or
12  modify it under the terms of the GNU Lesser General Public License
13  as published by the Free Software Foundation, either version 3.1
14  of the License, or (at your option) any later version.
15 
16  This library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  Lesser General Public License for more details.
20 
21  You should have received a copy of the GNU Lesser General Public
22  License along with this library; if not, write to the Free
23  Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
24  02111-1307 USA
25 
26  If you do not wish to comply with the terms of the LGPL please
27  contact the author as other terms are available for a fee.
28 
29  Bob Pendleton
30  Bob@Pendleton.com
31 */
32 
33 //
34 #ifdef _MSC_VER
35 #include <windows_config.h>
36 #else
37 #include <config.h>
38 #endif
39 
40 //#include "SDL.h"
41 #include "polyfonttypes.h"
42 
43 #ifdef __cplusplus
44 extern "C"
45 {
46 #endif
47 
48  int pfSetFont(pffont *f);
49 #ifdef POLYFONTS_WANTS_IO
50  pffont *pfLoadFont(char *fileName);
51 #endif
52  void pfUnloadFont(pffont *f);
53  char *pfGetFontName();
55  int pfGetFontBBox(SUMOReal *minx, SUMOReal *miny, SUMOReal *maxx, SUMOReal *maxy);
60 
61  int pfGetFontNumGlyphs();
62  wchar_t pfGetChar(int glyph);
63 
64  void pfSetScale(SUMOReal s);
65  void pfSetScaleXY(SUMOReal sx, SUMOReal sy);
66  int pfSetScaleBox(char *c, SUMOReal w, SUMOReal h);
67  int pfSetScaleBoxW(wchar_t *c, SUMOReal w, SUMOReal h);
68 
69  void pfSetPosition(SUMOReal x, SUMOReal y);
70  void pfGetPosition(SUMOReal *x, SUMOReal *y);
71 
72  void pfSetSkew(SUMOReal s);
73  void pfSetWeight(int w);
74  void pfSetAngleR(SUMOReal a);
75  void pfSetAngleD(SUMOReal a);
76  void pfSetCenter(int onOff);
77 
78  int pfGetCharBBox(wchar_t c, SUMOReal *minx, SUMOReal *miny, SUMOReal *maxx, SUMOReal *maxy);
79  SUMOReal pfGetCharAdvance(wchar_t c);
80  SUMOReal pfGetCharHeight(wchar_t c);
81  SUMOReal pfGetCharWidth(wchar_t c);
82  SUMOReal pfGetCharAscent(wchar_t c);
83  SUMOReal pfGetCharDescent(wchar_t c);
84 
85  SUMOReal pfdkGetStringWidth(const char *c);
86 
87  int pfDrawChar(/*SDL_Surface *s,*/ wchar_t c);
88 
89  int pfDrawString(/*SDL_Surface *s,*/ const char *c);
90  int pfDrawStringW(/*SDL_Surface *s,*/ wchar_t *c);
91 
92 #ifdef __cplusplus
93 }
94 #endif
95 
96 #endif
void pfSetAngleR(SUMOReal a)
Definition: polyfonts.c:506
int pfDrawString(const char *c)
Definition: polyfonts.c:1070
SUMOReal pfGetCharDescent(wchar_t c)
Definition: polyfonts.c:956
SUMOReal pfGetCharAdvance(wchar_t c)
Definition: polyfonts.c:865
void pfGetPosition(SUMOReal *x, SUMOReal *y)
Definition: polyfonts.c:484
void pfSetPosition(SUMOReal x, SUMOReal y)
Definition: polyfonts.c:476
SUMOReal pfGetFontDescent()
Definition: polyfonts.c:771
char * pfGetFontName()
Definition: polyfonts.c:674
wchar_t pfGetChar(int g)
Definition: polyfonts.c:797
int pfGetCharBBox(wchar_t c, SUMOReal *minx, SUMOReal *miny, SUMOReal *maxx, SUMOReal *maxy)
Definition: polyfonts.c:879
void pfSetAngleD(SUMOReal a)
Definition: polyfonts.c:514
void pfSetCenter(int onOff)
Definition: polyfonts.c:521
void pfSetWeight(int w)
Definition: polyfonts.c:499
int pfDrawChar(wchar_t c)
Definition: polyfonts.c:1054
int pfGetFontNumGlyphs()
Definition: polyfonts.c:785
SUMOReal pfGetFontHeight()
Definition: polyfonts.c:729
void pfSetScaleXY(SUMOReal sx, SUMOReal sy)
Definition: polyfonts.c:468
pffont * pfGetCurrentFont()
Definition: polyfonts.c:688
int pfGetFontBBox(SUMOReal *minx, SUMOReal *miny, SUMOReal *maxx, SUMOReal *maxy)
Definition: polyfonts.c:695
void pfUnloadFont(pffont *font)
Definition: polyfonts.c:252
int pfSetFont(pffont *f)
Definition: polyfonts.c:148
SUMOReal pfGetFontWidth()
Definition: polyfonts.c:743
void pfSetScale(SUMOReal s)
Definition: polyfonts.c:461
SUMOReal pfdkGetStringWidth(const char *c)
Definition: polyfonts.c:1109
SUMOReal pfGetCharWidth(wchar_t c)
Definition: polyfonts.c:928
int pfDrawStringW(wchar_t *c)
Definition: polyfonts.c:1089
#define SUMOReal
Definition: config.h:215
void pfSetSkew(SUMOReal s)
Definition: polyfonts.c:492
int pfSetScaleBoxW(wchar_t *c, SUMOReal w, SUMOReal h)
Definition: polyfonts.c:654
int pfSetScaleBox(char *c, SUMOReal w, SUMOReal h)
Definition: polyfonts.c:634
SUMOReal pfGetCharHeight(wchar_t c)
Definition: polyfonts.c:914
SUMOReal pfGetCharAscent(wchar_t c)
Definition: polyfonts.c:942
SUMOReal pfGetFontAscent()
Definition: polyfonts.c:757