cgul_bdf_glyph_cxx Class Reference

C++ bindings for cgul_bdf_glyph More...

#include <cgul_bdf_glyph_cxx.h>

Collaboration diagram for cgul_bdf_glyph_cxx:
Collaboration graph

Public Member Functions

void copy (cgul_bdf_glyph_cxx *src)
 
const char * get_descriptive_name () const
 
cgul_wchar_t get_encoding () const
 
unsigned int get_ascent () const
 
unsigned int get_descent () const
 
unsigned int get_swidth_x () const
 
unsigned int get_swidth_y () const
 
unsigned int get_dwidth_x () const
 
unsigned int get_dwidth_y () const
 
unsigned int get_bb_width () const
 
unsigned int get_bb_height () const
 
int get_bb_x_offset () const
 
int get_bb_y_offset () const
 
int get_dot (unsigned int x, unsigned int y) const
 
size_t get_bytes_wide () const
 
void append_bitmap_to_string (const cgul_string_cxx &s)
 
void write_file (FILE *f)
 
void fdraw (FILE *f, const char *prefix=NULL, const char *suffix=NULL, char c_active=' *', char c_inactive=' ')
 
void sdraw (const cgul_string_cxx &s, const char *prefix=NULL, const char *suffix=NULL, char c_active=' *', char c_inactive=' ')
 

Detailed Description

This class provides the C++ bindings for C cgul_bdf_glyph objects. The main purpose of this class is to convert the C-style function calls and exception handling in cgul_bdf_glyph into C++-style function calls and exception handling. This class must not be extended.

Member Function Documentation

§ copy()

void cgul_bdf_glyph_cxx::copy ( cgul_bdf_glyph_cxx src)
inline

This method does a deep copy of src and stores it in this object. If an error occurs, an exception is thrown, and this object will be in an undefined state.

Parameters
[in]srcsource glyph

References cgul_bdf_glyph__copy().

§ get_descriptive_name()

const char* cgul_bdf_glyph_cxx::get_descriptive_name ( ) const
inline

This method returns the descriptive name for the character. This is the name that belongs on the STARTCHAR line. If no descriptive name is available, NULL is returned. Thus, it is important that you always check the return value. The pointer returned belongs to this class and should not be altered or freed.

Returns
descriptive name or NULL

References cgul_bdf_glyph__get_descriptive_name(), and cgul_wchar_t.

§ get_encoding()

cgul_wchar_t cgul_bdf_glyph_cxx::get_encoding ( ) const
inline

Get the encoding.

Returns
encoding

References cgul_bdf_glyph__get_encoding(), and cgul_wchar_t.

§ get_ascent()

unsigned int cgul_bdf_glyph_cxx::get_ascent ( ) const
inline

Get the ascent for the glyph. This is a value derived from the glyph's bounding box.

Returns
ascent of glyph

References cgul_bdf_glyph__get_ascent().

§ get_descent()

unsigned int cgul_bdf_glyph_cxx::get_descent ( ) const
inline

Get the descent for the glyph. This is a value derived from the glyph's bounding box.

Returns
descent of glyph

References cgul_bdf_glyph__get_descent().

§ get_swidth_x()

unsigned int cgul_bdf_glyph_cxx::get_swidth_x ( ) const
inline

Get the scalable width in the x-direction.

Returns
scalable width in the x-direction

References cgul_bdf_glyph__get_swidth_x().

§ get_swidth_y()

unsigned int cgul_bdf_glyph_cxx::get_swidth_y ( ) const
inline

Get the scalable width in the y-direction.

Returns
scalable width in the y-direction

References cgul_bdf_glyph__get_swidth_y().

§ get_dwidth_x()

unsigned int cgul_bdf_glyph_cxx::get_dwidth_x ( ) const
inline

Get the device width in the x-direction.

Returns
device width in the x-direction

References cgul_bdf_glyph__get_dwidth_x().

§ get_dwidth_y()

unsigned int cgul_bdf_glyph_cxx::get_dwidth_y ( ) const
inline

Get the device width in the y-direction.

Returns
device width in the y-direction

References cgul_bdf_glyph__get_dwidth_y().

§ get_bb_width()

unsigned int cgul_bdf_glyph_cxx::get_bb_width ( ) const
inline

Get the width of the glyph's bounding box.

