Panda3D
Public Member Functions | List of all members
PNMTextGlyph Class Reference

A single glyph in a PNMTextMaker. More...

Public Member Functions

 __init__ (const PNMTextGlyph)
 
 __init__ (double advance)
 
int getAdvance ()
 Returns the number of pixels by which the pen should be advanced after rendering this glyph. More...
 
int getBottom ()
 Returns the y coordinate of the bottommost pixel in the glyph. More...
 
int getHeight ()
 Returns the height of the glyph in pixels. More...
 
bool getInteriorFlag (int x, int y)
 Returns true if the indicated pixel represents a pixel in the interior of a hollow font, false otherwise. More...
 
int getLeft ()
 Returns the x coordinate of the leftmost pixel in the glyph. More...
 
int getRight ()
 Returns the x coordinate of the rightmost pixel in the glyph. More...
 
int getTop ()
 Returns the y coordinate of the topmost pixel in the glyph. More...
 
double getValue (int x, int y)
 Returns the value of the indicated pixel of the glyph. More...
 
int getWidth ()
 Returns the width of the glyph in pixels. More...
 
 place (PNMImage dest_image, int xp, int yp, const LColor fg)
 Copies the glyph to the indicated destination image at the indicated origin. More...
 
 place (PNMImage dest_image, int xp, int yp, const LColor fg, const LColor interior)
 This flavor of place() also fills in the interior color. More...
 

Detailed Description

A single glyph in a PNMTextMaker.

Member Function Documentation

◆ __init__() [1/2]

__init__ ( const  PNMTextGlyph)

◆ __init__() [2/2]

__init__ ( double  advance)

◆ getAdvance()

int getAdvance ( )

Returns the number of pixels by which the pen should be advanced after rendering this glyph.

◆ getBottom()

int getBottom ( )

Returns the y coordinate of the bottommost pixel in the glyph.

◆ getHeight()

int getHeight ( )

Returns the height of the glyph in pixels.

◆ getInteriorFlag()

bool getInteriorFlag ( int  x,
int  y 
)

Returns true if the indicated pixel represents a pixel in the interior of a hollow font, false otherwise.

◆ getLeft()

int getLeft ( )

Returns the x coordinate of the leftmost pixel in the glyph.

◆ getRight()

int getRight ( )

Returns the x coordinate of the rightmost pixel in the glyph.

◆ getTop()

int getTop ( )

Returns the y coordinate of the topmost pixel in the glyph.

◆ getValue()

double getValue ( int  x,
int  y 
)

Returns the value of the indicated pixel of the glyph.

The result is in the range [0, 1], where 0 indicates the pixel is not part of the glyph, and 1 indicates it is. Intermediate values are used to represent antialiasing.

◆ getWidth()

int getWidth ( )

Returns the width of the glyph in pixels.

◆ place() [1/2]

place ( PNMImage  dest_image,
int  xp,
int  yp,
const LColor  fg 
)

Copies the glyph to the indicated destination image at the indicated origin.

It colors the glyph pixels the indicated foreground color, blends antialiased pixels with the appropriate amount of the foreground color and the existing background color, and leaves other pixels alone.

◆ place() [2/2]

place ( PNMImage  dest_image,
int  xp,
int  yp,
const LColor  fg,
const LColor  interior 
)

This flavor of place() also fills in the interior color.

This requires that determine_interior was called earlier.