dvi2bitmap  dvi2bitmap1.0
Public Member Functions | Static Public Member Functions | List of all members
PkGlyph Class Reference

#include <PkFont.h>

Public Member Functions

 PkGlyph (unsigned int cc, unsigned int tfmwidth, unsigned int dm, unsigned int w, unsigned int h, int hoff, int voff, PkRasterdata *rasterdata, PkFont *f)
 Represents a single glyph in a font. More...
 
 PkGlyph (unsigned int cc, unsigned int tfmwidth, unsigned int dx, unsigned int dy, unsigned int w, unsigned int h, int hoff, int voff, PkRasterdata *rasterdata, PkFont *f)
 Represents a single glyph in a font. More...
 
 PkGlyph (int resolution, PkFont *f)
 Constructs a dummy glyph for a font. More...
 
unsigned int characterCode () const
 The character code for this glyph. More...
 
char characterChar () const
 The character which this glyph represents. More...
 
const Bytebitmap ()
 Returns the bitmap which represents this glyph. More...
 
unsigned int w () const
 Width of this character. More...
 
unsigned int h () const
 Height of this character. More...
 
int hoff () const
 Obtains the horizontal offset of the first pixel of the bitmap from the reference point for this glyph, with positive numbers indicating a rightward offset. More...
 
int voff () const
 Obtains the vertical offset of the first pixel of the bitmap from the reference point for this glyph, with positive numbers indicating a downward offset (which is rather rare, since the reference point is generally near the lower-left corner of the glyph). More...
 
double tfmWidth () const
 The glyph's width. More...
 
int hEscapement () const
 The glyph's horizontal escapement. More...
 
int vEscapement () const
 The glyph's vertical escapement. More...
 

Static Public Member Functions

static verbosities verbosity (const verbosities level)
 Sets the verbosity of this module. More...
 

Constructor & Destructor Documentation

PkGlyph::PkGlyph ( unsigned int  cc,
unsigned int  tfmwidth,
unsigned int  dm,
unsigned int  w,
unsigned int  h,
int  hoff,
int  voff,
PkRasterdata rasterdata,
PkFont f 
)

Represents a single glyph in a font.

The parameters here correspond to the parameters of the same names which are read from the PK file.

Parameters
ccthe character code of this glyph
tfmwidththe width of the character, in DVI units
dmthe horizontal escapement, in pixels; this is the number of pixels rightwards (towards increasing x) that the reference should move after this glyph is set; the vertical escapement is taken to be zero
wwidth of the bitmap in pixels
hheight of the bitmap in pixels
hoff(hoff,voff) is the position of the glyph reference point, as an offset from the top-left pixel, in units of pixels, and with right and down being positive
voffsee parameter hoff
rasterdatathe raster information for this glyph
fthe font which this glyph belongs to

References PkFont::designSize.

PkGlyph::PkGlyph ( unsigned int  cc,
unsigned int  tfmwidth,
unsigned int  dx,
unsigned int  dy,
unsigned int  w,
unsigned int  h,
int  hoff,
int  voff,
PkRasterdata rasterdata,
PkFont f 
)

Represents a single glyph in a font.

The parameters here correspond to the parameters of the same names which are read from the PK file.

Parameters
ccthe character code of this glyph
tfmwidththe width of the character, in DVI units
dxthe horizontal escapement, in pixels times 216; this defines the number of pixels rightwards (towards increasing x) that the reference should move after this glyph is set
dythe vertical escapement, in pixels times 216
wwidth of the bitmap in pixels
hheight of the bitmap in pixels
hoff(hoff,voff) is the position of the glyph reference point, as an offset from the top-left pixel, in units of pixels, and with right and down being positive
voffsee parameter hoff
rasterdatathe raster information for this glyph
fthe font which this glyph belongs to

References PkFont::designSize.

PkGlyph::PkGlyph ( int  resolution,
PkFont f 
)

Constructs a dummy glyph for a font.

Parameters
resolutionthe resolution which this glyph corresponds to
fthe font which this glyph is a member of

References PkFont::designSize.

Member Function Documentation

const Byte * PkGlyph::bitmap ( )

Returns the bitmap which represents this glyph.

This runs from the top-left of the character, with the width and height as given by methods w() and h().

Returns
the bitmap for this glyph

References PkRasterdata::bitmap().

Referenced by main().

char PkGlyph::characterChar ( ) const
inline

The character which this glyph represents.

Returns
the (ASCII) printable character which this glyph purports to represent

Referenced by main().

unsigned int PkGlyph::characterCode ( ) const
inline

The character code for this glyph.

Referenced by main().

unsigned int PkGlyph::h ( ) const
inline

Height of this character.

This is the number of columns in the bitmap returned by method bitmap()

Returns
height in device units (ie, pixels)

Referenced by main().

int PkGlyph::hEscapement ( ) const
inline

The glyph's horizontal escapement.

Returns
the escapement in pixels
int PkGlyph::hoff ( ) const
inline

Obtains the horizontal offset of the first pixel of the bitmap from the reference point for this glyph, with positive numbers indicating a rightward offset.

This is the negative of the horizontal offset of the reference point from the bitmap, as discussed in the constructor.

Returns
the offset (in pixels, with right being positive)

Referenced by main().

double PkGlyph::tfmWidth ( ) const
inline

The glyph's width.

Returns
the glyph's width in points
static verbosities PkGlyph::verbosity ( const verbosities  level)
inlinestatic

Sets the verbosity of this module.

Parameters
levelthe required verbosity
Returns
the previous verbosity level
int PkGlyph::vEscapement ( ) const
inline

The glyph's vertical escapement.

Returns
the escapement in pixels
int PkGlyph::voff ( ) const
inline

Obtains the vertical offset of the first pixel of the bitmap from the reference point for this glyph, with positive numbers indicating a downward offset (which is rather rare, since the reference point is generally near the lower-left corner of the glyph).

This is the negative of the vertical offset of the reference point from the bitmap, as discussed in the constructor.

Returns
the offset (in pixels, with down being positive)

Referenced by main().

unsigned int PkGlyph::w ( ) const
inline

Width of this character.

This is the row-length of the bitmap returned by method bitmap()

Returns
width in device units (ie, pixels)

Referenced by main().


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