Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes
nsFontOS2 Class Reference

#include <nsFontMetricsOS2.h>

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

List of all members.

Public Member Functions

NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW nsFontOS2 (void)
virtual ~nsFontOS2 (void)
void SelectIntoPS (HPS hps, long lcid)
virtual PRBool HasGlyph (HPS aPS, PRUint32 aChar)
virtual PRInt32 GetWidth (HPS aPS, const char *aString, PRUint32 aLength)
virtual PRInt32 GetWidth (HPS aPS, const PRUnichar *aString, PRUint32 aLength)
virtual void DrawString (HPS aPS, nsDrawingSurfaceOS2 *aSurface, PRInt32 aX, PRInt32 aY, const char *aString, PRUint32 aLength, INT *aDx0)
virtual void DrawString (HPS aPS, nsDrawingSurfaceOS2 *aSurface, PRInt32 aX, PRInt32 aY, const PRUnichar *aString, PRUint32 aLength)

Public Attributes

FATTRS mFattrs
SIZEF mCharbox
ULONG mHashMe
nscoord mMaxAscent
nscoord mMaxDescent
int mConvertCodePage
PRUint32mHaveCheckedCharMap
PRUint32mRepresentableCharMap

Detailed Description

Definition at line 156 of file nsFontMetricsOS2.h.


Constructor & Destructor Documentation

Definition at line 1877 of file nsFontMetricsOS2.cpp.

{
  mFattrs.usRecordLength = sizeof(mFattrs);
  mHashMe = gCurrHashValue;
  gCurrHashValue++;
#ifdef DEBUG_FONT_STRUCT_ALLOCS
  mRefCount++;
  printf("+++ nsFontOS2 total = %d\n", mRefCount);
#endif
}
nsFontOS2::~nsFontOS2 ( void  ) [virtual]

Definition at line 1888 of file nsFontMetricsOS2.cpp.

{
#ifdef DEBUG_FONT_STRUCT_ALLOCS
  mRefCount--;
  printf("--- nsFontOS2 total = %d\n", mRefCount);
#endif
}

Member Function Documentation

void nsFontOS2::DrawString ( HPS  aPS,
nsDrawingSurfaceOS2 aSurface,
PRInt32  aX,
PRInt32  aY,
const char *  aString,
PRUint32  aLength,
INT aDx0 
) [virtual]

Definition at line 1925 of file nsFontMetricsOS2.cpp.

{
  POINTL ptl = { aX, aY };
  aSurface->NS2PM(&ptl, 1);
  ExtTextOut(aPS, ptl.x, ptl.y, 0, NULL, aString, aLength, aDx0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsFontOS2::DrawString ( HPS  aPS,
nsDrawingSurfaceOS2 aSurface,
PRInt32  aX,
PRInt32  aY,
const PRUnichar aString,
PRUint32  aLength 
) [virtual]

Reimplemented in nsFontOS2Substitute, and nsFontOS2FT.

Definition at line 1935 of file nsFontMetricsOS2.cpp.

{
  nsAutoCharBuffer buffer;
  PRInt32 destLength = aLength;
  WideCharToMultiByte(mConvertCodePage, aString, aLength, buffer, destLength);

  POINTL ptl = { aX, aY };
  aSurface->NS2PM (&ptl, 1);

  ExtTextOut(aPS, ptl.x, ptl.y, 0, NULL, buffer.get(), destLength, NULL);
}

Here is the call graph for this function:

PRInt32 nsFontOS2::GetWidth ( HPS  aPS,
const char *  aString,
PRUint32  aLength 
) [virtual]

Definition at line 1904 of file nsFontMetricsOS2.cpp.

{
  SIZEL size;
  GetTextExtentPoint32(aPS, aString, aLength, &size);
  return size.cx;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRInt32 nsFontOS2::GetWidth ( HPS  aPS,
const PRUnichar aString,
PRUint32  aLength 
) [virtual]

Reimplemented in nsFontOS2Substitute, and nsFontOS2FT.

Definition at line 1912 of file nsFontMetricsOS2.cpp.

{
  nsAutoCharBuffer buffer;
  PRInt32 destLength = aLength;
  WideCharToMultiByte(mConvertCodePage, aString, aLength, buffer, destLength);

  SIZEL size;
  GetTextExtentPoint32(aPS, buffer.get(), destLength, &size);

  return size.cx;
}

Here is the call graph for this function:

virtual PRBool nsFontOS2::HasGlyph ( HPS  aPS,
PRUint32  aChar 
) [inline, virtual]

Reimplemented in nsFontOS2Substitute, and nsFontOS2FT.

Definition at line 165 of file nsFontMetricsOS2.h.

{ return PR_TRUE; };

Here is the caller graph for this function:

void nsFontOS2::SelectIntoPS ( HPS  hps,
long  lcid 
) [inline]

Definition at line 1897 of file nsFontMetricsOS2.cpp.

{
   GFX (::GpiSetCharSet(aPS, aLcid), FALSE);
   GFX (::GpiSetCharBox(aPS, &mCharbox), FALSE);
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 176 of file nsFontMetricsOS2.h.

Definition at line 180 of file nsFontMetricsOS2.h.

Definition at line 175 of file nsFontMetricsOS2.h.

Definition at line 177 of file nsFontMetricsOS2.h.

Definition at line 186 of file nsFontMetricsOS2.h.

Definition at line 178 of file nsFontMetricsOS2.h.

Definition at line 179 of file nsFontMetricsOS2.h.

Reimplemented in nsFontOS2Substitute.

Definition at line 187 of file nsFontMetricsOS2.h.


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