Returns
width of the glyph's bounding box

References cgul_bdf_glyph__get_bb_width().

§ get_bb_height()

unsigned int cgul_bdf_glyph_cxx::get_bb_height ( ) const
inline

Get the height of the glyph's bounding box.

Returns
height of the glyph's bounding box

References cgul_bdf_glyph__get_bb_height().

§ get_bb_x_offset()

int cgul_bdf_glyph_cxx::get_bb_x_offset ( ) const
inline

Get the x-offset of the lower-left corner of the glyph's bounding box.

Returns
x-offset of the lower-left corner of the glyph's bounding box

References cgul_bdf_glyph__get_bb_x_offset().

§ get_bb_y_offset()

int cgul_bdf_glyph_cxx::get_bb_y_offset ( ) const
inline

Get the y-offset of the lower-left corner of the glyph's bounding box.

Returns
y-offset of the lower-left corner of the glyph's bounding box

References cgul_bdf_glyph__get_bb_y_offset().

§ get_dot()

int cgul_bdf_glyph_cxx::get_dot ( unsigned int  x,
unsigned int  y 
) const
inline

This method returns true if the dot at (x,y) in the glyph should be drawn. The x- and y-coordinates are relative to the top-left corner of the glyph's bounding box, not the top-left corner of the glyph itself. Also note that x and y values start with zero, not one.

Parameters
[in]xx-coordinate
[in]yy-coordinate
Returns
whether the dot should be drawn

References cgul_bdf_glyph__get_dot().

§ get_bytes_wide()

size_t cgul_bdf_glyph_cxx::get_bytes_wide ( ) const
inline

Get the width of the glyph in bytes. Remember that the data is a bitmap so it is packed with 8 pixels per byte.

Returns
width of the glyph in bytes

References cgul_bdf_glyph__get_bytes_wide().

§ append_bitmap_to_string()

void cgul_bdf_glyph_cxx::append_bitmap_to_string ( const cgul_string_cxx s)
inline

This method appends the bitmap of the glyph as a character sequence of hex digits to the string s. The appended character sequence can be used as the data in the BITMAP section of a BDF file. If an error occurs, an exception is thrown.

Parameters
[in]sstring

References cgul_bdf_glyph__append_bitmap_to_string(), and cgul_string_cxx::get_obj().

§ write_file()

void cgul_bdf_glyph_cxx::write_file ( FILE *  f)
inline

Write the string representation of the glyph to f. This is different from cgul_bdf_glyph__fdraw() in that it produces a valid snippet of BDF that can be used as the entire STARTCHAR ... ENDCHAR section.

Parameters
[in]ffile

References cgul_bdf_glyph__write_file().

§ fdraw()

void cgul_bdf_glyph_cxx::fdraw ( FILE *  f,
const char *  prefix = NULL,
const char *  suffix = NULL,
char  c_active = '*',
char  c_inactive = ' ' 
)
inline

This method appends an ASCII image of the glyph to the file f. The image only shows the part of the glyph that is in the bounding box. Each active pixel is represented by the character c_active. Each inactive pixel is represented by c_inactive. If prefix is not NULL, it will be prefixed to each scan line. If suffix is not NULL, it will be appended to each scan line. If an error occurs, an exception is thrown.

Parameters
[in]ffile
[in]prefixprefix for each scan line
[in]suffixsuffix for each scan line
[in]c_activeactive character
[in]c_inactiveinactive character

References cgul_bdf_glyph__fdraw().

§ sdraw()

void cgul_bdf_glyph_cxx::sdraw ( const cgul_string_cxx s,
const char *  prefix = NULL,
const char *  suffix = NULL,
char  c_active = '*',
char  c_inactive = ' ' 
)
inline

This method appends an ASCII image of the glyph to the string s. The image only shows the part of the glyph that is in the bounding box. Each active pixel is represented by the character c_active. Each inactive pixel is represented by c_inactive. If prefix is not NULL, it will be prefixed to each scan line. If suffix is not NULL, it will be appended to each scan line. If an error occurs, an exception is thrown.

Parameters
[in,out]sstring
[in]prefixprefix for each scan line
[in]suffixsuffix for each scan line
[in]c_activeactive character
[in]c_inactiveinactive character

References cgul_bdf_glyph__sdraw(), and cgul_string_cxx::get_obj().


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