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

PkFontFile Class Reference

A specialization on FontFile for reading TeX-style .pk fonts. More...

#include <pkFontFile.h>

Inheritance diagram for PkFontFile:

FontFile List of all members.

Public Member Functions

 PkFontFile ()
virtual bool read (const Filename &filename, bool extract_all, const string &extract_only)
 Attempts to read the font from the indicated file.

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

Private Member Functions

unsigned int fetch_nibble ()
 Returns the next 4-bit nibble from the pk stream.

unsigned int fetch_packed_int ()
 Returns the next packed integer from the pk stream.

unsigned int fetch_byte ()
 Returns the next 8-bit unsigned byte from the pk stream.

unsigned int fetch_int (int n=4)
 Returns the next n-byte unsigned int from the pk stream.

int fetch_signed_int (int n=4)
 Returns the next n-byte signed int from the pk stream.

bool do_character (int flag_byte)
 Reads a single character from the pk file and processes it.

void do_xxx (int num_bytes)
 The xxx1 ..

void do_yyy ()
 The yyy command is an encoded number which might have meaning to a preceding xxx block, but means nothing to us.

void do_post ()
 The beginning of the postamble.

void do_pre ()
 The preamble.

bool read_pk ()

Private Attributes

bool _post
bool _post_warning
int _p
bool _high
int _dyn_f
int _repeat_count
bool _extract_all
string _extract_only
pvector< unsigned char > _pk

Detailed Description

A specialization on FontFile for reading TeX-style .pk fonts.

Definition at line 38 of file pkFontFile.h.


Member Typedef Documentation

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

Definition at line 67 of file fontFile.h.


Constructor & Destructor Documentation

PkFontFile::PkFontFile  ) 
 

Definition at line 506 of file pkFontFile.cxx.

References Filename::open_read(), and Filename::set_binary().


Member Function Documentation

bool PkFontFile::do_character int  flag_byte  )  [private]
 

Reads a single character from the pk file and processes it.

Returns true if successful, false if something bad happened.

Definition at line 691 of file pkFontFile.cxx.

void PkFontFile::do_post  )  [private]
 

The beginning of the postamble.

Definition at line 853 of file pkFontFile.cxx.

void PkFontFile::do_pre  )  [private]
 

The preamble.

Definition at line 866 of file pkFontFile.cxx.

References _post, _post_warning, nout, and PK_NO_OP.

void PkFontFile::do_xxx int  num_bytes  )  [private]
 

The xxx1 ..

xxx4 series of commands specify an embedded comment or some such silliness in the pk file that must be skipped.

Definition at line 823 of file pkFontFile.cxx.

References FontFile::_ds, FontFile::_hppp, _p, _pk, FontFile::_vppp, and nout.

void PkFontFile::do_yyy  )  [private]
 

The yyy command is an encoded number which might have meaning to a preceding xxx block, but means nothing to us.

Definition at line 840 of file pkFontFile.cxx.

unsigned int PkFontFile::fetch_byte  )  [private]
 

Returns the next 8-bit unsigned byte from the pk stream.

Definition at line 621 of file pkFontFile.cxx.

References _p.

unsigned int PkFontFile::fetch_int int  n = 4  )  [private]
 

Returns the next n-byte unsigned int from the pk stream.

Definition at line 638 of file pkFontFile.cxx.

References _p, and _pk.

Referenced by fetch_signed_int().

unsigned int PkFontFile::fetch_nibble  )  [private]
 

Returns the next 4-bit nibble from the pk stream.

Definition at line 559 of file pkFontFile.cxx.

References _dyn_f.

unsigned int PkFontFile::fetch_packed_int  )  [private]
 

Returns the next packed integer from the pk stream.

Definition at line 580 of file pkFontFile.cxx.

int PkFontFile::fetch_signed_int int  n = 4  )  [private]
 

Returns the next n-byte signed int from the pk stream.

Definition at line 662 of file pkFontFile.cxx.

References _p, and fetch_int().

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

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

Definition at line 121 of file fontFile.I.

double FontFile::get_dpi  )  const [inline, inherited]
 

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 FontFile::_vppp.

double FontFile::get_ds  )  const [inline, inherited]
 

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 FontFile::_vppp, and INLINE.

double FontFile::get_hppp  )  const [inline, inherited]
 

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, inherited]
 

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

Definition at line 108 of file fontFile.I.

double FontFile::get_vppp  )  const [inline, inherited]
 

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 FontFile::_chars, and INLINE.

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

Attempts to read the font from the indicated file.

Returns true if successful, false if there is an error.

Implements FontFile.

Definition at line 522 of file pkFontFile.cxx.

References _pk.

bool PkFontFile::read_pk  )  [private]
 

Definition at line 901 of file pkFontFile.cxx.

References nout.

void FontFile::sort_chars_by_height  )  [inherited]
 

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, inherited]
 

Definition at line 68 of file fontFile.h.

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

double FontFile::_ds [protected, inherited]
 

Definition at line 63 of file fontFile.h.

Referenced by do_xxx().

int PkFontFile::_dyn_f [private]
 

Definition at line 62 of file pkFontFile.h.

Referenced by fetch_nibble().

bool PkFontFile::_extract_all [private]
 

Definition at line 65 of file pkFontFile.h.

string PkFontFile::_extract_only [private]
 

Definition at line 66 of file pkFontFile.h.

bool PkFontFile::_high [private]
 

Definition at line 61 of file pkFontFile.h.

double FontFile::_hppp [protected, inherited]
 

Definition at line 65 of file fontFile.h.

Referenced by do_xxx().

int PkFontFile::_p [private]
 

Definition at line 60 of file pkFontFile.h.

Referenced by do_xxx(), fetch_byte(), fetch_int(), and fetch_signed_int().

pvector<unsigned char> PkFontFile::_pk [private]
 

Definition at line 68 of file pkFontFile.h.

Referenced by do_xxx(), fetch_int(), and read().

bool PkFontFile::_post [private]
 

Definition at line 58 of file pkFontFile.h.

Referenced by do_pre().

bool PkFontFile::_post_warning [private]
 

Definition at line 59 of file pkFontFile.h.

Referenced by do_pre().

int PkFontFile::_repeat_count [private]
 

Definition at line 63 of file pkFontFile.h.

double FontFile::_vppp [protected, inherited]
 

Definition at line 64 of file fontFile.h.

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


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