#include <cnxfont.hxx>
Class defining the properties of one font.
Definition at line 70 of file cnxfont.hxx.
◆ CNxFont()
| CNxFont::CNxFont |
( |
enum nx_fontid_e |
fontid, |
|
|
nxgl_mxpixel_t |
fontColor, |
|
|
nxgl_mxpixel_t |
transparentColor |
|
) |
| |
CNxFont Constructor.
- Parameters
-
| fontid | The font ID to use. |
| fontColor | The font color to use. |
| transparentColor | The color in the font bitmap used as the background color. |
Definition at line 75 of file cnxfont.cxx.
◆ ~CNxFont()
| NXWidgets::CNxFont::~CNxFont |
( |
| ) |
|
|
inline |
◆ drawChar()
Draw an individual character of the font to the specified bitmap.
- Parameters
-
| bitmap | The bitmap to draw to. |
| letter | The character to output. |
Draw an individual character of the font to the specified bitmap.
- Parameters
-
| bitmap | The bitmap to draw use. The caller should use the getFontMetrics method to assure that the buffer will hold the font. |
| letter | The character to output. |
- Returns
- The width of the string in pixels.
Definition at line 114 of file cnxfont.cxx.
◆ getCharHeight()
| nxgl_coord_t NXWidgets::CNxFont::getCharHeight |
( |
nxwidget_char_t |
letter | ) |
const |
|
inline |
Get the height of an individual character.
- Parameters
-
| letter | The letter to get the height of. |
- Returns
- The height of the character in pixels.
◆ getCharMetrics()
| void CNxFont::getCharMetrics |
( |
nxwidget_char_t |
letter, |
|
|
FAR struct nx_fontmetric_s * |
metrics |
|
) |
| const |
Gets font metrics for a particular character
- Parameters
-
| letter | The character to get the width of. |
| metrics | The location to return the font metrics |
Definition at line 220 of file cnxfont.cxx.
◆ getCharWidth()
Get the width of an individual character.
- Parameters
-
| letter | The character to get the width of. |
- Returns
- The width of the character in pixels.
Definition at line 254 of file cnxfont.cxx.
◆ getColor()
| const nxgl_mxpixel_t NXWidgets::CNxFont::getColor |
( |
| ) |
const |
|
inline |
Gets the color currently being used as the drawing color.
- Returns
- The current drawing color.
Definition at line 115 of file cnxfont.hxx.
◆ getHeight()
| const uint8_t NXWidgets::CNxFont::getHeight |
( |
void |
| ) |
const |
|
inline |
Gets the height of the font.
- Returns
- The height of the font.
Definition at line 229 of file cnxfont.hxx.
◆ getMaxWidth()
| const uint8_t NXWidgets::CNxFont::getMaxWidth |
( |
void |
| ) |
const |
|
inline |
Gets the maximum width of the font.
- Returns
- The height of the font.
Definition at line 218 of file cnxfont.hxx.
◆ getStringWidth() [1/2]
| nxgl_coord_t CNxFont::getStringWidth |
( |
const CNxString & |
text | ) |
const |
Get the width of a string in pixels when drawn with this font.
- Parameters
-
- Returns
- The width of the string in pixels.
Definition at line 142 of file cnxfont.cxx.
◆ getStringWidth() [2/2]
| nxgl_coord_t CNxFont::getStringWidth |
( |
const CNxString & |
text, |
|
|
int |
startIndex, |
|
|
int |
length |
|
) |
| const |
Get the width of a portion of a string in pixels when drawn with this font.
- Parameters
-
| text | The string to check. |
| startIndex | The start point of the substring within the string. |
| length | The length of the substring in chars. |
- Returns
- The width of the substring in pixels.
Definition at line 182 of file cnxfont.cxx.
◆ getTransparentColor()
| const nxgl_mxpixel_t NXWidgets::CNxFont::getTransparentColor |
( |
| ) |
const |
|
inline |
Get the color currently being used as the transparent background color.
- Returns
- The transparent background color.
Definition at line 137 of file cnxfont.hxx.
◆ isCharBlank()
Checks if supplied character is blank in the current font.
- Parameters
-
| letter | The character to check. |
- Returns
- True if the glyph contains any pixels to be drawn. False if the glyph is blank.
Definition at line 93 of file cnxfont.cxx.
◆ setColor()
| void NXWidgets::CNxFont::setColor |
( |
const nxgl_mxpixel_t |
color | ) |
|
|
inline |
Sets the color to use as the drawing color. If set, this overrides the colors present in a non-monochrome font.
- Parameters
-
| color | The new drawing color. |
Definition at line 126 of file cnxfont.hxx.
◆ setTransparentColor()
| void NXWidgets::CNxFont::setTransparentColor |
( |
const nxgl_mxpixel_t |
color | ) |
|
|
inline |
Sets the transparent background color to a new value.
- Parameters
-
| color | The new background color. |
Definition at line 147 of file cnxfont.hxx.
◆ m_fontColor
| nxgl_mxpixel_t NXWidgets::CNxFont::m_fontColor |
|
private |
< The font set metrics Color to draw the font with when rendering.
Definition at line 76 of file cnxfont.hxx.
◆ m_fontHandle
| NXHANDLE NXWidgets::CNxFont::m_fontHandle |
|
private |
◆ m_fontId
| enum nx_fontid_e NXWidgets::CNxFont::m_fontId |
|
private |
◆ m_pFontSet
| FAR const struct nx_font_s* NXWidgets::CNxFont::m_pFontSet |
|
private |
◆ m_transparentColor
| nxgl_mxpixel_t NXWidgets::CNxFont::m_transparentColor |
|
private |
Background color that should not be rendered.
Definition at line 77 of file cnxfont.hxx.
The documentation for this class was generated from the following files: