|
| FreeTypeFont (const String &font_name, const float point_size, const bool anti_aliased, const String &font_filename, const String &resource_group="", const bool auto_scaled=false, const float native_horz_res=640.0f, const float native_vert_res=480.0f, const float specific_line_spacing=0.0f) |
| Constructor for FreeTypeFont based fonts. More...
|
|
| ~FreeTypeFont () |
| Destructor.
|
|
float | getPointSize () const |
| return the point size of the freetype font.
|
|
bool | isAntiAliased () const |
| return whether the freetype font is rendered anti-aliased.
|
|
void | setPointSize (const float point_size) |
| return the point size of the freetype font.
|
|
void | setAntiAliased (const bool anti_alaised) |
| return whether the freetype font is rendered anti-aliased.
|
|
virtual | ~Font () |
| Destructor.
|
|
const String & | getName () const |
| Return the string holding the font name.
|
|
const String & | getTypeName () const |
| Return the type of the font.
|
|
bool | isCodepointAvailable (utf32 cp) const |
| Return whether this Font can draw the specified code-point. More...
|
|
void | drawText (GeometryBuffer &buffer, const String &text, const Vector2 &position, const Rect *clip_rect, const ColourRect &colours, const float space_extra=0.0f, const float x_scale=1.0f, const float y_scale=1.0f) |
| Draw text into a specified area of the display. More...
|
|
void | setNativeResolution (const Size &size) |
| Set the native resolution for this Font. More...
|
|
Size | getNativeResolution () const |
| Return the native display size for this Font. This is only relevant if the Font is being auto-scaled. More...
|
|
void | setAutoScaled (const bool auto_scaled) |
| Enable or disable auto-scaling for this Font. More...
|
|
bool | isAutoScaled () const |
| Return whether this Font is auto-scaled. More...
|
|
virtual void | notifyDisplaySizeChanged (const Size &size) |
| Notify the Font that the display size may have changed. More...
|
|
float | getLineSpacing (float y_scale=1.0f) const |
| Return the pixel line spacing value for. More...
|
|
float | getFontHeight (float y_scale=1.0f) const |
| return the exact pixel height of the font. More...
|
|
float | getBaseline (float y_scale=1.0f) const |
| Return the number of pixels from the top of the highest glyph to the baseline. More...
|
|
float | getTextExtent (const String &text, float x_scale=1.0f) const |
| Return the pixel width of the specified text if rendered with this Font. More...
|
|
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. More...
|
|
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. More...
|
|
void | writeXMLToStream (XMLSerializer &xml_stream) const |
| Writes an xml representation of this Font to out_stream. More...
|
|
const FontGlyph * | getGlyphData (utf32 codepoint) const |
| Return a pointer to the glyphDat struct for the given codepoint, or 0 if the codepoint does not have a glyph defined. More...
|
|
| PropertySet (void) |
| Constructs a new PropertySet object.
|
|
virtual | ~PropertySet (void) |
| Destructor for PropertySet objects.
|
|
void | addProperty (Property *property) |
| Adds a new Property to the PropertySet. More...
|
|
void | removeProperty (const String &name) |
| Removes a Property from the PropertySet. More...
|
|
void | clearProperties (void) |
| Removes all Property objects from the PropertySet. More...
|
|
bool | isPropertyPresent (const String &name) const |
| Checks to see if a Property with the given name is in the PropertySet. More...
|
|
const String & | getPropertyHelp (const String &name) const |
| Return the help text for the specified Property. More...
|
|
String | getProperty (const String &name) const |
| Gets the current value of the specified Property. More...
|
|
void | setProperty (const String &name, const String &value) |
| Sets the current value of a Property. More...
|
|
bool | isPropertyDefault (const String &name) const |
| Returns whether a Property is at it's default value. More...
|
|
String | getPropertyDefault (const String &name) const |
| Returns the default value of a Property as a String. More...
|
|
Iterator | getIterator (void) const |
| Return a PropertySet::Iterator object to iterate over the available Properties.
|
|
|
void | drawGlyphToBuffer (argb_t *buffer, uint buf_width) const |
| Copy the current glyph data into buffer, which has a width of buf_width pixels (not bytes). More...
|
|
uint | getTextureSize (CodepointMap::const_iterator s, CodepointMap::const_iterator e) const |
| Return the required texture size required to store imagery for the glyphs from s to e. More...
|
|
void | addFreeTypeFontProperties () |
| Register all properties of this class.
|
|
void | free () |
| Free all allocated font data.
|
|
void | rasterise (utf32 start_codepoint, utf32 end_codepoint) const |
| This function prepares a certain range of glyphs to be ready for displaying. This means that after returning from this function glyphs from d_cp_map[start_codepoint] to d_cp_map[end_codepoint] should have their d_image member set. If there is an error during rasterisation of some glyph, it's okay to leave the d_image field set to NULL, in which case such glyphs will be skipped from display. More...
|
|
void | updateFont () |
| Update the font as needed, according to the current parameters.
|
|
void | writeXMLToStream_impl (XMLSerializer &xml_stream) const |
| implementaion version of writeXMLToStream.
|
|
| Font (const String &name, const String &type_name, const String &filename, const String &resource_group, const bool auto_scaled, const float native_horz_res, const float native_vert_res) |
| Constructor.
|
|
void | addFontProperties () |
| Register all properties of this class.
|
|
void | setMaxCodepoint (utf32 codepoint) |
| Set the maximal glyph index. This reserves the respective number of bits in the d_glyphPageLoaded array.
|
|
Implementation of the Font class interface using the FreeType library.
This implementation tries to provide maximal support for any kind of fonts supported by FreeType. It has been tested on outline font formats like TTF and PS as well as on bitmap font formats like PCF and FON.
Glyphs are rendered dynamically on demand, so a large font with lots of glyphs won't slow application startup time.