#include <XFuPrinter.h>
Inheritance diagram for XFuPrinter:
Public Member Functions | |
virtual void | print (XFcGLSurface *aTarget, INT32 aX, INT32 aY, const CHAR *aText, INT32 aBlendType=0, INT32 aBlendValue=0x7f, XFcRectangle *aClipRect=NULL) |
Prints a character string with the printer's font. | |
INT32 | print (XFcGLSurface *aTarget, XFcRectangle *aTargetRect, const CHAR *aText, INT32 aBlendType=0, INT32 aBlendValue=0x7f, XFcRectangle *aClipRect=NULL) |
Prints a character string with the printer's font, using target rectangle and word wrapping. | |
virtual void | stringMetrics (const CHAR *aText, INT32 &aWidth, INT32 &aHeight) |
Calculates how big an area a string would take if printed. | |
virtual INT32 | getCharWidth (CHAR aChar) |
Returns the width of a single character. | |
virtual void | setSpaceWidth (INT32 aSpacing) |
Sets the width of a space. | |
virtual void | setLetterSpacing (INT32 aSpacing) |
Sets letter spacing (i.e. extra space between characters). | |
virtual INT32 | getLetterSpacing () |
Returns the current letter spacing (i.e. extra space between characters). | |
virtual void | setLineSpacing (INT32 aSpacing) |
Sets line spacing (Y-coordinate offset from a row to the next row). | |
virtual INT32 | getLineSpacing () |
Returns the current line spacing (Y-coordinate offset from a row to the next row). | |
virtual INT32 | getLineHeight () |
Returns height of one printer line. | |
virtual | ~XFuPrinter () |
Virtual destructor. | |
Static Public Member Functions | |
XFuPrinter * | create (const CHAR *aFname) |
Creates a XFuPrinter object from an image file. | |
XFuPrinter * | create (const CHAR *aFname, INT32 aAlphamask) |
Creates a XFuPrinter object from an image file, with choise of color key value. | |
XFuPrinter * | create (const CHAR *aFname, INT32 aAlphamask, REAL aXScale, REAL aYScale) |
Creates a XFuPrinter object from an image file, with choise of color key value and scale. | |
Protected Member Functions | |
XFuPrinter () | |
Protected constructor. | |
Protected Attributes | |
INT32 | mMaxletter |
Maximum letter in the font. | |
XFcGLSurface ** | mLetter |
Array of XFcGLSurfaces. | |
INT32 | mLetterSpacing |
Current letter spacing. | |
INT32 | mLineSpacing |
Current line spacing. | |
INT32 | mLineHeight |
Line height. | |
INT32 | mSpaceWidth |
Width of space character. |
This class loads a single image file and creates as many XFcGLSurface objects as the font has characters. The image file must have all of its characters in ASCII order starting from character 33 (the exclamation mark, "!"). The image file must be as wide as a single character is high, i.e. for a 8x8 font with 20 characters and one character, the image dimensions would be 8x160.
Definition at line 24 of file XFuPrinter.h.
|
Virtual destructor.
Definition at line 415 of file XFuPrinter.cpp. References mLetter, and mMaxletter. |
|
Protected constructor.
Definition at line 427 of file XFuPrinter.cpp. References mLetter. Referenced by create(). |
|
Creates a XFuPrinter object from an image file, with choise of color key value and scale.
Definition at line 31 of file XFuPrinter.cpp. References mLetter, mLetterSpacing, mLineHeight, mLineSpacing, mMaxletter, mSpaceWidth, TORGB16, and XFuPrinter(). |
|
Creates a XFuPrinter object from an image file, with choise of color key value. aAlphamask is the color key value.
Definition at line 26 of file XFuPrinter.cpp. References create(). |
|
Creates a XFuPrinter object from an image file.
Reimplemented in XFuRLESpritePrinter. Definition at line 21 of file XFuPrinter.cpp. Referenced by create(), and XFuConfigurationData::loadPrinter(). |
|
Returns the width of a single character.
Reimplemented in XFuRLESpritePrinter. Definition at line 367 of file XFuPrinter.cpp. References mLetter, mMaxletter, and mSpaceWidth. |
|
Returns the current letter spacing (i.e. extra space between characters).
Definition at line 385 of file XFuPrinter.cpp. References mLetterSpacing. |
|
Returns height of one printer line.
Definition at line 403 of file XFuPrinter.cpp. References mLineHeight. |
|
Returns the current line spacing (Y-coordinate offset from a row to the next row).
Definition at line 397 of file XFuPrinter.cpp. References mLineSpacing. |
|
Prints a character string with the printer's font, using target rectangle and word wrapping. If the string contains words that are wider than the rectangle, the words are printed on a new line (no inter-word chopping is performed). If the aTargetRect is NULL, the whole surface is used. This function uses print() and stringmetrics() internally, so it will also work with rlespriteprinter.
Definition at line 145 of file XFuPrinter.cpp. References mLetterSpacing, mLineHeight, mLineSpacing, mSpaceWidth, print(), and stringMetrics(). |
|
Prints a character string with the printer's font. String is printed to a target surface with optional blending and clipping rectangle. Reimplemented in XFuRLESpritePrinter. Definition at line 243 of file XFuPrinter.cpp. References mLetter, mLetterSpacing, mLineHeight, mLineSpacing, mMaxletter, and mSpaceWidth. Referenced by print(). |
|
Sets letter spacing (i.e. extra space between characters).
Definition at line 379 of file XFuPrinter.cpp. References mLetterSpacing. Referenced by XFuConfigurationData::loadPrinter(). |
|
Sets line spacing (Y-coordinate offset from a row to the next row).
Definition at line 391 of file XFuPrinter.cpp. References mLineSpacing. |
|
Sets the width of a space.
Definition at line 409 of file XFuPrinter.cpp. References mSpaceWidth. |
|
Calculates how big an area a string would take if printed.
Reimplemented in XFuRLESpritePrinter. Definition at line 323 of file XFuPrinter.cpp. References mLetter, mLetterSpacing, mLineHeight, mLineSpacing, mMaxletter, and mSpaceWidth. Referenced by print(). |
|
Array of XFcGLSurfaces.
Definition at line 77 of file XFuPrinter.h. Referenced by create(), getCharWidth(), print(), stringMetrics(), XFuPrinter(), and ~XFuPrinter(). |
|
Current letter spacing.
Definition at line 78 of file XFuPrinter.h. Referenced by XFuRLESpritePrinter::create(), create(), getLetterSpacing(), XFuRLESpritePrinter::print(), print(), setLetterSpacing(), XFuRLESpritePrinter::stringMetrics(), and stringMetrics(). |
|
Line height.
Definition at line 80 of file XFuPrinter.h. Referenced by XFuRLESpritePrinter::create(), create(), getLineHeight(), print(), XFuRLESpritePrinter::stringMetrics(), and stringMetrics(). |
|
Current line spacing.
Definition at line 79 of file XFuPrinter.h. Referenced by XFuRLESpritePrinter::create(), create(), getLineSpacing(), XFuRLESpritePrinter::print(), print(), setLineSpacing(), XFuRLESpritePrinter::stringMetrics(), and stringMetrics(). |
|
Maximum letter in the font.
Definition at line 76 of file XFuPrinter.h. Referenced by XFuRLESpritePrinter::create(), create(), XFuRLESpritePrinter::getCharWidth(), getCharWidth(), XFuRLESpritePrinter::print(), print(), XFuRLESpritePrinter::stringMetrics(), stringMetrics(), ~XFuPrinter(), and XFuRLESpritePrinter::~XFuRLESpritePrinter(). |
|
Width of space character.
Definition at line 81 of file XFuPrinter.h. Referenced by XFuRLESpritePrinter::create(), create(), XFuRLESpritePrinter::getCharWidth(), getCharWidth(), XFuRLESpritePrinter::print(), print(), setSpaceWidth(), XFuRLESpritePrinter::stringMetrics(), and stringMetrics(). |
![]() | ||||
![]() |
Confidential Copyright © 2002-2003 Fathammer | with doxygen by Dimitri van Heesch |