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

gfxFontGroup Class Reference

#include <gfxFont.h>

Inheritance diagram for gfxFontGroup:
Collaboration diagram for gfxFontGroup:

List of all members.

Public Types

enum  { UNDERLINE_OFFSET_NOT_SET = 32767 }
typedef PRBool(* FontCreationCallback )(const nsAString &aName, const nsACString &aGenericName, void *closure)

Public Member Functions

 gfxFontGroup (const nsAString &aFamilies, const gfxFontStyle *aStyle, gfxUserFontSet *aUserFontSet=0L)
virtual ~gfxFontGroup ()
virtual gfxFontGetFontAt (PRInt32 i)
virtual PRUint32 FontListLength () const
PRBool Equals (const gfxFontGroup &other) const
const gfxFontStyleGetStyle () const
virtual gfxFontGroupCopy (const gfxFontStyle *aStyle)
gfxTextRunMakeEmptyTextRun (const Parameters *aParams, PRUint32 aFlags)
 Make a textrun for an empty string.
gfxTextRunMakeSpaceTextRun (const Parameters *aParams, PRUint32 aFlags)
 Make a textrun for a single ASCII space.
virtual gfxTextRunMakeTextRun (const PRUnichar *aString, PRUint32 aLength, const Parameters *aParams, PRUint32 aFlags)
 Make a textrun for a given string.
virtual gfxTextRunMakeTextRun (const PRUint8 *aString, PRUint32 aLength, const Parameters *aParams, PRUint32 aFlags)
 Make a textrun for a given string.
PRBool ForEachFont (const nsAString &aFamilies, nsIAtom *aLanguage, FontCreationCallback fc, void *closure)
PRBool ForEachFont (FontCreationCallback fc, void *closure)
PRBool HasFont (const gfxFontEntry *aFontEntry)
 Check whether a given font (specified by its gfxFontEntry) is already in the fontgroup's list of actual fonts.
const nsString_externalGetFamilies ()
virtual gfxFloat GetUnderlineOffset ()
virtual already_AddRefed< gfxFontFindFontForChar (PRUint32 ch, PRUint32 prevCh, PRInt32 aRunScript, gfxFont *aPrevMatchedFont)
virtual already_AddRefed< gfxFontWhichPrefFontSupportsChar (PRUint32 aCh)
virtual already_AddRefed< gfxFontWhichSystemFontSupportsChar (PRUint32 aCh)
void ComputeRanges (nsTArray< gfxTextRange > &mRanges, const PRUnichar *aString, PRUint32 begin, PRUint32 end, PRInt32 aRunScript)
gfxUserFontSetGetUserFontSet ()
PRUint64 GetGeneration ()
virtual void UpdateFontList ()

Static Public Member Functions

static void Shutdown ()
static PRBool IsInvalidChar (PRUnichar ch)
 The listed characters should not be passed in to MakeTextRun and should be treated as invisible and zero-width.

Protected Member Functions

void SetUserFontSet (gfxUserFontSet *aUserFontSet)
void BuildFontList ()
void InitMetricsForBadFont (gfxFont *aBadFont)
void InitTextRun (gfxContext *aContext, gfxTextRun *aTextRun, const PRUnichar *aString, PRUint32 aLength)
void InitScriptRun (gfxContext *aContext, gfxTextRun *aTextRun, const PRUnichar *aString, PRUint32 aTotalLength, PRUint32 aScriptRunStart, PRUint32 aScriptRunEnd, PRInt32 aRunScript)
PRBool ForEachFontInternal (const nsAString &aFamilies, nsIAtom *aLanguage, PRBool aResolveGeneric, PRBool aResolveFontName, FontCreationCallback fc, void *closure)

Static Protected Member Functions

static PRBool FontResolverProc (const nsAString &aName, void *aClosure)
static PRBool FindPlatformFont (const nsAString &aName, const nsACString &aGenericName, void *closure)

Protected Attributes

nsString_external mFamilies
gfxFontStyle mStyle
nsTArray< nsRefPtr< gfxFont > > mFonts
gfxFloat mUnderlineOffset
gfxUserFontSetmUserFontSet
PRUint64 mCurrGeneration
nsRefPtr< gfxFontFamilymLastPrefFamily
nsRefPtr< gfxFontmLastPrefFont
eFontPrefLang mLastPrefLang
PRBool mLastPrefFirstFont
eFontPrefLang mPageLang

Static Protected Attributes

static nsILanguageAtomService * gLangService

Member Typedef Documentation

typedef PRBool(* gfxFontGroup::FontCreationCallback)(const nsAString &aName, const nsACString &aGenericName, void *closure)

Member Enumeration Documentation

anonymous enum
Enumerator:
UNDERLINE_OFFSET_NOT_SET 

Constructor & Destructor Documentation

gfxFontGroup::gfxFontGroup ( const nsAString aFamilies,
const gfxFontStyle aStyle,
gfxUserFontSet aUserFontSet = 0L 
)
virtual gfxFontGroup::~gfxFontGroup (  )  [virtual]

Member Function Documentation

