Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Font Class Reference

#include <Font.h>

List of all members.

Public Types

enum  FLAGS { FONT_FIXED_PITCH = 1, FONT_ALL_CAPS = 2, FONT_NO_KERN = 4 }
enum  CHARS {
  PIPE_NBSP = 16, PIPE_VERT = 17, PIPE_LT = 18, PIPE_TEE = 19,
  PIPE_UL = 20, PIPE_LL = 21, PIPE_HORZ = 22, PIPE_PLUS = 23,
  PIPE_MINUS = 24, ARROW_UP = 25, ARROW_DOWN = 26, ARROW_LEFT = 27,
  ARROW_RIGHT = 28
}

Public Member Functions

 Font ()
 Font (const char *name)
 ~Font ()
bool Load (const char *name)
int CharWidth (char c) const
int SpaceWidth () const
int KernWidth (char left, char right) const
int StringWidth (const char *str, int len=0) const
void DrawText (const char *txt, int count, Rect &txt_rect, DWORD flags, Bitmap *tgt_bitmap=0)
int DrawString (const char *txt, int len, int x1, int y1, const Rect &clip, Bitmap *tgt_bitmap=0)
int Height () const
int Baseline () const
WORD GetFlags () const
void SetFlags (WORD s)
Color GetColor () const
void SetColor (const Color &c)
double GetExpansion () const
void SetExpansion (double e)
double GetAlpha () const
void SetAlpha (double a)
int GetBlend () const
void SetBlend (int b)
void SetKern (char left, char right, int k=0)
int GetCaretIndex () const
void SetCaretIndex (int n)

Static Public Member Functions

static const char * TYPENAME ()

Detailed Description

Definition at line 40 of file Font.h.


Member Enumeration Documentation

Enumerator:
PIPE_NBSP 
PIPE_VERT 
PIPE_LT 
PIPE_TEE 
PIPE_UL 
PIPE_LL 
PIPE_HORZ 
PIPE_PLUS 
PIPE_MINUS 
ARROW_UP 
ARROW_DOWN 
ARROW_LEFT 
ARROW_RIGHT 

Definition at line 50 of file Font.h.

Enumerator:
FONT_FIXED_PITCH 
FONT_ALL_CAPS 
FONT_NO_KERN 

Definition at line 45 of file Font.h.


Constructor & Destructor Documentation

Font::Font ( )

Definition at line 27 of file Font.cpp.

Font::Font ( const char *  name)

Definition at line 38 of file Font.cpp.

Font::~Font ( )

Definition at line 64 of file Font.cpp.


Member Function Documentation

int Font::Baseline ( ) const
inline

Definition at line 81 of file Font.h.

int Font::CharWidth ( char  c) const

Definition at line 516 of file Font.cpp.

int Font::DrawString ( const char *  txt,
int  len,
int  x1,
int  y1,
const Rect clip,
Bitmap tgt_bitmap = 0 
)

Definition at line 987 of file Font.cpp.

void Font::DrawText ( const char *  txt,
int  count,
Rect txt_rect,
DWORD  flags,
Bitmap tgt_bitmap = 0 
)

Definition at line 605 of file Font.cpp.

double Font::GetAlpha ( ) const
inline

Definition at line 88 of file Font.h.

int Font::GetBlend ( ) const
inline

Definition at line 90 of file Font.h.

int Font::GetCaretIndex ( ) const
inline

Definition at line 95 of file Font.h.

Color Font::GetColor ( ) const
inline

Definition at line 84 of file Font.h.

double Font::GetExpansion ( ) const
inline

Definition at line 86 of file Font.h.

WORD Font::GetFlags ( ) const
inline

Definition at line 82 of file Font.h.

int Font::Height ( ) const
inline

Definition at line 80 of file Font.h.

int Font::KernWidth ( char  left,
char  right 
) const

Definition at line 543 of file Font.cpp.

bool Font::Load ( const char *  name)

Definition at line 77 of file Font.cpp.

void Font::SetAlpha ( double  a)
inline

Definition at line 89 of file Font.h.

void Font::SetBlend ( int  b)
inline

Definition at line 91 of file Font.h.

void Font::SetCaretIndex ( int  n)
inline

Definition at line 96 of file Font.h.

void Font::SetColor ( const Color c)
inline

Definition at line 85 of file Font.h.

void Font::SetExpansion ( double  e)
inline

Definition at line 87 of file Font.h.

void Font::SetFlags ( WORD  s)
inline

Definition at line 83 of file Font.h.

void Font::SetKern ( char  left,
char  right,
int  k = 0 
)

Definition at line 554 of file Font.cpp.

int Font::SpaceWidth ( ) const

Definition at line 537 of file Font.cpp.

int Font::StringWidth ( const char *  str,
int  len = 0 
) const

Definition at line 570 of file Font.cpp.

static const char* Font::TYPENAME ( )
inlinestatic

Definition at line 43 of file Font.h.


The documentation for this class was generated from the following files: