Classes | Public Types | Public Member Functions

gfxGlyphExtents Class Reference

This stores glyph bounds information for a particular gfxFont, at a particular appunits-per-dev-pixel ratio (because the compressed glyph width array is stored in appunits). More...

#include <gfxFont.h>

Collaboration diagram for gfxGlyphExtents:

List of all members.

Classes

class  GlyphWidths
class  HashEntry

Public Types

enum  { INVALID_WIDTH = 0xFFFF }

Public Member Functions

 gfxGlyphExtents (PRUint32 aAppUnitsPerDevUnit)
 ~gfxGlyphExtents ()
PRUint16 GetContainedGlyphWidthAppUnits (PRUint32 aGlyphID) const
PRBool IsGlyphKnown (PRUint32 aGlyphID) const
PRBool IsGlyphKnownWithTightExtents (PRUint32 aGlyphID) const
PRBool GetTightGlyphExtentsAppUnits (gfxFont *aFont, gfxContext *aContext, PRUint32 aGlyphID, gfxRect *aExtents)
void SetContainedGlyphWidthAppUnits (PRUint32 aGlyphID, PRUint16 aWidth)
void SetTightGlyphExtents (PRUint32 aGlyphID, const gfxRect &aExtentsAppUnits)
PRUint32 GetAppUnitsPerDevUnit ()

Detailed Description

This stores glyph bounds information for a particular gfxFont, at a particular appunits-per-dev-pixel ratio (because the compressed glyph width array is stored in appunits).

We store a hashtable from glyph IDs to float bounding rects. For the common case where the glyph has no horizontal left bearing, and no y overflow above the font ascent or below the font descent, and tight bounding boxes are not required, we avoid storing the glyph ID in the hashtable and instead consult an array of 16-bit glyph XMost values (in appunits). This array always has an entry for the font's space glyph --- the width is assumed to be zero.


Member Enumeration Documentation

anonymous enum
Enumerator:
INVALID_WIDTH 

Constructor & Destructor Documentation

gfxGlyphExtents::gfxGlyphExtents ( PRUint32  aAppUnitsPerDevUnit  )  [inline]
gfxGlyphExtents::~gfxGlyphExtents (  ) 

Member Function Documentation

PRUint32 gfxGlyphExtents::GetAppUnitsPerDevUnit (  )  [inline]
PRUint16 gfxGlyphExtents::GetContainedGlyphWidthAppUnits ( PRUint32  aGlyphID  )  const [inline]
PRBool gfxGlyphExtents::GetTightGlyphExtentsAppUnits ( gfxFont aFont,
gfxContext aContext,
PRUint32  aGlyphID,
gfxRect aExtents 
)
PRBool gfxGlyphExtents::IsGlyphKnown ( PRUint32  aGlyphID  )  const [inline]
PRBool gfxGlyphExtents::IsGlyphKnownWithTightExtents ( PRUint32  aGlyphID  )  const [inline]
void gfxGlyphExtents::SetContainedGlyphWidthAppUnits ( PRUint32  aGlyphID,
PRUint16  aWidth 
) [inline]
void gfxGlyphExtents::SetTightGlyphExtents ( PRUint32  aGlyphID,
const gfxRect aExtentsAppUnits 
)

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