Back to index

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

#include <nsFontMetricsOS2.h>

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

List of all members.

Public Member Functions

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

Public Attributes

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

Private Attributes

PRUint32 mRepresentableCharMap [UCS2_MAP_LEN]

Detailed Description

Definition at line 437 of file nsFontMetricsOS2.h.


Constructor & Destructor Documentation

Definition at line 2512 of file nsFontMetricsOS2.cpp.

{
  mHashMe = gCurrHashValue;
  gCurrHashValue++;

  mFattrs = aFont->mFattrs;
  mCharbox = aFont->mCharbox;
  mMaxAscent = aFont->mMaxAscent;
  mMaxDescent = aFont->mMaxDescent;
  mConvertCodePage = aFont->mConvertCodePage;

  memset(mRepresentableCharMap, 0, sizeof(mRepresentableCharMap));
#ifdef DEBUG_FONT_STRUCT_ALLOCS
  mRefCount++;
  printf("+++ nsFontOS2Substitute total = %d\n", mRefCount);
#endif
}

Here is the call graph for this function:

Definition at line 2530 of file nsFontMetricsOS2.cpp.

{
#ifdef DEBUG_FONT_STRUCT_ALLOCS
  mRefCount--;
  printf("--- nsFontOS2Substitute 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, inherited]

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 nsFontOS2Substitute::DrawString ( HPS  aPS,
nsDrawingSurfaceOS2 aSurface,
PRInt32  aX,
PRInt32  aY,
const PRUnichar aString,
PRUint32  aLength 
) [virtual]

Reimplemented from nsFontOS2.

Definition at line 2613 of file nsFontMetricsOS2.cpp.

{
  nsAutoChar16Buffer buffer;
  nsresult rv = SubstituteChars(aString, aLength, buffer, &aLength);
  if (NS_FAILED(rv) || !aLength) return;

  POINTL ptl = { aX, aY };
  aSurface->NS2PM(&ptl, 1);
  PRUnichar* string = buffer.get();
  NS_ConvertUCS2toUTF8 str(Substring(string, string + aLength));
  ExtTextOut(aPS, ptl.x, ptl.y, 0, NULL, (const char*)str.get(), str.Length(), NULL);
}

Here is the call graph for this function:

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

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 nsFontOS2Substitute::GetWidth ( HPS  aPS,
const PRUnichar aString,
PRUint32  aLength 
) [virtual]

Reimplemented from nsFontOS2.

Definition at line 2593 of file nsFontMetricsOS2.cpp.

{
  nsAutoChar16Buffer buffer;
  nsresult rv = SubstituteChars(aString, aLength, buffer, &aLength);
  if (NS_FAILED(rv) || !aLength) return 0;

  SIZEL size;
  PRUnichar* string = buffer.get();
  NS_ConvertUCS2toUTF8 str(Substring(string, string + aLength));
  BOOL rc = GetTextExtentPoint32(aPS, (const char*)str.get(), str.Length(),
                                 &size);
  if (rc == TRUE) {
    return size.cx;
  } else {
    return 0;
  }
}

Here is the call graph for this function:

virtual PRBool nsFontOS2Substitute::HasGlyph ( HPS  aPS,
PRUint32  ch 
) [inline, virtual]

Reimplemented from nsFontOS2.

Definition at line 443 of file nsFontMetricsOS2.h.

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

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:

virtual void nsFontOS2Substitute::SetRepresentable ( PRUint32  ch) [inline, virtual]

Definition at line 445 of file nsFontMetricsOS2.h.


Member Data Documentation

SIZEF nsFontOS2::mCharbox [inherited]

Definition at line 176 of file nsFontMetricsOS2.h.

Definition at line 180 of file nsFontMetricsOS2.h.

FATTRS nsFontOS2::mFattrs [inherited]

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 from nsFontOS2.

Definition at line 457 of file nsFontMetricsOS2.h.


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