SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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
SUMOReal pfdkGetStringWidth(const char *c)
Definition: polyfonts.c:1113
void pfSetScale(SUMOReal s)
Definition: polyfonts.c:465
void pfSetAngleD(SUMOReal a)
Definition: polyfonts.c:518
int pfDrawStringW(wchar_t *c)
Definition: polyfonts.c:1093
int pfDrawString(const char *c)
Definition: polyfonts.c:1074
int pfDrawChar(wchar_t c)
Definition: polyfonts.c:1058
int pfGetFontNumGlyphs()
Definition: polyfonts.c:789
int pfSetFont(pffont *f)
Definition: polyfonts.c:152
int pfSetScaleBoxW(wchar_t *c, SUMOReal w, SUMOReal h)
Definition: polyfonts.c:658
SUMOReal pfGetCharAscent(wchar_t c)
Definition: polyfonts.c:946
SUMOReal pfGetCharDescent(wchar_t c)
Definition: polyfonts.c:960
void pfUnloadFont(pffont *f)
Definition: polyfonts.c:256
SUMOReal pfGetCharAdvance(wchar_t c)
Definition: polyfonts.c:869
SUMOReal pfGetCharWidth(wchar_t c)
Definition: polyfonts.c:932
void pfGetPosition(SUMOReal *x, SUMOReal *y)
Definition: polyfonts.c:488
void pfSetPosition(SUMOReal x, SUMOReal y)
Definition: polyfonts.c:480
void pfSetSkew(SUMOReal s)
Definition: polyfonts.c:496
int pfSetScaleBox(char *c, SUMOReal w, SUMOReal h)
Definition: polyfonts.c:638
SUMOReal pfGetCharHeight(wchar_t c)
Definition: polyfonts.c:918
SUMOReal pfGetFontAscent()
Definition: polyfonts.c:761
SUMOReal pfGetFontDescent()
Definition: polyfonts.c:775
char * pfGetFontName()
Definition: polyfonts.c:678
SUMOReal pfGetFontHeight()
Definition: polyfonts.c:733
void pfSetAngleR(SUMOReal a)
Definition: polyfonts.c:510
void pfSetScaleXY(SUMOReal sx, SUMOReal sy)
Definition: polyfonts.c:472
#define SUMOReal
Definition: config.h:214
void pfSetCenter(int onOff)
Definition: polyfonts.c:525
pffont * pfGetCurrentFont()
Definition: polyfonts.c:692
void pfSetWeight(int w)
Definition: polyfonts.c:503
int pfGetFontBBox(SUMOReal *minx, SUMOReal *miny, SUMOReal *maxx, SUMOReal *maxy)
Definition: polyfonts.c:699
wchar_t pfGetChar(int glyph)
Definition: polyfonts.c:801
SUMOReal pfGetFontWidth()
Definition: polyfonts.c:747
int pfGetCharBBox(wchar_t c, SUMOReal *minx, SUMOReal *miny, SUMOReal *maxx, SUMOReal *maxy)
Definition: polyfonts.c:883