XFontStruct *savedFont = aContext->GetCurrentFont(); aContext->SetCurrentFont(mFont);
nsFontXlib *savedFont = aContext->GetCurrentFont(); aContext->SetCurrentFont(this);
nsFontXlibNormal::DrawString(nsRenderingContextXlib* aContext,                             nsDrawingSurfaceXlib* aSurface,                             nscoord aX, nscoord aY,                             const PRUnichar* aString, PRUint32 aLength){  if (!mFont) {    LoadFont();    if (!mFont)      return 0;  }  XChar2b buf[512];  char *p;  PRInt32 bufLen;  int textWidth;  ENCODER_BUFFER_ALLOC_IF_NEEDED(p, mCharSetInfo->mConverter,      aString, aLength, buf, sizeof(buf), bufLen);    int len = mCharSetInfo->Convert(mCharSetInfo, mFont, aString, aLength,                                  p, bufLen);  if ((mFont->min_byte1 == 0) && (mFont->max_byte1 == 0)) {    xGC *gc = aContext->GetGC();        XDrawString(aSurface->GetDisplay(),                aSurface->GetDrawable(),                *gc,                aX, aY + mBaselineAdjust, p, len);    gc->Release();    textWidth = XTextWidth(mFont, p, len);  }  else  {    XFontStruct *savedFont = aContext->GetCurrentFont();    aContext->SetCurrentFont(mFont);    aContext->UpdateGC();    xGC *gc = aContext->GetGC();        /* note the length must be divided by 2 for X*16 functions */    XDrawString16(aSurface->GetDisplay(),                  aSurface->GetDrawable(),                  *gc,                  aX, aY + mBaselineAdjust, (XChar2b *)p, len / 2);                      gc->Release();        textWidth = XTextWidth16(mFont, (XChar2b *)p, len / 2);    aContext->SetCurrentFont(savedFont);    aContext->UpdateGC();  }  ENCODER_BUFFER_FREE_IF_NEEDED(p, buf);  return textWidth;}