Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
fontstash.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  FONSparams
 
struct  FONSquad
 
struct  FONStextIter
 

Macros

#define FONS_DEF   extern
 
#define FONS_INVALID   -1
 

Typedefs

typedef struct FONScontext FONScontext
 
typedef struct FONSparams FONSparams
 
typedef struct FONSquad FONSquad
 
typedef struct FONStextIter FONStextIter
 

Enumerations

enum  FONSalign {
  FONS_ALIGN_LEFT = 1<<0 , FONS_ALIGN_CENTER = 1<<1 , FONS_ALIGN_RIGHT = 1<<2 , FONS_ALIGN_TOP = 1<<3 ,
  FONS_ALIGN_MIDDLE = 1<<4 , FONS_ALIGN_BOTTOM = 1<<5 , FONS_ALIGN_BASELINE = 1<<6
}
 
enum  FONSerrorCode { FONS_ATLAS_FULL = 1 , FONS_SCRATCH_FULL = 2 , FONS_STATES_OVERFLOW = 3 , FONS_STATES_UNDERFLOW = 4 }
 
enum  FONSflags { FONS_ZERO_TOPLEFT = 1 , FONS_ZERO_BOTTOMLEFT = 2 }
 

Functions

FONS_DEF int fonsAddFont (FONScontext *s, const char *name, const char *path)
 
FONS_DEF int fonsAddFontMem (FONScontext *s, const char *name, unsigned char *data, int ndata, int freeData)
 
FONS_DEF void fonsClearState (FONScontext *s)
 
FONS_DEF FONScontextfonsCreateInternal (FONSparams *params)
 
FONS_DEF void fonsDeleteInternal (FONScontext *s)
 
FONS_DEF void fonsDrawDebug (FONScontext *s, float x, float y)
 
FONS_DEF float fonsDrawText (FONScontext *s, float x, float y, const char *string, const char *end)
 
FONS_DEF int fonsExpandAtlas (FONScontext *s, int width, int height)
 
FONS_DEF void fonsGetAtlasSize (FONScontext *s, int *width, int *height)
 
FONS_DEF int fonsGetFontByName (FONScontext *s, const char *name)
 
FONS_DEF const unsigned char * fonsGetTextureData (FONScontext *stash, int *width, int *height)
 
FONS_DEF void fonsLineBounds (FONScontext *s, float y, float *miny, float *maxy)
 
FONS_DEF void fonsPopState (FONScontext *s)
 
FONS_DEF void fonsPushState (FONScontext *s)
 
FONS_DEF int fonsResetAtlas (FONScontext *stash, int width, int height)
 
FONS_DEF void fonsSetAlign (FONScontext *s, int align)
 
FONS_DEF void fonsSetBlur (FONScontext *s, float blur)
 
FONS_DEF void fonsSetColor (FONScontext *s, unsigned int color)
 
FONS_DEF void fonsSetErrorCallback (FONScontext *s, void(*callback)(void *uptr, int error, int val), void *uptr)
 
FONS_DEF void fonsSetFont (FONScontext *s, int font)
 
FONS_DEF void fonsSetSize (FONScontext *s, float size)
 
FONS_DEF void fonsSetSpacing (FONScontext *s, float spacing)
 
FONS_DEF float fonsTextBounds (FONScontext *s, float x, float y, const char *string, const char *end, float *bounds)
 
FONS_DEF int fonsTextIterInit (FONScontext *stash, FONStextIter *iter, float x, float y, const char *str, const char *end)
 
FONS_DEF int fonsTextIterNext (FONScontext *stash, FONStextIter *iter, struct FONSquad *quad)
 
FONS_DEF int fonsValidateTexture (FONScontext *s, int *dirty)
 
FONS_DEF void fonsVertMetrics (FONScontext *s, float *ascender, float *descender, float *lineh)
 

Macro Definition Documentation

◆ FONS_DEF

#define FONS_DEF   extern

Definition at line 30 of file fontstash.h.

◆ FONS_INVALID

#define FONS_INVALID   -1

Definition at line 33 of file fontstash.h.

Typedef Documentation

◆ FONScontext

typedef struct FONScontext FONScontext

Definition at line 95 of file fontstash.h.

◆ FONSparams

typedef struct FONSparams FONSparams

Definition at line 73 of file fontstash.h.

◆ FONSquad

typedef struct FONSquad FONSquad

Definition at line 80 of file fontstash.h.

◆ FONStextIter

typedef struct FONStextIter FONStextIter

Definition at line 93 of file fontstash.h.

Enumeration Type Documentation

◆ FONSalign

enum FONSalign
Enumerator
FONS_ALIGN_LEFT 
FONS_ALIGN_CENTER 
FONS_ALIGN_RIGHT 
FONS_ALIGN_TOP 
FONS_ALIGN_MIDDLE 
FONS_ALIGN_BOTTOM 
FONS_ALIGN_BASELINE 

