SUMO - Simulation of Urban MObility
polyfonts.c File Reference
#include <config.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <GL/gl.h>
#include "polyfonts.h"
#include "pfPSansBold16.h"

Go to the source code of this file.

Data Structures

struct  nameValue
struct  vertex

Defines

#define abs(a)   (((a)<0) ? -(a) : (a))
#define DtoR   (PI/180.0)
#define max(a, b)   (((a) > (b)) ? (a) : (b))
#define min(a, b)   (((a) < (b)) ? (a) : (b))
#define numWeights   (sizeof(weightOffset) / sizeof(vertex))
#define PI   (3.1415926535897932384626433)
#define RtoD   (180.0/PI)
#define sign(a)   (((a)<0) ? -1 : (a)>0 ? 1 : 0)
#define unfix(value)   ((SUMOReal)(value)) / ((SUMOReal)pfFixScale)

Functions

static SUMOReal getCharAdvance (wchar_t c)
static int lookupGlOp (char *op)
static pfglyphpfGetGlyph (wchar_t c)
int pfSetFont (pffont *f)
static SUMOReal pfSkew (SUMOReal x, SUMOReal y)
void pfUnloadFont (pffont *font)
static void validate (pffont *font)

Variables

static nameValue glPrims []
static int pfCenter = 0
static pffontpfCurrentFont = &pfPSansBold16
static pffontpfDefaultFont = &pfPSansBold16
static SUMOReal pfScaleX = 20.0
static SUMOReal pfScaleY = 20.0
static SUMOReal pfTextCos = 1.0
static SUMOReal pfTextSin = 0.0
static SUMOReal pfTextSkew = 0.0
static int pfTextWeight = 1
static SUMOReal pfTextX = 0.0
static SUMOReal pfTextY = 0.0
vertex weightOffset []

Define Documentation

#define abs (   a)    (((a)<0) ? -(a) : (a))
#define DtoR   (PI/180.0)

Definition at line 59 of file polyfonts.c.

#define numWeights   (sizeof(weightOffset) / sizeof(vertex))

Definition at line 125 of file polyfonts.c.

#define RtoD   (180.0/PI)

Definition at line 58 of file polyfonts.c.

#define sign (   a)    (((a)<0) ? -1 : (a)>0 ? 1 : 0)

Definition at line 64 of file polyfonts.c.

Referenced by MSCFModel_Wiedemann::following().

#define unfix (   value)    ((SUMOReal)(value)) / ((SUMOReal)pfFixScale)

Definition at line 132 of file polyfonts.c.


Function Documentation

static SUMOReal getCharAdvance ( wchar_t  c) [static]
static int lookupGlOp ( char *  op) [static]

Definition at line 184 of file polyfonts.c.

References glPrims.

static pfglyph* pfGetGlyph ( wchar_t  c) [static]
int pfSetFont ( pffont f)

Definition at line 148 of file polyfonts.c.

static SUMOReal pfSkew ( SUMOReal  x,
SUMOReal  y 
) [static]

Definition at line 141 of file polyfonts.c.

References pfTextSkew.

void pfUnloadFont ( pffont font)

Definition at line 252 of file polyfonts.c.

References pffont::glyphs, pffont::loaded, pffont::name, and pffont::numglyphs.

static void validate ( pffont font) [static]

Variable Documentation

nameValue glPrims[] [static]
Initial value:
  {
    {"GL_POINTS",         GL_POINTS},
    {"GL_LINES",          GL_LINES},
    {"GL_LINE_LOOP",      GL_LINE_LOOP},
    {"GL_LINE_STRIP",     GL_LINE_STRIP},
    {"GL_TRIANGLES",      GL_TRIANGLES},
    {"GL_TRIANGLE_STRIP", GL_TRIANGLE_STRIP},
    {"GL_TRIANGLE_FAN",   GL_TRIANGLE_FAN},
    {"GL_QUADS",          GL_QUADS},
    {"GL_QUAD_STRIP",     GL_QUAD_STRIP},
    {"GL_POLYGON",        GL_POLYGON},
  }

Definition at line 168 of file polyfonts.c.

Referenced by lookupGlOp().

int pfCenter = 0 [static]

Definition at line 130 of file polyfonts.c.

Definition at line 79 of file polyfonts.c.

Definition at line 80 of file polyfonts.c.

SUMOReal pfScaleX = 20.0 [static]

Definition at line 98 of file polyfonts.c.

SUMOReal pfScaleY = 20.0 [static]

Definition at line 99 of file polyfonts.c.

SUMOReal pfTextCos = 1.0 [static]

Definition at line 128 of file polyfonts.c.

SUMOReal pfTextSin = 0.0 [static]

Definition at line 127 of file polyfonts.c.

SUMOReal pfTextSkew = 0.0 [static]

Definition at line 104 of file polyfonts.c.

Referenced by pfSkew().

int pfTextWeight = 1 [static]

Definition at line 105 of file polyfonts.c.

SUMOReal pfTextX = 0.0 [static]

Definition at line 101 of file polyfonts.c.

SUMOReal pfTextY = 0.0 [static]

Definition at line 102 of file polyfonts.c.

Initial value:
 {
  {0.0, 0.0},
  {0.0, 1.0},
  {1.0, 1.0},
  {1.0, 0.0},
  
  {0.0, 2.0},
  {1.0, 2.0},
  {2.0, 2.0},
  {1.0, 2.0},
  {0.0, 2.0},
}

Definition at line 112 of file polyfonts.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines