C++ bindings for cgul_bdf_glyph
More...
#include <cgul_bdf_glyph_cxx.h>
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=' ') |
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.
|
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.
[in] | src | source glyph |
References cgul_bdf_glyph__copy().
|
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.
NULL
References cgul_bdf_glyph__get_descriptive_name(), and cgul_wchar_t.
|
inline |
|
inline |
Get the ascent for the glyph. This is a value derived from the glyph's bounding box.
References cgul_bdf_glyph__get_ascent().
|
inline |
Get the descent for the glyph. This is a value derived from the glyph's bounding box.
References cgul_bdf_glyph__get_descent().
|
inline |
Get the scalable width in the x-direction.
References cgul_bdf_glyph__get_swidth_x().
|
inline |
Get the scalable width in the y-direction.
References cgul_bdf_glyph__get_swidth_y().
|
inline |
Get the device width in the x-direction.
References cgul_bdf_glyph__get_dwidth_x().
|
inline |
Get the device width in the y-direction.
References cgul_bdf_glyph__get_dwidth_y().
|
inline |
Get the width of the glyph's bounding box.
References cgul_bdf_glyph__get_bb_width().
|
inline |
Get the height of the glyph's bounding box.
References cgul_bdf_glyph__get_bb_height().
|
inline |
Get the x-offset of the lower-left corner of the glyph's bounding box.
References cgul_bdf_glyph__get_bb_x_offset().
|
inline |
Get the y-offset of the lower-left corner of the glyph's bounding box.
References cgul_bdf_glyph__get_bb_y_offset().
|
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.
[in] | x | x-coordinate |
[in] | y | y-coordinate |
References cgul_bdf_glyph__get_dot().
|
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.
References cgul_bdf_glyph__get_bytes_wide().
|
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.
[in] | s | string |
References cgul_bdf_glyph__append_bitmap_to_string(), and cgul_string_cxx::get_obj().
|
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.
[in] | f | file |
References cgul_bdf_glyph__write_file().
|
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.
[in] | f | file |
[in] | prefix | prefix for each scan line |
[in] | suffix | suffix for each scan line |
[in] | c_active | active character |
[in] | c_inactive | inactive character |
References cgul_bdf_glyph__fdraw().
|
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.
[in,out] | s | string |
[in] | prefix | prefix for each scan line |
[in] | suffix | suffix for each scan line |
[in] | c_active | active character |
[in] | c_inactive | inactive character |
References cgul_bdf_glyph__sdraw(), and cgul_string_cxx::get_obj().