#include <CEGUIFont.h>
Collaboration diagram for CEGUI::Font:
Public Member Functions | |
uint | 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. | |
uint | 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). | |
uint | 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. | |
uint | 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. | |
uint | 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. | |
uint | getCharAtPixel (const String &text, uint 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. | |
uint | 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 | |
const uint32 | DefaultColour = 0xFFFFFFFF |
Colour value used whenever a colour is not specified. | |
Friends | |
class | Font_xmlHandler |
class | FontManager |
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 80 of file CEGUIFont.h.
|
Destroys a Font object.
Definition at line 155 of file CEGUIFont.cpp. |
|
Define the range of code points to be renderable by the font.
Definition at line 487 of file CEGUIFont.cpp. References defineFontGlyphs(), and CEGUI::utf32. |
|
Define the set of code points to be renderable by the font.
Definition at line 305 of file CEGUIFont.cpp. References CEGUI::Informative. Referenced by defineFontGlyphs(), and CEGUI::Font_xmlHandler::endElement(). |
|
Draw text at the specified location with default colours.
Definition at line 340 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 313 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 282 of file CEGUIFont.h. References CEGUI::LeftAligned. |
|
Draw text into a specified area of the display with default colours.
Definition at line 254 of file CEGUIFont.h. References CEGUI::uint. |
|
Draw text into a specified area of the display.
Definition at line 223 of file CEGUIFont.h. References CEGUI::uint. |
|
Draw text into a specified area of the display with default colours and default formatting (LeftAligned).
Definition at line 188 of file CEGUIFont.h. References CEGUI::LeftAligned. |
|
Draw text into a specified area of the display using default colours.
Definition at line 158 of file CEGUIFont.h. References CEGUI::uint. |
|
Draw text into a specified area of the display.
Definition at line 228 of file CEGUIFont.cpp. References 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::LeftAligned, CEGUI::String::length(), PixelAligned, CEGUI::RightAligned, CEGUI::String::substr(), CEGUI::uint, CEGUI::utf8, CEGUI::WordWrapCentred, CEGUI::WordWrapLeftAligned, and CEGUI::WordWrapRightAligned. Referenced by CEGUI::ListboxTextItem::draw(), CEGUI::StaticText::drawSelf(), and CEGUI::MultiLineEditbox::renderTextLines(). |
|
Return a String object that contains the code-points that the font is currently configured to render.
Definition at line 1221 of file CEGUIFont.cpp. |
|
Return the number of pixels from the top of the highest glyph to the baseline.
Definition at line 504 of file CEGUIFont.h. Referenced by CEGUI::ListboxTextItem::draw(), and drawText(). |
|
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 191 of file CEGUIFont.cpp. References CEGUI::String::end(), CEGUI::String::find(), CEGUI::String::length(), and CEGUI::uint. |
|
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 525 of file CEGUIFont.h. References CEGUI::uint. 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 491 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 1031 of file CEGUIFont.cpp. References CEGUI::String::begin(), CEGUI::String::clear(), CEGUI::String::end(), CEGUI::String::find_first_not_of(), CEGUI::String::find_first_of(), getTextExtent(), CEGUI::Rect::getWidth(), CEGUI::String::length(), CEGUI::String::substr(), and CEGUI::uint. Referenced by CEGUI::StaticText::configureScrollbars(), and CEGUI::StaticText::drawSelf(). |
|
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 1120 of file CEGUIFont.cpp. References CEGUI::Centred, CEGUI::String::find_first_of(), getTextExtent(), CEGUI::Rect::getWidth(), CEGUI::LeftAligned, CEGUI::String::length(), CEGUI::RightAligned, CEGUI::String::substr(), CEGUI::uint, CEGUI::utf8, CEGUI::WordWrapCentred, CEGUI::WordWrapLeftAligned, and CEGUI::WordWrapRightAligned. Referenced by CEGUI::StaticText::configureScrollbars(). |
|
Return the pixel line spacing value for.
Definition at line 478 of file CEGUIFont.h. Referenced by CEGUI::StaticText::configureScrollbars(), CEGUI::MultiLineEditbox::configureScrollbars(), CEGUI::ListboxTextItem::draw(), CEGUI::StaticText::drawSelf(), drawText(), CEGUI::MultiLineEditbox::ensureCaratIsVisible(), CEGUI::ListboxTextItem::getPixelSize(), CEGUI::MultiLineEditbox::getTextIndexFromPosition(), and CEGUI::MultiLineEditbox::renderTextLines(). |
|
Return the name of this font.
Definition at line 560 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 570 of file CEGUIFont.h. |
|
Return the point size of a dynamic (ttf based) font.
Definition at line 1230 of file CEGUIFont.cpp. References CEGUI::uint. |
|
Return the pixel width of the specified text if rendered with this Font.
Definition at line 165 of file CEGUIFont.cpp. References CEGUI::String::end(), CEGUI::String::find(), CEGUI::String::length(), and CEGUI::uint. Referenced by CEGUI::TabControl::calculateTabButtonSizePosition(), drawText(), CEGUI::MultiLineEditbox::ensureCaratIsVisible(), CEGUI::MultiLineEditbox::formatText(), getFormattedLineCount(), getFormattedTextExtent(), CEGUI::ListboxTextItem::getPixelSize(), CEGUI::MultiLineEditbox::handleLineDown(), CEGUI::MultiLineEditbox::handleLineUp(), and CEGUI::MultiLineEditbox::renderTextLines(). |
|
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 1095 of file CEGUIFont.cpp. |
|
Return whether this Font is auto-scaled.
Definition at line 580 of file CEGUIFont.h. |
|
Return whether this Font can currently draw the specified code-point.
Definition at line 593 of file CEGUIFont.h. Referenced by CEGUI::MultiLineEditbox::onCharacter(), and CEGUI::Editbox::onCharacter(). |
|
Notify the Font of the current (usually new) display resolution.
Definition at line 931 of file CEGUIFont.cpp. References CEGUI::Size::d_height, CEGUI::Size::d_width, and CEGUI::Imageset::notifyScreenResolution(). Referenced by CEGUI::FontManager::notifyScreenResolution(), and 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 1104 of file CEGUIFont.cpp. |
|
Enable or disable auto-scaling for this Font.
Definition at line 954 of file CEGUIFont.cpp. References CEGUI::Imageset::setAutoScalingEnabled(). Referenced by CEGUI::Font_xmlHandler::startElement(). |
|
Set the native resolution for this Font.
Definition at line 912 of file CEGUIFont.cpp. References CEGUI::Size::d_height, CEGUI::Size::d_width, notifyScreenResolution(), and CEGUI::Imageset::setNativeResolution(). Referenced by CEGUI::Font_xmlHandler::startElement(). |
|
Definition at line 82 of file CEGUIFont.h. |
|
Definition at line 689 of file CEGUIFont.h. |
|
Colour value used whenever a colour is not specified.
Definition at line 54 of file CEGUIFont.cpp. |