void gfxFontGroup::BuildFontList (  )  [protected]
void gfxFontGroup::ComputeRanges ( nsTArray< gfxTextRange > &  mRanges,
const PRUnichar aString,
PRUint32  begin,
PRUint32  end,
PRInt32  aRunScript 
)
virtual gfxFontGroup* gfxFontGroup::Copy ( const gfxFontStyle aStyle  )  [virtual]

Reimplemented in gfxPangoFontGroup.

PRBool gfxFontGroup::Equals ( const gfxFontGroup other  )  const [inline]
virtual already_AddRefed<gfxFont> gfxFontGroup::FindFontForChar ( PRUint32  ch,
PRUint32  prevCh,
PRInt32  aRunScript,
gfxFont aPrevMatchedFont 
) [virtual]

Reimplemented in gfxPangoFontGroup.

static PRBool gfxFontGroup::FindPlatformFont ( const nsAString aName,
const nsACString aGenericName,
void *  closure 
) [static, protected]
virtual PRUint32 gfxFontGroup::FontListLength (  )  const [inline, virtual]
static PRBool gfxFontGroup::FontResolverProc ( const nsAString aName,
void *  aClosure 
) [static, protected]
PRBool gfxFontGroup::ForEachFont ( const nsAString aFamilies,
nsIAtom aLanguage,
FontCreationCallback  fc,
void *  closure 
)
PRBool gfxFontGroup::ForEachFont ( FontCreationCallback  fc,
void *  closure 
)
PRBool gfxFontGroup::ForEachFontInternal ( const nsAString aFamilies,
nsIAtom aLanguage,
PRBool  aResolveGeneric,
PRBool  aResolveFontName,
FontCreationCallback  fc,
void *  closure 
) [protected]
const nsString_external& gfxFontGroup::GetFamilies (  )  [inline]
virtual gfxFont* gfxFontGroup::GetFontAt ( PRInt32  i  )  [inline, virtual]

Reimplemented in gfxPangoFontGroup.

PRUint64 gfxFontGroup::GetGeneration (  ) 
const gfxFontStyle* gfxFontGroup::GetStyle (  )  const [inline]
virtual gfxFloat gfxFontGroup::GetUnderlineOffset (  )  [inline, virtual]
gfxUserFontSet* gfxFontGroup::GetUserFontSet (  ) 
PRBool gfxFontGroup::HasFont ( const gfxFontEntry aFontEntry  ) 

Check whether a given font (specified by its gfxFontEntry) is already in the fontgroup's list of actual fonts.

void gfxFontGroup::InitMetricsForBadFont ( gfxFont aBadFont  )  [protected]
void gfxFontGroup::InitScriptRun ( gfxContext aContext,
gfxTextRun aTextRun,
const PRUnichar aString,
PRUint32  aTotalLength,
PRUint32  aScriptRunStart,
PRUint32  aScriptRunEnd,
PRInt32  aRunScript 
) [protected]
void gfxFontGroup::InitTextRun ( gfxContext aContext,
gfxTextRun aTextRun,
const PRUnichar aString,
PRUint32  aLength 
) [protected]
static PRBool gfxFontGroup::IsInvalidChar ( PRUnichar  ch  )  [static]

The listed characters should not be passed in to MakeTextRun and should be treated as invisible and zero-width.

gfxTextRun* gfxFontGroup::MakeEmptyTextRun ( const Parameters aParams,
PRUint32  aFlags 
)

Make a textrun for an empty string.

This is fast; if you call it, don't bother caching the result.

gfxTextRun* gfxFontGroup::MakeSpaceTextRun ( const Parameters aParams,
PRUint32  aFlags 
)

Make a textrun for a single ASCII space.

This is fast; if you call it, don't bother caching the result.

virtual gfxTextRun* gfxFontGroup::MakeTextRun ( const PRUint8 *  aString,
PRUint32  aLength,
const Parameters aParams,
PRUint32  aFlags 
) [virtual]

Make a textrun for a given string.

If aText is not persistent (aFlags & TEXT_IS_PERSISTENT), the textrun will copy it. This calls FetchGlyphExtents on the textrun.

virtual gfxTextRun* gfxFontGroup::MakeTextRun ( const PRUnichar aString,
PRUint32  aLength,
const Parameters aParams,
PRUint32  aFlags 
) [virtual]

Make a textrun for a given string.

If aText is not persistent (aFlags & TEXT_IS_PERSISTENT), the textrun will copy it. This calls FetchGlyphExtents on the textrun.

void gfxFontGroup::SetUserFontSet ( gfxUserFontSet aUserFontSet  )  [protected]
static void gfxFontGroup::Shutdown (  )  [static]

Reimplemented in gfxPangoFontGroup.

virtual void gfxFontGroup::UpdateFontList (  )  [virtual]

Reimplemented in gfxPangoFontGroup.

virtual already_AddRefed<gfxFont> gfxFontGroup::WhichPrefFontSupportsChar ( PRUint32  aCh  )  [virtual]
virtual already_AddRefed<gfxFont> gfxFontGroup::WhichSystemFontSupportsChar ( PRUint32  aCh  )  [virtual]

Member Data Documentation

nsILanguageAtomService* gfxFontGroup::gLangService [static, protected]

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