Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

LEFontInstance Class Reference

This is a pure virtual base class that servers as the interface between a LayoutEngine and the platform font environment. More...

#include <LEFontInstance.h>

List of all members.

Public Methods

virtual ~LEFontInstance ()
 This virtual destructor is here so that the subclass destructors can be invoked through the base class. More...

virtual const void * getFontTable (LETag tableTag) const=0
 This method reads a table from the font. More...

virtual le_bool canDisplay (LEUnicode32 ch) const=0
 This method is used to determine if the font can render the given character. More...

virtual le_int32 getUnitsPerEM () const=0
 This method returns the number of design units in the font's EM square. More...

virtual void mapCharsToGlyphs (const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, const LECharMapper *mapper, LEGlyphID glyphs[]) const=0
 This method maps an array of charcter codes to an array of glyph indices, using the font's character to glyph map. More...

virtual LEGlyphID mapCharToGlyph (LEUnicode32 ch, const LECharMapper *mapper) const=0
 This method maps a single character to a glyph index, using the font's charcter to glyph map. More...

virtual le_int32 getName (le_uint16 platformID, le_uint16 scriptID, le_uint16 languageID, le_uint16 nameID, LEUnicode *name) const=0
 This method gets a name from the font. More...

virtual void getGlyphAdvance (LEGlyphID glyph, LEPoint &advance) const=0
 This method gets the X and Y advance of a particular glyph, in pixels. More...

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. More...

virtual float getXPixelsPerEm () const=0
 This method returns the width of the font's EM square in pixels. More...

virtual float getYPixelsPerEm () const=0
 This method returns the height of the font's EM square in pixels. More...

virtual float xUnitsToPoints (float xUnits) const=0
 This method converts font design units in the X direction to points. More...

virtual float yUnitsToPoints (float yUunits) const=0
 This method converts font design units in the Y direction to points. More...

virtual void unitsToPoints (LEPoint &units, LEPoint &points) const=0
 This method converts font design units to points. More...

virtual float xPixelsToUnits (float xPixels) const=0
 This method converts pixels in the X direction to font design units. More...

virtual float yPixelsToUnits (float yPixels) const=0
 This method converts pixels in the Y direction to font design units. More...

virtual void pixelsToUnits (LEPoint &pixels, LEPoint &units) const=0
 This method converts pixels to font design units. More...

virtual void transformFunits (float xFunits, float yFunits, LEPoint &pixels) const=0
 This method transforms an X, Y point in font design units to a pixel coordinate, applying the font's transform. More...


Static Public Methods

float fixedToFloat (le_int32 fixed)
 This is a convenience method used to convert values in a 16.16 fixed point format to floating point. More...

le_int32 floatToFixed (float theFloat)
 This is a convenience method used to convert floating point values to 16.16 fixed point format. More...


Detailed Description

This is a pure virtual base class that servers as the interface between a LayoutEngine and the platform font environment.

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)

Each instance of an LEFontInstance represents a renerable instance of a font. (i.e. a single font at a particular point size, with a particular transform)

Definition at line 46 of file LEFontInstance.h.


Constructor & Destructor Documentation

virtual LEFontInstance::~LEFontInstance   [inline, virtual]
 

This virtual destructor is here so that the subclass destructors can be invoked through the base class.

Definition at line 54 of file LEFontInstance.h.


Member Function Documentation

virtual le_bool LEFontInstance::canDisplay LEUnicode32    ch const [pure virtual]
 

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.

Parameters:
ch  - the character to be tested
Returns:
true if the font can render ch.

float LEFontInstance::fixedToFloat le_int32    fixed [inline, static]
 

This is a convenience method used to convert values in a 16.16 fixed point format to floating point.

Parameters:
fixed  - the fixed point value
Returns:
the floating point value

Definition at line 244 of file LEFontInstance.h.

le_int32 LEFontInstance::floatToFixed float    theFloat [inline, static]
 

This is a convenience method used to convert floating point values to 16.16 fixed point format.

Parameters:
theFloat  - the floating point value
Returns:
the fixed point value

Definition at line 257 of file LEFontInstance.h.

virtual const void* LEFontInstance::getFontTable LETag    tableTag const [pure virtual]
 

This method reads a table from the font.

Parameters:
tableTag  - the four byte table tag
Returns:
the address of the table in memory

virtual void LEFontInstance::getGlyphAdvance LEGlyphID    glyph,
LEPoint   advance
const [pure virtual]
 

