TTFFont Class Reference

#include <ttfont.h>

List of all members.


Detailed Description

Definition at line 27 of file ttfont.h.


Public Member Functions

 TTFFont (char *file, int size, float wscale, float hmult)
 ~TTFFont ()
void setColor (int color)
void setColor (QColor c, kTTF_Color k=kTTF_Normal)
void setOutline (bool outline)
void setShadow (int xoff, int yoff)
bool isValid (void)
void DrawString (OSDSurface *surface, int x, int y, const QString &text, int maxx, int maxy, int alphamod=255, bool double_size=false)
void CalcWidth (const QString &text, int *width_return)
int SpaceWidth ()
int Size ()
void Reinit (float wscale, float hmult)

Private Member Functions

void KillFace (void)
void Init (void)
Raster_Mapcreate_font_raster (int width, int height)
Raster_Mapduplicate_raster (FT_BitmapGlyph bmap)
void clear_raster (Raster_Map *rmap)
void destroy_font_raster (Raster_Map *rmap)
Raster_Mapcalc_size (int *width, int *height, const QString &text, bool double_size=false)
void render_text (Raster_Map *rmap, Raster_Map *rchr, const QString &text, int *xorblah, int *yor, bool double_size=false)
void merge_text (OSDSurface *surface, Raster_Map *rmap, int offset_x, int offset_y, int xstart, int ystart, int width, int height, int alphamod, kTTF_Color k=kTTF_Normal)
bool cache_glyph (unsigned short c)

Private Attributes

bool valid
FT_Library library
FT_Face face
QMap< unsigned short, FT_Glyph > glyphs
QMap< unsigned short,
Raster_Map * > 
glyphs_cached
int max_descent
int max_ascent
int fontsize
int vid_width
int vid_height
bool use_kerning
int spacewidth
int m_size
bool m_outline
int m_shadowxoff
int m_shadowyoff
uint8_t m_color_normal_y
uint8_t m_color_normal_u
uint8_t m_color_normal_v
uint8_t m_color_outline_y
uint8_t m_color_outline_u
uint8_t m_color_outline_v
uint8_t m_color_shadow_y
uint8_t m_color_shadow_u
uint8_t m_color_shadow_v
QString m_file
int loadedfontsize
float m_wscale
float m_hmult

Constructor & Destructor Documentation

TTFFont::TTFFont ( char *  file,
int  size,
float  wscale,
float  hmult 
)

Definition at line 549 of file ttfont.cpp.

TTFFont::~TTFFont (  ) 

Definition at line 523 of file ttfont.cpp.


Member Function Documentation

void TTFFont::setColor ( int  color  ) 

void TTFFont::setColor ( QColor  c,
kTTF_Color  k = kTTF_Normal 
)

Definition at line 69 of file ttfont.cpp.

void TTFFont::setOutline ( bool  outline  )  [inline]

void TTFFont::setShadow ( int  xoff,
int  yoff 
) [inline]

bool TTFFont::isValid ( void   )  [inline]

Definition at line 42 of file ttfont.h.

Referenced by OSD::LoadFont().

void TTFFont::DrawString ( OSDSurface surface,
int  x,
int  y,
const QString &  text,
int  maxx,
int  maxy,
int  alphamod = 255,
bool  double_size = false 
)

void TTFFont::CalcWidth ( const QString &  text,
int *  width_return 
)

int TTFFont::SpaceWidth (  )  [inline]

Definition at line 49 of file ttfont.h.

Referenced by OSDTypeText::Draw().

int TTFFont::Size (  )  [inline]

void TTFFont::Reinit ( float  wscale,
float  hmult 
)

Definition at line 678 of file ttfont.cpp.

Referenced by OSD::Reinit().

void TTFFont::KillFace ( void   )  [private]

Definition at line 531 of file ttfont.cpp.

Referenced by Reinit(), and ~TTFFont().

void TTFFont::Init ( void   )  [private]

Definition at line 618 of file ttfont.cpp.

Referenced by Reinit(), and TTFFont().

Raster_Map * TTFFont::create_font_raster ( int  width,
int  height 
) [private]

Definition at line 99 of file ttfont.cpp.

Referenced by calc_size(), and DrawString().

Raster_Map * TTFFont::duplicate_raster ( FT_BitmapGlyph  bmap  )  [private]

Definition at line 123 of file ttfont.cpp.

Referenced by render_text().

void TTFFont::clear_raster ( Raster_Map rmap  )  [private]

Definition at line 145 of file ttfont.cpp.

Referenced by render_text().

void TTFFont::destroy_font_raster ( Raster_Map rmap  )  [private]

Definition at line 151 of file ttfont.cpp.

Referenced by DrawString(), and KillFace().

Raster_Map * TTFFont::calc_size ( int *  width,
int *  height,
const QString &  text,
bool  double_size = false 
) [private]

Definition at line 160 of file ttfont.cpp.

Referenced by DrawString().

void TTFFont::render_text ( Raster_Map rmap,
Raster_Map rchr,
const QString &  text,
int *  xorblah,
int *  yor,
bool  double_size = false 
) [private]

