8 #ifndef __LEFONTINSTANCE_H
9 #define __LEFONTINSTANCE_H
435 static inline float fixedToFloat(
le_int32 fixed);
447 static inline le_int32 floatToFixed(
float theFloat);
515 return (
float) (fixed / 65536.0);
520 return (
le_int32) (theFloat * 65536.0);
C API: Basic definitions for the ICU LayoutEngine.
UChar32 LEUnicode32
Used to represent 32-bit Unicode code points.
LEErrorCode
Error codes returned by the LayoutEngine.
int32_t le_int32
A type used for signed, 32-bit integers.
UBool le_bool
A type used for boolean values.
UChar LEUnicode
Used to represent 16-bit Unicode code points.
le_uint32 LETag
Used for four character tags.
le_uint32 LEGlyphID
Used for glyph indices.
Instances of this class are used by LEFontInstance::mapCharsToGlyphs and LEFontInstance::mapCharToGly...
virtual LEUnicode32 mapChar(LEUnicode32 ch) const =0
This method does the adjustments.
virtual ~LECharMapper()
Destructor.
This is a virtual base class that serves as the interface between a LayoutEngine and the platform fon...
virtual const void * getFontTable(LETag tableTag, size_t &length) const =0
This method reads a table from the font.
virtual float xPixelsToUnits(float xPixels) const
This method converts pixels in the X direction to font design units.
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 float xUnitsToPoints(float xUnits) const
This method converts font design units in the X direction to points.
static UClassID getStaticClassID()
ICU "poor man's RTTI", returns a UClassID for this class.
virtual void unitsToPoints(LEPoint &units, LEPoint &points) const
This method converts font design units to points.
virtual float getYPixelsPerEm() const =0
This method returns the height of the font's EM square in pixels.
virtual void getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const =0
This method gets the X and Y advance of a particular glyph, in pixels.
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 =0
This method maps a single character to a glyph index, using the font's character to glyph map.
virtual float yUnitsToPoints(float yUnits) const
This method converts font design units in the Y direction to points.
static le_int32 floatToFixed(float theFloat)
This is a convenience method used to convert floating point values to 16.16 fixed point format.
virtual float getXPixelsPerEm() const =0
This method returns the width of the font's EM square in pixels.
virtual le_int32 getUnitsPerEM() const =0
This method returns the number of design units in the font's EM square.
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 le_int32 getDescent() const =0
Get the font's descent.
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 le_int32 getLineHeight() const
Get the line height required to display text in this font.
virtual le_bool canDisplay(LEUnicode32 ch) const
This method is used to determine if the font can render the given character.
virtual void pixelsToUnits(LEPoint &pixels, LEPoint &units) const
This method converts pixels to font design units.
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...
virtual float yPixelsToUnits(float yPixels) const
This method converts pixels in the Y direction to font design units.
virtual le_int32 getLeading() const =0
Get the font's leading.
virtual UClassID getDynamicClassID() const
ICU "poor man's RTTI", returns a UClassID for the actual class.
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 giv...
static float fixedToFloat(le_int32 fixed)
This is a convenience method used to convert values in a 16.16 fixed point format to floating point.
virtual le_int32 getAscent() const =0
Get the font's ascent.
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 ...
virtual ~LEFontInstance()
This virtual destructor is here so that the subclass destructors can be invoked through the base clas...
This class encapsulates the per-glyph storage used by the ICU LayoutEngine.
UObject is the common ICU "boilerplate" class.
Used to hold a pair of (x, y) values which represent a point.
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
#define U_LAYOUT_API
Set to export library symbols from inside the layout engine library, and to import them from outside.
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.