Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | Static Private Attributes | Friends

GR_Font Class Reference

#include <gr_Graphics.h>

Inheritance diagram for GR_Font:
GR_PangoFont GR_Win32Font GR_Win32USPFont

List of all members.

Public Types

enum  FontFamilyEnum {
  FF_Unknown = 0, FF_Roman, FF_Swiss, FF_Modern,
  FF_Script, FF_Decorative, FF_Technical, FF_BiDi,
enum  FontPitchEnum { FP_Unknown = 0, FP_Fixed, FP_Variable }

Public Member Functions

virtual ~GR_Font ()
virtual const char * getFamily () const
UT_uint32 getAllocNumber () const
virtual UT_sint32 measureUnremappedCharForCache (UT_UCSChar cChar) const =0
virtual const std::string & hashKey (void) const
UT_sint32 getCharWidthFromCache (UT_UCSChar c) const
virtual GR_CharWidthsnewFontWidths (void) const
virtual bool doesGlyphExist (UT_UCS4Char g) const
virtual bool glyphBox (UT_UCS4Char g, UT_Rect &rec, GR_Graphics *pG)=0
GrFontType getType () const

Static Public Member Functions

static void s_getGenericFontProperties (const char *szFontName, FontFamilyEnum *pff, FontPitchEnum *pfp, bool *pbTrueType)
static bool s_doesGlyphExist (UT_UCS4Char g, void *instance)

Protected Member Functions

 GR_Font ()
GR_CharWidths_getCharWidths () const

Protected Attributes

std::string m_hashKey
GrFontType m_eType

Private Attributes

UT_uint32 m_iAllocNo

Static Private Attributes

static UT_uint32 s_iAllocCount = 0


class GR_Graphics
class std::map< std::string, GR_Font * >

Member Enumeration Documentation


Constructor & Destructor Documentation

GR_Font::~GR_Font (  )  [virtual]
GR_Font::GR_Font (  )  [protected]

References m_iAllocNo, and s_iAllocCount.

Member Function Documentation

GR_CharWidths* GR_Font::_getCharWidths (  )  const [inline, protected]

Reimplemented in GR_Win32Font.

Referenced by GR_Win32Font::_getCharWidths().

bool GR_Font::doesGlyphExist ( UT_UCS4Char  g  )  const [virtual]
virtual const char* GR_Font::getFamily (  )  const [inline, virtual]
GrFontType GR_Font::getType ( void   )  const [inline]
virtual bool GR_Font::glyphBox ( UT_UCS4Char  g,
UT_Rect rec,
GR_Graphics pG 
) [pure virtual]

Implemented in GR_Win32Font, and GR_PangoFont.

const std::string & GR_Font::hashKey ( void   )  const [virtual]

Return the hash key used by the cache to fetch the font This method may be overridden to compute it in real time if needed

References m_hashKey.

Referenced by fp_TextRun::_draw(), GR_CharWidthsCache::addFont(), and GR_CharWidthsCache::getWidthsForFont().

virtual UT_sint32 GR_Font::measureUnremappedCharForCache ( UT_UCSChar  cChar  )  const [pure virtual]

Measure the unremapped char to be put into the cache. That means measuring it for a font size of 120

Implemented in GR_Win32Font.

Referenced by getCharWidthFromCache().

GR_CharWidths * GR_Font::newFontWidths ( void   )  const [virtual]

Implements a GR_CharWidths. Override if you which to instanciate a subclass.

Reimplemented in GR_Win32Font.

Referenced by GR_CharWidthsCache::addFont().

static bool GR_Font::s_doesGlyphExist ( UT_UCS4Char  g,
void *  instance 
) [inline, static]
void GR_Font::s_getGenericFontProperties ( const char *  szFontName,
FontFamilyEnum pff,
FontPitchEnum pfp,
bool *  pbTrueType 
) [static]

Friends And Related Function Documentation

friend class GR_Graphics [friend]
friend class std::map< std::string, GR_Font * > [friend]

Member Data Documentation

std::string GR_Font::m_hashKey [mutable, protected]

hash key for font cache. Must be initialized in ctor otherwise override hashKey() method

Referenced by GR_Win32Font::GR_Win32Font(), and hashKey().

Referenced by GR_Font().

Referenced by getCharWidthFromCache().

UT_uint32 GR_Font::s_iAllocCount = 0 [static, private]

Referenced by GR_Font().

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