Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

FontFile Class Reference

This is an abstract base class that provides the interface to reading and/or rasterizing a particular font file. More...

#include <fontFile.h>

Inheritance diagram for FontFile:

PkFontFile List of all members.

Public Member Functions

 FontFile ()
virtual ~FontFile ()
virtual bool read (const Filename &filename, bool extract_all, const string &extract_only)=0
double get_ds () const
 Returns the designed size of the font in points.

double get_dpi () const
 Returns the resolution of the rasterized font in dots per inch.

double get_vppp () const
 Returns the vertical pixels per point of the rasterized font characters.

double get_hppp () const
 Returns the horizontal pixels per point of the rasterized font characters.

void sort_chars_by_height ()
 Sorts the array of characters in the font as returned by get_char() so that the tallest ones appear first in the list.

int get_num_chars () const
 Returns the number of characters (glyphs) read from the font.

CharBitmapget_char (int n) const
 Returns the nth character (glyph) read from the font.


Protected Types

typedef pvector< CharBitmap * > Chars

Protected Attributes

double _ds
double _vppp
double _hppp
Chars _chars

Detailed Description

This is an abstract base class that provides the interface to reading and/or rasterizing a particular font file.

Definition at line 45 of file fontFile.h.


Member Typedef Documentation

typedef pvector<CharBitmap *> FontFile::Chars [protected]
 

Definition at line 67 of file fontFile.h.


Constructor & Destructor Documentation

FontFile::FontFile  ) 
 

Definition at line 47 of file fontFile.cxx.

FontFile::~FontFile  )  [virtual]
 

Definition at line 61 of file fontFile.cxx.

References _chars.


Member Function Documentation

CharBitmap * FontFile::get_char int  n  )  const [inline]
 

Returns the nth character (glyph) read from the font.

Definition at line 121 of file fontFile.I.

double FontFile::get_dpi  )  const [inline]
 

Returns the resolution of the rasterized font in dots per inch.

This is mainly useful for user information; use get_vppp() and get_hppp() for more precises measurements.

Definition at line 55 of file fontFile.I.

References _vppp.

double FontFile::get_ds  )  const [inline]
 

Returns the designed size of the font in points.

This is the basic height of a line of text in the given font.

Definition at line 36 of file fontFile.I.

References _vppp, and INLINE.

double FontFile::get_hppp  )  const [inline]
 

Returns the horizontal pixels per point of the rasterized font characters.

This is the number of pixels wide each bitmap characters is per point of font.

Definition at line 93 of file fontFile.I.

int FontFile::get_num_chars  )  const [inline]
 

Returns the number of characters (glyphs) read from the font.

Definition at line 108 of file fontFile.I.

double FontFile::get_vppp  )  const [inline]
 

Returns the vertical pixels per point of the rasterized font characters.

This is the number of pixels high each bitmap characters is per point of font.

Definition at line 74 of file fontFile.I.

References _chars, and INLINE.

virtual bool FontFile::read const Filename filename,
bool  extract_all,
const string &  extract_only
[pure virtual]
 

Implemented in PkFontFile.

void FontFile::sort_chars_by_height  ) 
 

Sorts the array of characters in the font as returned by get_char() so that the tallest ones appear first in the list.

Definition at line 77 of file fontFile.cxx.


Member Data Documentation

Chars FontFile::_chars [protected]
 

Definition at line 68 of file fontFile.h.

Referenced by get_vppp(), and ~FontFile().

double FontFile::_ds [protected]
 

Definition at line 63 of file fontFile.h.

Referenced by PkFontFile::do_xxx().

double FontFile::_hppp [protected]
 

Definition at line 65 of file fontFile.h.

Referenced by PkFontFile::do_xxx().

double FontFile::_vppp [protected]
 

Definition at line 64 of file fontFile.h.

Referenced by PkFontFile::do_xxx(), get_dpi(), and get_ds().


The documentation for this class was generated from the following files:
Generated on Fri May 2 03:27:08 2003 for Panda-Tool by doxygen1.3