Definition at line 204 of file ttfont.cpp.

Referenced by DrawString().

void TTFFont::merge_text ( OSDSurface surface,
Raster_Map rmap,
int  offset_x,
int  offset_y,
int  xstart,
int  ystart,
int  width,
int  height,
int  alphamod,
kTTF_Color  k = kTTF_Normal 
) [private]

Definition at line 371 of file ttfont.cpp.

Referenced by DrawString().

bool TTFFont::cache_glyph ( unsigned short  c  )  [private]

Definition at line 590 of file ttfont.cpp.

Referenced by calc_size(), CalcWidth(), and Init().


Member Data Documentation

bool TTFFont::valid [private]

Definition at line 71 of file ttfont.h.

Referenced by Init(), isValid(), TTFFont(), and ~TTFFont().

FT_Library TTFFont::library [private]

Definition at line 72 of file ttfont.h.

Referenced by Init(), and TTFFont().

FT_Face TTFFont::face [private]

Definition at line 73 of file ttfont.h.

Referenced by cache_glyph(), calc_size(), Init(), KillFace(), and render_text().

QMap<unsigned short, FT_Glyph> TTFFont::glyphs [private]

Definition at line 74 of file ttfont.h.

Referenced by cache_glyph(), calc_size(), CalcWidth(), KillFace(), and render_text().

QMap<unsigned short, Raster_Map *> TTFFont::glyphs_cached [private]

Definition at line 75 of file ttfont.h.

Referenced by KillFace(), and render_text().

int TTFFont::max_descent [private]

Definition at line 76 of file ttfont.h.

Referenced by cache_glyph(), calc_size(), Init(), and render_text().

int TTFFont::max_ascent [private]

Definition at line 77 of file ttfont.h.

Referenced by cache_glyph(), calc_size(), and Init().

int TTFFont::fontsize [private]

Definition at line 78 of file ttfont.h.

Referenced by Init(), and TTFFont().

int TTFFont::vid_width [private]

Definition at line 79 of file ttfont.h.

int TTFFont::vid_height [private]

Definition at line 80 of file ttfont.h.

Definition at line 81 of file ttfont.h.

Referenced by Init(), and render_text().

int TTFFont::spacewidth [private]

Definition at line 83 of file ttfont.h.

Referenced by Init(), SpaceWidth(), and TTFFont().

int TTFFont::m_size [private]

Definition at line 84 of file ttfont.h.

Referenced by TTFFont().

Definition at line 86 of file ttfont.h.

Referenced by DrawString(), setOutline(), and TTFFont().

int TTFFont::m_shadowxoff [private]

Definition at line 87 of file ttfont.h.

Referenced by DrawString(), setShadow(), and TTFFont().

int TTFFont::m_shadowyoff [private]

Definition at line 88 of file ttfont.h.

Referenced by DrawString(), setShadow(), and TTFFont().

uint8_t TTFFont::m_color_normal_y [private]

Definition at line 90 of file ttfont.h.

Referenced by merge_text(), setColor(), and TTFFont().

uint8_t TTFFont::m_color_normal_u [private]

Definition at line 91 of file ttfont.h.

Referenced by merge_text(), setColor(), and TTFFont().

uint8_t TTFFont::m_color_normal_v [private]

Definition at line 92 of file ttfont.h.

Referenced by merge_text(), setColor(), and TTFFont().

uint8_t TTFFont::m_color_outline_y [private]

Definition at line 94 of file ttfont.h.

Referenced by merge_text(), setColor(), and TTFFont().

uint8_t TTFFont::m_color_outline_u [private]

Definition at line 95 of file ttfont.h.

Referenced by merge_text(), setColor(), and TTFFont().

uint8_t TTFFont::m_color_outline_v [private]

Definition at line 96 of file ttfont.h.

Referenced by merge_text(), setColor(), and TTFFont().

uint8_t TTFFont::m_color_shadow_y [private]

Definition at line 98 of file ttfont.h.

Referenced by merge_text(), setColor(), and TTFFont().

uint8_t TTFFont::m_color_shadow_u [private]

Definition at line 99 of file ttfont.h.

Referenced by merge_text(), setColor(), and TTFFont().

uint8_t TTFFont::m_color_shadow_v [private]

Definition at line 100 of file ttfont.h.

Referenced by merge_text(), setColor(), and TTFFont().

QString TTFFont::m_file [private]

Definition at line 102 of file ttfont.h.

Referenced by Init(), and TTFFont().

int TTFFont::loadedfontsize [private]

Definition at line 104 of file ttfont.h.

Referenced by DrawString(), Init(), and Size().

float TTFFont::m_wscale [private]

Definition at line 105 of file ttfont.h.

Referenced by Init(), Reinit(), and TTFFont().

float TTFFont::m_hmult [private]

Definition at line 106 of file ttfont.h.

Referenced by Init(), Reinit(), and TTFFont().


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

Generated on Sat Dec 18 05:16:12 2010 for MythTV by  doxygen 1.5.5