DigitalSpaces::DICEGUIFont Struct Reference
[CEGUI]

#include <CEGUIInterfaces.h>

Inherits DigitalSpaces::DIObjectBase.


Public Member Functions

void load ()
 Complete font loading. If you create the font from an XML file, this method is invoked automatically after reading all the required data from the XMLAttributes object. If you create the font manually, it is your responsability to call this function as soon as you set up all the appropiate fields of the Font object.
bool isCodepointAvailable (unsigned int cp)
 Return whether this Font can draw the specified code-point.
void setNativeResolution (in_Pairf *size)
 Note: I've disabled all the drawText commands. Use a GUI Widget, please!
void notifyScreenResolution (in_Pairf *size)
 Notify the Font of the current (usually new) display resolution.
float getLineSpacing ()
 Return the pixel line spacing value for.
float getLineSpacing (float y_scale)
float getFontHeight ()
 return the exact pixel height of the font.
float getFontHeight (float y_scale)
float getBaseline ()
 Return the number of pixels from the top of the highest glyph to the baseline.
float getBaseline (float y_scale)
float getTextExtent (const char *text)
 Return the pixel width of the specified text if rendered with this Font.
float getTextExtent (const char *text, float x_scale)
unsigned long getCharAtPixel (const char *text, float pixel)
 Return the index of the closest text character in String text that corresponds to pixel location pixel if the text were rendered.
unsigned long getCharAtPixel (const char *text, float pixel, float x_scale)
unsigned long getCharAtPixel (const char *text, unsigned long start_char, float pixel)
 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.
unsigned long getCharAtPixel (const char *text, unsigned long start_char, float pixel, float x_scale)
unsigned long getFormattedLineCount (const char *text, in_Vector4f *format_area, CEGUITextFormatting fmt)
 Return the number of lines the given text would be formatted to.
unsigned long getFormattedLineCount (const char *text, in_Vector4f *format_area, CEGUITextFormatting fmt, float x_scale)
float getFormattedTextExtent (const char *text, in_Vector4f *format_area, CEGUITextFormatting fmt)
 Return the horizontal pixel extent given text would be formatted to.
float getFormattedTextExtent (const char *text, in_Vector4f *format_area, CEGUITextFormatting fmt, float x_scale)

Member Function Documentation

void DigitalSpaces::DICEGUIFont::load (  ) 

Complete font loading. If you create the font from an XML file, this method is invoked automatically after reading all the required data from the XMLAttributes object. If you create the font manually, it is your responsability to call this function as soon as you set up all the appropiate fields of the Font object.

bool DigitalSpaces::DICEGUIFont::isCodepointAvailable ( unsigned int  cp  ) 

Return whether this Font can draw the specified code-point.

Parameters:
cp utf32 code point that is the subject of the query.
Returns:
true if the font contains a mapping for code point cp, false if it does not contain a mapping for cp.

void DigitalSpaces::DICEGUIFont::setNativeResolution ( in_Pairf size  ) 

Note: I've disabled all the drawText commands. Use a GUI Widget, please!

Draw text into a specified area of the display.