This method gets the X and Y advance of a particular glyph, in pixels.

Parameters:
glyph  - the glyph index
advance  - the X and Y pixel values will be stored here

virtual le_bool LEFontInstance::getGlyphPoint LEGlyphID    glyph,
le_int32    pointNumber,
LEPoint   point
const [pure virtual]
 

This method gets the hinted X and Y pixel coordinates of a particular point in the outline of the given glyph.

Parameters:
glyph  - the glyph index
pointNumber  - the number of the point
point  - the point's X and Y pixel values will be stored here
Returns:
true if the point coordinates could be stored.

virtual le_int32 LEFontInstance::getName le_uint16    platformID,
le_uint16    scriptID,
le_uint16    languageID,
le_uint16    nameID,
LEUnicode   name
const [pure virtual]
 

This method gets a name from the font.

(e.g. the family name) The encoding of the name is specified by the platform, the script, and the language.

Parameters:
platformID  - the platform id
scriptID  - the script id
langaugeID  - the language id
name  - the destination character array (can be null)
Returns:
the number of characters in the name

virtual le_int32 LEFontInstance::getUnitsPerEM   const [pure virtual]
 

This method returns the number of design units in the font's EM square.

Returns:
the number of design units pre EM.

virtual float LEFontInstance::getXPixelsPerEm   const [pure virtual]
 

This method returns the width of the font's EM square in pixels.

Returns:
the pixel width of the EM square

virtual float LEFontInstance::getYPixelsPerEm   const [pure virtual]
 

This method returns the height of the font's EM square in pixels.

Returns:
the pixel height of the EM square

virtual LEGlyphID LEFontInstance::mapCharToGlyph LEUnicode32    ch,
const LECharMapper   mapper
const [pure virtual]
 

This method maps a single character to a glyph index, using the font's charcter to glyph map.

Parameters:
ch  - the character
mapper  - the character mapper
Returns:
the glyph index
See also:
LECharMapper

virtual void LEFontInstance::mapCharsToGlyphs const LEUnicode    chars[],
le_int32    offset,
le_int32    count,
le_bool    reverse,
const LECharMapper   mapper,
LEGlyphID    glyphs[]
const [pure virtual]
 

This method maps an array of charcter codes to an array of glyph indices, using the font's character to glyph map.

Parameters:
chars  - the character array
offset  - the index of the first charcter
count  - the number of charcters
reverse  - if true, store the glyph indices in reverse order.
mapper  - the character mapper.
glyphs  - the output glyph array
See also:
LECharMapper

virtual void LEFontInstance::pixelsToUnits LEPoint   pixels,
LEPoint   units
const [pure virtual]
 

This method converts pixels to font design units.

Parameters:
pixels  - X and Y pixel
units  - set to X and Y font design units

virtual void LEFontInstance::transformFunits float    xFunits,
float    yFunits,
LEPoint   pixels
const [pure virtual]
 

This method transforms an X, Y point in font design units to a pixel coordinate, applying the font's transform.

Parameters:
xFunits  - the X coordinate in font design units
yFunits  - the Y coordinate in font design units
pixels  - the tranformed co-ordinate in pixels

virtual void LEFontInstance::unitsToPoints LEPoint   units,
LEPoint   points
const [pure virtual]
 

This method converts font design units to points.

Parameters:
units  - X and Y design units
points  - set to X and Y points

virtual float LEFontInstance::xPixelsToUnits float    xPixels const [pure virtual]
 

This method converts pixels in the X direction to font design units.

Parameters:
xPixels  - pixels in the X direction
Returns:
font design units in the X direction

virtual float LEFontInstance::xUnitsToPoints float    xUnits const [pure virtual]
 

This method converts font design units in the X direction to points.

Parameters:
xUnits  - design units in the X direction
Returns:
points in the X direction

virtual float LEFontInstance::yPixelsToUnits float    yPixels const [pure virtual]
 

This method converts pixels in the Y direction to font design units.

Parameters:
yPixels  - pixels in the Y direction
Returns:
font design units in the Y direction

virtual float LEFontInstance::yUnitsToPoints float    yUunits const [pure virtual]
 

This method converts font design units in the Y direction to points.

Parameters:
yUnits  - design units in the Y direction
Returns:
points in the Y direction


The documentation for this class was generated from the following file:
Generated on Tue Apr 9 11:30:38 2002 for ICU 2.1 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001