Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions | Protected Attributes
nsFontPS Class Reference

#include <nsFontMetricsPS.h>

Inheritance diagram for nsFontPS:
Inheritance graph
[legend]
Collaboration diagram for nsFontPS:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsFontPS ()
 nsFontPS (const nsFont &aFont, nsFontMetricsPS *aFontMetrics)
virtual ~nsFontPS ()
PRInt32 SupportsChar (PRUnichar aChar)
virtual nscoord GetWidth (const char *aString, PRUint32 aLength)=0
virtual nscoord GetWidth (const PRUnichar *aString, PRUint32 aLength)=0
virtual nscoord DrawString (nsRenderingContextPS *aContext, nscoord aX, nscoord aY, const char *aString, PRUint32 aLength)=0
virtual nscoord DrawString (nsRenderingContextPS *aContext, nscoord aX, nscoord aY, const PRUnichar *aString, PRUint32 aLength)=0
virtual nsresult RealizeFont (nsFontMetricsPS *aFontMetrics, float dev2app)=0
virtual nsresult SetupFont (nsRenderingContextPS *aContext)=0

Static Public Member Functions

static
NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
nsFontPS
FindFont (char aChar, const nsFont &aFont, nsFontMetricsPS *aFontMetrics)
static nsFontPSFindFont (PRUnichar aChar, const nsFont &aFont, nsFontMetricsPS *aFontMetrics)

Protected Attributes

nsFontmFont
PRUint16mCCMap
nsFontMetricsPSmFontMetrics

Detailed Description

Definition at line 181 of file nsFontMetricsPS.h.


Constructor & Destructor Documentation

nsFontPS::nsFontPS ( const nsFont aFont,
nsFontMetricsPS aFontMetrics 
)

Definition at line 517 of file nsFontMetricsPS.cpp.

{
  mFont = new nsFont(aFont);
  if (!mFont) return;
  mFontMetrics = aFontMetrics;
}

Here is the call graph for this function:

nsFontPS::~nsFontPS ( ) [virtual]

Definition at line 524 of file nsFontMetricsPS.cpp.

{
  if (mFont) {
    delete mFont;
    mFont = nsnull;
  }

  if (mCCMap) {
    FreeCCMap(mCCMap);
  }

  mFontMetrics = nsnull;
}

Here is the call graph for this function:


Member Function Documentation

virtual nscoord nsFontPS::DrawString ( nsRenderingContextPS aContext,
nscoord  aX,
nscoord  aY,
const char *  aString,
PRUint32  aLength 
) [pure virtual]

Implemented in nsFontPSAFM.

Here is the caller graph for this function:

virtual nscoord nsFontPS::DrawString ( nsRenderingContextPS aContext,
nscoord  aX,
nscoord  aY,
const PRUnichar aString,
PRUint32  aLength 
) [pure virtual]

Implemented in nsFontPSAFM.

nsFontPS * nsFontPS::FindFont ( char  aChar,
const nsFont aFont,
nsFontMetricsPS aFontMetrics 
) [static]

Definition at line 465 of file nsFontMetricsPS.cpp.

{
  PRUnichar uc = (unsigned char)aChar;
  return FindFont(uc, aFont, aFontMetrics);
}

Here is the caller graph for this function:

nsFontPS * nsFontPS::FindFont ( PRUnichar  aChar,
const nsFont aFont,
nsFontMetricsPS aFontMetrics 
) [static]

Definition at line 474 of file nsFontMetricsPS.cpp.

{
  nsFontPS* fontPS;

#if defined(MOZ_ENABLE_FREETYPE2) || defined(MOZ_ENABLE_XFT)
  nsDeviceContextPS* dc = aFontMetrics->GetDeviceContext();
  NS_ENSURE_TRUE(dc, nsnull);
  if (dc->mFTPEnable) {
#ifdef MOZ_ENABLE_XFT
    fontPS = nsFontPSXft::FindFont(aChar, aFont, aFontMetrics);
#else
    fontPS = nsFontPSFreeType::FindFont(aChar, aFont, aFontMetrics);
#endif
    if (fontPS)
      return fontPS;
  }
#endif

  /* Find in afm font */
  if (aFontMetrics->GetFontsPS()->Count() > 0) {
    fontps *fps = (fontps*)aFontMetrics->GetFontsPS()->ElementAt(0);
    NS_ENSURE_TRUE(fps, nsnull);
    fontPS = fps->fontps;
  }
  else {
    fontPS = nsFontPSAFM::FindFont(aFont, aFontMetrics);
    fontps *fps = new fontps;
    NS_ENSURE_TRUE(fps, nsnull);
    fps->fontps = fontPS;
#if defined(MOZ_ENABLE_XFT) || defined(MOZ_ENABLE_FREETYPE2) 
    fps->entry  = nsnull;
#ifdef MOZ_ENABLE_XFT
    fps->charset = nsnull;
#else
    fps->ccmap  = nsnull;
#endif
#endif
    aFontMetrics->GetFontsPS()->AppendElement(fps);
  }
  return fontPS;
}

Here is the call graph for this function:

virtual nscoord nsFontPS::GetWidth ( const char *  aString,
PRUint32  aLength 
) [pure virtual]

Implemented in nsFontPSAFM.

Here is the caller graph for this function:

virtual nscoord nsFontPS::GetWidth ( const PRUnichar aString,
PRUint32  aLength 
) [pure virtual]

Implemented in nsFontPSAFM.

virtual nsresult nsFontPS::RealizeFont ( nsFontMetricsPS aFontMetrics,
float  dev2app 
) [pure virtual]

Implemented in nsFontPSAFM.

Here is the caller graph for this function:

virtual nsresult nsFontPS::SetupFont ( nsRenderingContextPS aContext) [pure virtual]

Implemented in nsFontPSAFM.

Here is the caller graph for this function:

Definition at line 193 of file nsFontMetricsPS.h.

    { return mCCMap && CCMAP_HAS_CHAR(mCCMap, aChar); };

Member Data Documentation

PRUint16* nsFontPS::mCCMap [protected]

Definition at line 220 of file nsFontMetricsPS.h.

nsFont* nsFontPS::mFont [protected]

Definition at line 219 of file nsFontMetricsPS.h.

Definition at line 221 of file nsFontMetricsPS.h.


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