Parameters:
text String object containing the text to be drawn.
draw_area Rect object describing the area of the display where the text is to be rendered. The text is not clipped to this Rect, but is formatted using this Rect depending upon the option specified in fmt.
z flat value specifying the z co-ordinate for the drawn text.
clip_rect Rect object describing the clipping area for the drawing. No drawing will occur outside this Rect.
fmt One of the TextFormatting values specifying the text formatting required.
colours ColourRect object describing the colours to be applied when drawing the text. NB: The colours specified in here are applied to each glyph, rather than the text as a whole.
x_scale Scaling factor to be applied to each glyph's x axis, where 1.0f is considered to be 'normal'.
y_scale Scaling factor to be applied to each glyph's y axis, where 1.0f is considered to be 'normal'.
Returns:
The number of lines output. NB: This does not consider clipping, so if all text was clipped, this would still return >=1.
Draw text into a specified area of the display using default colours.
Parameters:
text String object containing the text to be drawn.
draw_area Rect object describing the area of the display where the text is to be rendered. The text is not clipped to this Rect, but is formatted using this Rect depending upon the option specified in fmt.
z flat value specifying the z co-ordinate for the drawn text.
clip_rect Rect object describing the clipping area for the drawing. No drawing will occur outside this Rect.
fmt One of the TextFormatting values specifying the text formatting required.
x_scale Scaling factor to be applied to each glyph's x axis, where 1.0f is considered to be 'normal'.
y_scale Scaling factor to be applied to each glyph's y axis, where 1.0f is considered to be 'normal'.
Returns:
The number of lines output. NB: This does not consider clipping, so if all text was clipped, this would still return >=1.
Draw text into a specified area of the display with default colours and default formatting (LeftAligned).
Parameters:
text String object containing the text to be drawn.
draw_area Rect object describing the area of the display where the text is to be rendered. The text is not clipped to this Rect, but is formatted using this Rect depending upon the option specified in fmt.
z flat value specifying the z co-ordinate for the drawn text.
clip_rect Rect object describing the clipping area for the drawing. No drawing will occur outside this Rect.
x_scale Scaling factor to be applied to each glyph's x axis, where 1.0f is considered to be 'normal'.
y_scale Scaling factor to be applied to each glyph's y axis, where 1.0f is considered to be 'normal'.
Returns:
Nothing.
Draw text into a specified area of the display.
Parameters:
text String object containing the text to be drawn.
draw_area Rect object describing the area of the display where the text is to be rendered. The text is formatted using this Rect depending upon the option specified in fmt. Additionally, the drawn text is clipped to be within this Rect (applies to non-word wrapped formatting where the text may otherwise have fallen outside this Rect).
z flat value specifying the z co-ordinate for the drawn text.
fmt One of the TextFormatting values specifying the text formatting required.
colours ColourRect object describing the colours to be applied when drawing the text. NB: The colours specified in here are applied to each glyph, rather than the text as a whole.
x_scale Scaling factor to be applied to each glyph's x axis, where 1.0f is considered to be 'normal'.
y_scale Scaling factor to be applied to each glyph's y axis, where 1.0f is considered to be 'normal'.
Returns:
The number of lines output. NB: This does not consider clipping, so if all text was clipped, this would still return >=1.
Draw text into a specified area of the display with default colours.
Parameters:
text String object containing the text to be drawn.
draw_area Rect object describing the area of the display where the text is to be rendered. The text is formatted using this Rect depending upon the option specified in fmt. Additionally, the drawn text is clipped to be within this Rect (applies to non-word wrapped formatting where the text may otherwise have fallen outside this Rect).
z flat value specifying the z co-ordinate for the drawn text.
fmt One of the TextFormatting values specifying the text formatting required.
x_scale Scaling factor to be applied to each glyph's x axis, where 1.0f is considered to be 'normal'.
y_scale Scaling factor to be applied to each glyph's y axis, where 1.0f is considered to be 'normal'.
Returns:
The number of lines output. NB: This does not consider clipping, so if all text was clipped, this would still return >=1.
Draw text into a specified area of the display with default colours and default formatting (LeftAligned).
Parameters:
text String object containing the text to be drawn.
draw_area Rect object describing the area of the display where the text is to be rendered. The text is formatted using this Rect depending upon the option specified in fmt. Additionally, the drawn text is clipped to be within this Rect (applies to non-word wrapped formatting where the text may otherwise have fallen outside this Rect).
z flat value specifying the z co-ordinate for the drawn text.
x_scale Scaling factor to be applied to each glyph's x axis, where 1.0f is considered to be 'normal'.
y_scale Scaling factor to be applied to each glyph's y axis, where 1.0f is considered to be 'normal'.
Returns:
Nothing.
Draw text at the specified location.
Parameters:
text String object containing the text to be drawn.
position Vector3 object describing the location for the text. NB: The position specified here corresponds to the text baseline and not the top of any glyph. The baseline spacing required can be retrieved by calling getBaseline().
clip_rect Rect object describing the clipping area for the drawing. No drawing will occur outside this Rect.
colours ColourRect object describing the colours to be applied when drawing the text. NB: The colours specified in here are applied to each glyph, rather than the text as a whole.
x_scale Scaling factor to be applied to each glyph's x axis, where 1.0f is considered to be 'normal'.
y_scale Scaling factor to be applied to each glyph's y axis, where 1.0f is considered to be 'normal'.
Returns:
Nothing.
Draw text at the specified location with default colours.
Parameters:
text String object containing the text to be drawn.
position Vector3 object describing the location for the text. NB: The position specified here corresponds to the text baseline and not the top of any glyph. The baseline spacing required can be retrieved by calling getBaseline().
clip_rect Rect object describing the clipping area for the drawing. No drawing will occur outside this Rect.
x_scale Scaling factor to be applied to each glyph's x axis, where 1.0f is considered to be 'normal'.
y_scale Scaling factor to be applied to each glyph's y axis, where 1.0f is considered to be 'normal'.
Returns:
Nothing.
Set the native resolution for this Font
Parameters:
size Size object describing the new native screen resolution for this Font.
Returns:
Nothing

void DigitalSpaces::DICEGUIFont::notifyScreenResolution ( in_Pairf size  ) 

Notify the Font of the current (usually new) display resolution.

Parameters:
size Size object describing the display resolution
Returns:
Nothing

float DigitalSpaces::DICEGUIFont::getLineSpacing (  ) 

Return the pixel line spacing value for.

Parameters:
y_scale Scaling factor to be applied to the line spacing, where 1.0f is considered to be 'normal'.
Returns:
Number of pixels between vertical base lines, i.e. The minimum pixel space between two lines of text.