Definition at line 40 of file fontstash.h.

◆ FONSerrorCode

Enumerator
FONS_ATLAS_FULL 
FONS_SCRATCH_FULL 
FONS_STATES_OVERFLOW 
FONS_STATES_UNDERFLOW 

Definition at line 52 of file fontstash.h.

◆ FONSflags

enum FONSflags
Enumerator
FONS_ZERO_TOPLEFT 
FONS_ZERO_BOTTOMLEFT 

Definition at line 35 of file fontstash.h.

Function Documentation

◆ fonsAddFont()

FONS_DEF int fonsAddFont ( FONScontext s,
const char *  name,
const char *  path 
)

◆ fonsAddFontMem()

FONS_DEF int fonsAddFontMem ( FONScontext s,
const char *  name,
unsigned char *  data,
int  ndata,
int  freeData 
)

Referenced by GLHelper::initFont().

Here is the caller graph for this function:

◆ fonsClearState()

FONS_DEF void fonsClearState ( FONScontext s)

◆ fonsCreateInternal()

FONS_DEF FONScontext * fonsCreateInternal ( FONSparams params)

◆ fonsDeleteInternal()

FONS_DEF void fonsDeleteInternal ( FONScontext s)

◆ fonsDrawDebug()

FONS_DEF void fonsDrawDebug ( FONScontext s,
float  x,
float  y 
)

◆ fonsDrawText()

FONS_DEF float fonsDrawText ( FONScontext s,
float  x,
float  y,
const char *  string,
const char *  end 
)

Referenced by GLHelper::drawText().

Here is the caller graph for this function:

◆ fonsExpandAtlas()

FONS_DEF int fonsExpandAtlas ( FONScontext s,
int  width,
int  height 
)

◆ fonsGetAtlasSize()

FONS_DEF void fonsGetAtlasSize ( FONScontext s,
int *  width,
int *  height 
)

◆ fonsGetFontByName()

FONS_DEF int fonsGetFontByName ( FONScontext s,
const char *  name 
)

◆ fonsGetTextureData()

FONS_DEF const unsigned char * fonsGetTextureData ( FONScontext stash,
int *  width,
int *  height 
)

◆ fonsLineBounds()

FONS_DEF void fonsLineBounds ( FONScontext s,
float  y,
float *  miny,
float *  maxy 
)

◆ fonsPopState()

FONS_DEF void fonsPopState ( FONScontext s)

◆ fonsPushState()

FONS_DEF void fonsPushState ( FONScontext s)

◆ fonsResetAtlas()

FONS_DEF int fonsResetAtlas ( FONScontext stash,
int  width,
int  height 
)

◆ fonsSetAlign()

FONS_DEF void fonsSetAlign ( FONScontext s,
int  align 
)

Referenced by GLHelper::drawText().

Here is the caller graph for this function:

◆ fonsSetBlur()

FONS_DEF void fonsSetBlur ( FONScontext s,
float  blur 
)

◆ fonsSetColor()

FONS_DEF void fonsSetColor ( FONScontext s,
unsigned int  color 
)

Referenced by GLHelper::drawText().

Here is the caller graph for this function:

◆ fonsSetErrorCallback()

FONS_DEF void fonsSetErrorCallback ( FONScontext s,
void(*)(void *uptr, int error, int val)  callback,
void *  uptr 
)

◆ fonsSetFont()

FONS_DEF void fonsSetFont ( FONScontext s,
int  font 
)

Referenced by GLHelper::initFont().

Here is the caller graph for this function:

◆ fonsSetSize()

FONS_DEF void fonsSetSize ( FONScontext s,
float  size 
)

Referenced by GLHelper::initFont().

Here is the caller graph for this function:

◆ fonsSetSpacing()

FONS_DEF void fonsSetSpacing ( FONScontext s,
float  spacing 
)

◆ fonsTextBounds()

FONS_DEF float fonsTextBounds ( FONScontext s,
float  x,
float  y,
const char *  string,
const char *  end,
float *  bounds 
)

Referenced by GLHelper::drawTextBox(), and GLHelper::getTextWidth().

Here is the caller graph for this function:

◆ fonsTextIterInit()

FONS_DEF int fonsTextIterInit ( FONScontext stash,
FONStextIter iter,
float  x,
float  y,
const char *  str,
const char *  end 
)

◆ fonsTextIterNext()

FONS_DEF int fonsTextIterNext ( FONScontext stash,
FONStextIter iter,
struct FONSquad quad 
)

◆ fonsValidateTexture()

FONS_DEF int fonsValidateTexture ( FONScontext s,
int *  dirty 
)

◆ fonsVertMetrics()

FONS_DEF void fonsVertMetrics ( FONScontext s,
float *  ascender,
float *  descender,
float *  lineh 
)