SUMO - Simulation of Urban MObility
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(double *minx, double *miny, double *maxx, double *maxy);
56  double pfGetFontHeight();
57  double pfGetFontWidth();
58  double pfGetFontAscent();
59  double pfGetFontDescent();
60 
61  int pfGetFontNumGlyphs();
62  wchar_t pfGetChar(int glyph);
63 
64  void pfSetScale(double s);
65  void pfSetScaleXY(double sx, double sy);
66  int pfSetScaleBox(char *c, double w, double h);
67  int pfSetScaleBoxW(wchar_t *c, double w, double h);
68 
69  void pfSetPosition(double x, double y);
70  void pfGetPosition(double *x, double *y);
71 
72  void pfSetSkew(double s);
73  void pfSetWeight(int w);
74  void pfSetAngleR(double a);
75  void pfSetAngleD(double a);
76  void pfSetCenter(int onOff);
77 
78  int pfGetCharBBox(wchar_t c, double *minx, double *miny, double *maxx, double *maxy);
79  double pfGetCharAdvance(wchar_t c);
80  double pfGetCharHeight(wchar_t c);
81  double pfGetCharWidth(wchar_t c);
82  double pfGetCharAscent(wchar_t c);
83  double pfGetCharDescent(wchar_t c);
84 
85  double 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
double pfGetCharAdvance(wchar_t c)
Definition: polyfonts.c:869
int pfSetScaleBoxW(wchar_t *c, double w, double h)
Definition: polyfonts.c:658
int pfSetScaleBox(char *c, double w, double h)
Definition: polyfonts.c:638
void pfGetPosition(double *x, double *y)
Definition: polyfonts.c:488
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
double pfdkGetStringWidth(const char *c)
Definition: polyfonts.c:1113
int pfSetFont(pffont *f)
Definition: polyfonts.c:152
double pfGetCharAscent(wchar_t c)
Definition: polyfonts.c:946
int pfGetCharBBox(wchar_t c, double *minx, double *miny, double *maxx, double *maxy)
Definition: polyfonts.c:883
int pfGetFontBBox(double *minx, double *miny, double *maxx, double *maxy)
Definition: polyfonts.c:699
void pfUnloadFont(pffont *f)
Definition: polyfonts.c:256
void pfSetScale(double s)
Definition: polyfonts.c:465
double pfGetFontHeight()
Definition: polyfonts.c:733
double pfGetFontWidth()
Definition: polyfonts.c:747
double pfGetCharWidth(wchar_t c)
Definition: polyfonts.c:932
void pfSetAngleD(double a)
Definition: polyfonts.c:518
void pfSetPosition(double x, double y)
Definition: polyfonts.c:480
void pfSetScaleXY(double sx, double sy)
Definition: polyfonts.c:472
char * pfGetFontName()
Definition: polyfonts.c:678
void pfSetSkew(double s)
Definition: polyfonts.c:496
double pfGetCharDescent(wchar_t c)
Definition: polyfonts.c:960
void pfSetAngleR(double a)
Definition: polyfonts.c:510
void pfSetCenter(int onOff)
Definition: polyfonts.c:525
pffont * pfGetCurrentFont()
Definition: polyfonts.c:692
void pfSetWeight(int w)
Definition: polyfonts.c:503
double pfGetCharHeight(wchar_t c)
Definition: polyfonts.c:918
wchar_t pfGetChar(int glyph)
Definition: polyfonts.c:801
double pfGetFontAscent()
Definition: polyfonts.c:761
double pfGetFontDescent()
Definition: polyfonts.c:775