float DigitalSpaces::DICEGUIFont::getLineSpacing ( float  y_scale  ) 

float DigitalSpaces::DICEGUIFont::getFontHeight (  ) 

return the exact pixel height of the font.

Parameters:
y_scale Scaling factor to be applied to the height, where 1.0f is considered to be 'normal'.
Returns:
float value describing the pixel height of the font without any additional padding.

float DigitalSpaces::DICEGUIFont::getFontHeight ( float  y_scale  ) 

float DigitalSpaces::DICEGUIFont::getBaseline (  ) 

Return the number of pixels from the top of the highest glyph to the baseline.

Parameters:
y_scale Scaling factor to be applied to the baseline distance, where 1.0f is considered to be 'normal'.
Returns:
pixel spacing from top of front glyphs to baseline

float DigitalSpaces::DICEGUIFont::getBaseline ( float  y_scale  ) 

float DigitalSpaces::DICEGUIFont::getTextExtent ( const char *  text  ) 

Return the pixel width of the specified text if rendered with this Font.

Parameters:
text String object containing the text to return the rendered pixel width for.
x_scale Scaling factor to be applied to each glyph's x axis when measuring the extent, where 1.0f is considered to be 'normal'.
Returns:
Number of pixels that text will occupy when rendered with this Font.

float DigitalSpaces::DICEGUIFont::getTextExtent ( const char *  text,
float  x_scale 
)

unsigned long DigitalSpaces::DICEGUIFont::getCharAtPixel ( const char *  text,
float  pixel 
)

Return the index of the closest text character in String text that corresponds to pixel location pixel if the text were rendered.

Parameters:
text String object containing the text.
pixel Specifies the (horizontal) pixel offset to return the character index for.
x_scale Scaling factor to be applied to each glyph's x axis when measuring the text extent, where 1.0f is considered to be 'normal'.
Returns:
Returns a character index into String text for the character that would be rendered closest to horizontal pixel offset pixel if the text were to be rendered via this Font. Range of the return is from 0 to text.length(), so may actually return an index past the end of the string, which indicates pixel was beyond the last character.

unsigned long DigitalSpaces::DICEGUIFont::getCharAtPixel ( const char *  text,
float  pixel,
float  x_scale 
)

unsigned long DigitalSpaces::DICEGUIFont::getCharAtPixel ( const char *  text,
unsigned long  start_char,
float  pixel 
)

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.

Parameters:
text String object containing the text.
start_char index of the first character to consider. This is the lowest value that will be returned from the call.
pixel Specifies the (horizontal) pixel offset to return the character index for.
x_scale Scaling factor to be applied to each glyph's x axis when measuring the text extent, where 1.0f is considered to be 'normal'.
Returns:
Returns a character index into String text for the character that would be rendered closest to horizontal pixel offset pixel if the text were to be rendered via this Font. Range of the return is from 0 to text.length(), so may actually return an index past the end of the string, which indicates pixel was beyond the last character.

unsigned long DigitalSpaces::DICEGUIFont::getCharAtPixel ( const char *  text,
unsigned long  start_char,
float  pixel,
float  x_scale 
)

unsigned long DigitalSpaces::DICEGUIFont::getFormattedLineCount ( const char *  text,
in_Vector4f format_area,
CEGUITextFormatting  fmt 
)

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.

Parameters:
text String object containing the text to be measured.
format_area Rect object describing the area to be used when formatting the text depending upon the option specified in fmt.
fmt One of the TextFormatting values specifying the text formatting required.
x_scale Scaling factor to be applied to each glyph's x axis, where 1.0f is considered to be 'normal'.
Returns:
The number of lines produced from the specified formatting

unsigned long DigitalSpaces::DICEGUIFont::getFormattedLineCount ( const char *  text,
in_Vector4f format_area,
CEGUITextFormatting  fmt,
float  x_scale 
)

float DigitalSpaces::DICEGUIFont::getFormattedTextExtent ( const char *  text,
in_Vector4f format_area,
CEGUITextFormatting  fmt 
)

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.

Parameters:
text String object containing the text to be measured.
format_area Rect object describing the area to be used when formatting the text depending upon the option specified in fmt.
fmt One of the TextFormatting values specifying the text formatting required.
x_scale Scaling factor to be applied to each glyph's x axis, where 1.0f is considered to be 'normal'.
Returns:
The widest pixel extent of the lines produced from the specified formatting.

float DigitalSpaces::DICEGUIFont::getFormattedTextExtent ( const char *  text,
in_Vector4f format_area,
CEGUITextFormatting  fmt,
float  x_scale 
)


The documentation for this struct was generated from the following file:

Generated on Sun Aug 31 17:46:29 2008 for Digital Spaces by  doxygen 1.5.6