#include <CEGUIFont.h>
Collaboration diagram for CEGUI::Font:
Public Member Functions | |
size_t | drawText (const String &text, const Rect &draw_area, float z, const Rect &clip_rect, TextFormatting fmt, const ColourRect &colours, float x_scale=1.0f, float y_scale=1.0f) const |
Draw text into a specified area of the display. | |
size_t | drawText (const String &text, const Rect &draw_area, float z, const Rect &clip_rect, TextFormatting fmt, float x_scale=1.0f, float y_scale=1.0f) const |
Draw text into a specified area of the display using default colours. | |
void | drawText (const String &text, const Rect &draw_area, float z, const Rect &clip_rect, float x_scale=1.0f, float y_scale=1.0f) const |
Draw text into a specified area of the display with default colours and default formatting (LeftAligned). | |
size_t | drawText (const String &text, const Rect &draw_area, float z, TextFormatting fmt, const ColourRect &colours, float x_scale=1.0f, float y_scale=1.0f) const |
Draw text into a specified area of the display. | |
size_t | drawText (const String &text, const Rect &draw_area, float z, TextFormatting fmt, float x_scale=1.0f, float y_scale=1.0f) const |
Draw text into a specified area of the display with default colours. | |
void | drawText (const String &text, const Rect &draw_area, float z, float x_scale=1.0f, float y_scale=1.0f) const |
Draw text into a specified area of the display with default colours and default formatting (LeftAligned). | |
void | drawText (const String &text, const Vector3 &position, const Rect &clip_rect, const ColourRect &colours, float x_scale=1.0f, float y_scale=1.0f) const |
Draw text at the specified location. | |
void | drawText (const String &text, const Vector3 &position, const Rect &clip_rect, float x_scale=1.0f, float y_scale=1.0f) const |
Draw text at the specified location with default colours. | |
void | defineFontGlyphs (const String &glyph_set) |
Define the set of code points to be renderable by the font. | |
void | defineFontGlyphs (utf32 first_code_point, utf32 last_code_point) |
Define the range of code points to be renderable by the font. | |
void | setNativeResolution (const Size &size) |
Set the native resolution for this Font. | |
void | notifyScreenResolution (const Size &size) |
Notify the Font of the current (usually new) display resolution. | |
void | setAutoScalingEnabled (bool setting) |
Enable or disable auto-scaling for this Font. | |
void | setAntiAliased (bool setting) |
Set whether the font is anti-aliased or not. Only relevant for dynamic fonts, this setting is ignored for bitmapped fonts. | |
float | getTextExtent (const String &text, float x_scale=1.0f) const |
Return the pixel width of the specified text if rendered with this Font. | |
float | getLineSpacing (float y_scale=1.0f) const |
Return the pixel line spacing value for. | |
float | getFontHeight (float y_scale=1.0f) const |
return the exact pixel height of the font. | |
float | getBaseline (float y_scale=1.0f) const |
Return the number of pixels from the top of the highest glyph to the baseline. | |
size_t | getCharAtPixel (const String &text, float pixel, float x_scale=1.0f) const |
Return the index of the closest text character in String text that corresponds to pixel location pixel if the text were rendered. | |
size_t | getCharAtPixel (const String &text, size_t start_char, float pixel, float x_scale=1.0f) const |
Return the index of the closest text character in String text, starting at character index start_char, that corresponds to pixel location pixel if the text were to be rendered. | |
const String & | getName (void) const |
Return the name of this font. | |
Size | getNativeResolution (void) const |
Return the native display size for this Font. This is only relevant if the Font is being auto-scaled. | |
bool | isAutoScaled (void) const |
Return whether this Font is auto-scaled. | |
bool | isCodepointAvailable (utf32 cp) const |
Return whether this Font can currently draw the specified code-point. | |
size_t | getFormattedLineCount (const String &text, const Rect &format_area, TextFormatting fmt, float x_scale=1.0f) const |
Return the number of lines the given text would be formatted to. | |
float | getFormattedTextExtent (const String &text, const Rect &format_area, TextFormatting fmt, float x_scale=1.0f) const |
Return the horizontal pixel extent given text would be formatted to. | |
bool | isAntiAliased (void) const |
Return whether this font is anti-aliased or not. This is only relevant for dynamic fonts created from a TrueType font file. | |
const String & | getAvailableGlyphs (void) const |
Return a String object that contains the code-points that the font is currently configured to render. | |
uint | getPointSize (void) const |
Return the point size of a dynamic (ttf based) font. | |
~Font (void) | |
Destroys a Font object. | |
Static Public Attributes | |
static const argb_t | DefaultColour = 0xFFFFFFFF |
Colour value used whenever a colour is not specified. | |
Friends | |
class | Font_xmlHandler |
class | FontManager |
Classes | |
struct | FontImplData |
struct | glyphDat |
struct to hold extra details about a glyph (required for proper rendering) |
A Font object is created for each unique typeface required. The Font class provides methods for loading typefaces from various sources, and then for outputting text via the Renderer object.
Definition at line 82 of file CEGUIFont.h.
|
Destroys a Font object.
Definition at line 153 of file CEGUIFont.cpp. |
|
Define the range of code points to be renderable by the font.
Definition at line 508 of file CEGUIFont.cpp. References defineFontGlyphs(). |
|
Define the set of code points to be renderable by the font.
Definition at line 324 of file CEGUIFont.cpp. References CEGUI::Logger::getSingleton(), CEGUI::Informative, and CEGUI::Logger::logEvent(). Referenced by defineFontGlyphs(), and CEGUI::Font_xmlHandler::elementEnd(). |
|
Draw text at the specified location with default colours.
Definition at line 342 of file CEGUIFont.h. References CEGUI::Vector3::d_x, CEGUI::Vector3::d_y, CEGUI::Vector3::d_z, and CEGUI::LeftAligned. |
|
Draw text at the specified location.
Definition at line 315 of file CEGUIFont.h. References CEGUI::Vector3::d_x, CEGUI::Vector3::d_y, CEGUI::Vector3::d_z, and CEGUI::LeftAligned. |
|
Draw text into a specified area of the display with default colours and default formatting (LeftAligned).
Definition at line 284 of file CEGUIFont.h. References CEGUI::LeftAligned. |
|
Draw text into a specified area of the display with default colours.
Definition at line 256 of file CEGUIFont.h. |
|
Draw text into a specified area of the display.
Definition at line 225 of file CEGUIFont.h. |
|
Draw text into a specified area of the display with default colours and default formatting (LeftAligned).
Definition at line 190 of file CEGUIFont.h. References CEGUI::LeftAligned. |
|
Draw text into a specified area of the display using default colours.
Definition at line 160 of file CEGUIFont.h. |
|
Draw text into a specified area of the display.
Definition at line 233 of file CEGUIFont.cpp. References ceguimax, CEGUI::Centred, CEGUI::Rect::d_bottom, CEGUI::Rect::d_left, CEGUI::Rect::d_right, CEGUI::Rect::d_top, CEGUI::String::find_first_of(), getBaseline(), getLineSpacing(), getTextExtent(), CEGUI::Rect::getWidth(), CEGUI::Justified, CEGUI::LeftAligned, CEGUI::String::length(), CEGUI::String::npos, PixelAligned, CEGUI::RightAligned, CEGUI::String::substr(), CEGUI::WordWrapCentred, CEGUI::WordWrapJustified, CEGUI::WordWrapLeftAligned, and CEGUI::WordWrapRightAligned. Referenced by CEGUI::ListboxTextItem::draw(). |
|
Return a String object that contains the code-points that the font is currently configured to render.
Definition at line 1235 of file CEGUIFont.cpp. |
|
Return the number of pixels from the top of the highest glyph to the baseline.
Definition at line 506 of file CEGUIFont.h. Referenced by CEGUI::ListboxTextItem::draw(), drawText(), and CEGUI::FontDim::getValue_impl(). |
|
Return the index of the closest text character in String text, starting at character index start_char, that corresponds to pixel location pixel if the text were to be rendered.
Definition at line 196 of file CEGUIFont.cpp. References CEGUI::String::length(). |
|
Return the index of the closest text character in String text that corresponds to pixel location pixel if the text were rendered.
Definition at line 527 of file CEGUIFont.h. Referenced by CEGUI::MultiLineEditbox::formatText(), CEGUI::MultiLineEditbox::getTextIndexFromPosition(), CEGUI::MultiLineEditbox::handleLineDown(), and CEGUI::MultiLineEditbox::handleLineUp(). |
|
return the exact pixel height of the font.
Definition at line 493 of file CEGUIFont.h. |
|
Return the number of lines the given text would be formatted to. Since text formatting can result in multiple lines of text being output, it can be useful to know how many lines would be output without actually rendering the text.
Definition at line 1035 of file CEGUIFont.cpp. References CEGUI::String::begin(), CEGUI::Centred, CEGUI::String::clear(), CEGUI::TextUtils::DefaultWhitespace, CEGUI::String::end(), CEGUI::String::find_first_not_of(), CEGUI::String::find_first_of(), getTextExtent(), CEGUI::Rect::getWidth(), CEGUI::Justified, CEGUI::LeftAligned, CEGUI::String::length(), CEGUI::String::npos, CEGUI::RightAligned, and CEGUI::String::substr(). Referenced by CEGUI::StaticText::configureScrollbars(), CEGUI::Tooltip::getTextSize(), CEGUI::StaticText::populateRenderCache(), and CEGUI::TextComponent::render_impl(). |
|
Return the horizontal pixel extent given text would be formatted to. The value return by this method is basically the extent of the widest line within the formatted text.
Definition at line 1124 of file CEGUIFont.cpp. References ceguimax, CEGUI::Centred, CEGUI::String::find_first_of(), getTextExtent(), CEGUI::Rect::getWidth(), CEGUI::Justified, CEGUI::LeftAligned, CEGUI::String::length(), CEGUI::String::npos, CEGUI::RightAligned, CEGUI::String::substr(), CEGUI::WordWrapCentred, CEGUI::WordWrapJustified, CEGUI::WordWrapLeftAligned, and CEGUI::WordWrapRightAligned. Referenced by CEGUI::StaticText::configureScrollbars(), and CEGUI::Tooltip::getTextSize(). |
|
Return the pixel line spacing value for.
Definition at line 480 of file CEGUIFont.h. Referenced by CEGUI::MultiLineEditbox::cacheTextLines(), CEGUI::StaticText::configureScrollbars(), CEGUI::MultiLineEditbox::configureScrollbars(), CEGUI::ListboxTextItem::draw(), drawText(), CEGUI::MultiLineEditbox::ensureCaratIsVisible(), CEGUI::TextItem::getItemPixelSize(), CEGUI::ListboxTextItem::getPixelSize(), CEGUI::MultiLineEditbox::getTextIndexFromPosition(), CEGUI::Tooltip::getTextSize(), CEGUI::FontDim::getValue_impl(), CEGUI::TextItem::populateRenderCache(), CEGUI::StaticText::populateRenderCache(), and CEGUI::TextComponent::render_impl(). |
|
Return the name of this font.
Definition at line 562 of file CEGUIFont.h. Referenced by CEGUI::FontManager::createFont(), CEGUI::FontManager::destroyFont(), CEGUI::WindowProperties::Font::get(), and CEGUI::Scheme::loadResources(). |
|
Return the native display size for this Font. This is only relevant if the Font is being auto-scaled.
Definition at line 572 of file CEGUIFont.h. |
|
Return the point size of a dynamic (ttf based) font.
Definition at line 1244 of file CEGUIFont.cpp. |
|
Return the pixel width of the specified text if rendered with this Font.
Definition at line 163 of file CEGUIFont.cpp. References ceguimax, and CEGUI::String::length(). Referenced by CEGUI::MultiLineEditbox::cacheTextLines(), CEGUI::TabControl::calculateTabButtonSizePosition(), drawText(), CEGUI::MultiLineEditbox::ensureCaratIsVisible(), CEGUI::MultiLineEditbox::formatText(), getFormattedLineCount(), getFormattedTextExtent(), CEGUI::TextItem::getItemPixelSize(), CEGUI::ListboxTextItem::getPixelSize(), CEGUI::FontDim::getValue_impl(), CEGUI::MultiLineEditbox::handleLineDown(), and CEGUI::MultiLineEditbox::handleLineUp(). |
|
Return whether this font is anti-aliased or not. This is only relevant for dynamic fonts created from a TrueType font file.
Definition at line 1099 of file CEGUIFont.cpp. |
|
Return whether this Font is auto-scaled.
Definition at line 582 of file CEGUIFont.h. |
|
Return whether this Font can currently draw the specified code-point.
Definition at line 595 of file CEGUIFont.h. |
|
Notify the Font of the current (usually new) display resolution.
Definition at line 935 of file CEGUIFont.cpp. References CEGUI::Size::d_height, CEGUI::Size::d_width, and CEGUI::Imageset::notifyScreenResolution(). Referenced by setNativeResolution(). |
|
Set whether the font is anti-aliased or not. Only relevant for dynamic fonts, this setting is ignored for bitmapped fonts.
Definition at line 1108 of file CEGUIFont.cpp. References CEGUI::System::getSingleton(). |
|
Enable or disable auto-scaling for this Font.
Definition at line 958 of file CEGUIFont.cpp. References CEGUI::Imageset::setAutoScalingEnabled(). Referenced by CEGUI::Font_xmlHandler::elementStart(). |
|
Set the native resolution for this Font.
Definition at line 916 of file CEGUIFont.cpp. References CEGUI::Size::d_height, CEGUI::Size::d_width, CEGUI::System::getSingleton(), notifyScreenResolution(), and CEGUI::Imageset::setNativeResolution(). Referenced by CEGUI::Font_xmlHandler::elementStart(). |
|
Definition at line 84 of file CEGUIFont.h. |
|
Definition at line 691 of file CEGUIFont.h. |
|
Colour value used whenever a colour is not specified.
Definition at line 52 of file CEGUIFont.cpp. |