#include <LEFontInstance.h>
Inheritance diagram for LEFontInstance:
Public Member Functions | |
virtual | ~LEFontInstance () |
This virtual destructor is here so that the subclass destructors can be invoked through the base class. | |
virtual const LEFontInstance * | getSubFont (const LEUnicode chars[], le_int32 *offset, le_int32 limit, le_int32 script, LEErrorCode &success) const |
Get a physical font which can render the given text. | |
virtual const void * | getFontTable (LETag tableTag) const=0 |
This method reads a table from the font. | |
virtual le_bool | canDisplay (LEUnicode32 ch) const |
This method is used to determine if the font can render the given character. | |
virtual le_int32 | getUnitsPerEM () const=0 |
This method returns the number of design units in the font's EM square. | |
virtual void | mapCharsToGlyphs (const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, const LECharMapper *mapper, le_bool filterZeroWidth, LEGlyphStorage &glyphStorage) const |
This method maps an array of character codes to an array of glyph indices, using the font's character to glyph map. | |
virtual LEGlyphID | mapCharToGlyph (LEUnicode32 ch, const LECharMapper *mapper, le_bool filterZeroWidth) const |
This method maps a single character to a glyph index, using the font's character to glyph map. | |
virtual LEGlyphID | mapCharToGlyph (LEUnicode32 ch, const LECharMapper *mapper) const |
This method maps a single character to a glyph index, using the font's character to glyph map. | |
virtual LEGlyphID | mapCharToGlyph (LEUnicode32 ch) const=0 |
This method maps a single character to a glyph index, using the font's character to glyph map. | |
virtual void | getGlyphAdvance (LEGlyphID glyph, LEPoint &advance) const=0 |
This method gets the X and Y advance of a particular glyph, in pixels. | |
virtual le_bool | getGlyphPoint (LEGlyphID glyph, le_int32 pointNumber, LEPoint &point) const=0 |
This method gets the hinted X and Y pixel coordinates of a particular point in the outline of the given glyph. | |
virtual float | getXPixelsPerEm () const=0 |
This method returns the width of the font's EM square in pixels. | |
virtual float | getYPixelsPerEm () const=0 |
This method returns the height of the font's EM square in pixels. | |
virtual float | xUnitsToPoints (float xUnits) const |
This method converts font design units in the X direction to points. | |
virtual float | yUnitsToPoints (float yUnits) const |
This method converts font design units in the Y direction to points. | |
virtual void | unitsToPoints (LEPoint &units, LEPoint &points) const |
This method converts font design units to points. | |
virtual float | xPixelsToUnits (float xPixels) const |
This method converts pixels in the X direction to font design units. | |
virtual float | yPixelsToUnits (float yPixels) const |
This method converts pixels in the Y direction to font design units. | |
virtual void | pixelsToUnits (LEPoint &pixels, LEPoint &units) const |
This method converts pixels to font design units. | |
virtual float | getScaleFactorX () const=0 |
Get the X scale factor from the font's transform. | |
virtual float | getScaleFactorY () const=0 |
Get the Y scale factor from the font's transform. | |
virtual void | transformFunits (float xFunits, float yFunits, LEPoint &pixels) const |
This method transforms an X, Y point in font design units to a pixel coordinate, applying the font's transform. | |
virtual le_int32 | getAscent () const=0 |
Get the font's ascent. | |
virtual le_int32 | getDescent () const=0 |
Get the font's descent. | |
virtual le_int32 | getLeading () const=0 |
Get the font's leading. | |
virtual le_int32 | getLineHeight () const |
Get the line height required to display text in this font. | |
virtual UClassID | getDynamicClassID () const |
ICU "poor man's RTTI", returns a UClassID for the actual class. | |
Static Public Member Functions | |
float | fixedToFloat (le_int32 fixed) |
This is a convenience method used to convert values in a 16.16 fixed point format to floating point. | |
le_int32 | floatToFixed (float theFloat) |
This is a convenience method used to convert floating point values to 16.16 fixed point format. | |
UClassID | getStaticClassID () |
ICU "poor man's RTTI", returns a UClassID for this class. |
It allows a LayoutEngine to access font tables, do character to glyph mapping, and obtain metrics information without knowing any platform specific details. There are also a few utility methods for converting between points, pixels and funits. (font design units)
An instance of an LEFontInstance
represents a font at a particular point size. Each instance can represent either a single physical font, or a composite font. A composite font is a collection of physical fonts, each of which contains a subset of the characters contained in the composite font.
Note: with the exception of getSubFont
, the methods in this class only make sense for a physical font. If you have an LEFontInstance
which represents a composite font you should only call the methods below which have an LEGlyphID
, an LEUnicode
or an LEUnicode32
as one of the arguments because these can be used to select a particular subfont.
Subclasses which implement composite fonts should supply an implementation of these methods with some default behavior such as returning constant values, or using the values from the first subfont.
Definition at line 86 of file LEFontInstance.h.
|
This virtual destructor is here so that the subclass destructors can be invoked through the base class.
|
|
This method is used to determine if the font can render the given character. This can usually be done by looking the character up in the font's character to glyph mapping.
The default implementation of this method will return
|
|
This is a convenience method used to convert values in a 16.16 fixed point format to floating point.
Definition at line 550 of file LEFontInstance.h. |
|
This is a convenience method used to convert floating point values to 16.16 fixed point format.
Definition at line 555 of file LEFontInstance.h. |
|
Get the font's ascent.
Referenced by ParagraphLayout::Line::countRuns(). |
|
Get the font's descent.
Referenced by ParagraphLayout::VisualRun::getFont(). |
|
ICU "poor man's RTTI", returns a UClassID for the actual class.
Implements UObject. |
|
This method reads a table from the font.
Note that in general, it only makes sense to call this method on an
Subclasses which represent composite fonts should always return
|
|
This method gets the X and Y advance of a particular glyph, in pixels.
|
|
This method gets the hinted X and Y pixel coordinates of a particular point in the outline of the given glyph.
|
|
Get the font's leading.
Referenced by ParagraphLayout::VisualRun::getDirection(). |
|
Get the line height required to display text in this font. The default implementation of this method returns the sum of the ascent, descent, and leading.
|
|
Get the X scale factor from the font's transform.
The default implementation of
|
|
Get the Y scale factor from the font's transform.
The default implementation of
|
|
ICU "poor man's RTTI", returns a UClassID for this class.
|
|
Get a physical font which can render the given text.
For composite fonts, if there is no single physical font which can render all of the text, return a physical font which can render an initial substring of the text, and set the Internally, the LayoutEngine works with runs of text all in the same font and script, so it is best to call this method with text which is in a single script, passing the script code in as a hint. If you don't know the script of the text, you can use zero, which is the script code for characters used in more than one script.
The default implementation of this method is intended for instances of
This method will return a valid
Subclasses which implement composite fonts must override this method. Where it makes sense, they should use the script code as a hint to render characters from the COMMON script in the font which is used for the given script. For example, if the input text is a series of Arabic words separated by spaces, and the script code passed in is
|
|
This method returns the number of design units in the font's EM square.
|
|
This method returns the width of the font's EM square in pixels.
|
|
This method returns the height of the font's EM square in pixels.
|
|
This method maps an array of character codes to an array of glyph indices, using the font's character to glyph map.
The default implementation iterates over all of the characters and calls Most sublcasses will not need to implement this method.
|
|
This method maps a single character to a glyph index, using the font's character to glyph map. There is no default implementation of this method because it requires information about the platform font implementation.
|
|
This method maps a single character to a glyph index, using the font's character to glyph map.
The default implementation of this method calls the mapper, and then calls
|
|
This method maps a single character to a glyph index, using the font's character to glyph map.
The default implementation of this method calls the mapper, and then calls
|
|
This method converts pixels to font design units.
|
|
This method transforms an X, Y point in font design units to a pixel coordinate, applying the font's transform.
The default implementation of this method calls
|
|
This method converts font design units to points.
|
|
This method converts pixels in the X direction to font design units.
|
|
This method converts font design units in the X direction to points.
|
|
This method converts pixels in the Y direction to font design units.
|
|
This method converts font design units in the Y direction to points.
|