#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <X11/X.h>
#include <X11/Xmd.h>
#include <X11/Xproto.h>
#include "mi.h"
#include "cfb.h"
#include <X11/fonts/fontstruct.h>
#include "dixfontstr.h"
#include "gcstruct.h"
#include "windowstr.h"
#include "scrnintstr.h"
#include "pixmapstr.h"
#include "regionstr.h"
#include "cfbmskbits.h"
#include "cfb8bit.h"
void
cfbImageGlyphBlt8 (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
DrawablePtr pDrawable;
GCPtr pGC;
int x, y;
unsigned int nglyph;
CharInfoPtr *ppci;
pointer pglyphBase;
{
ExtentInfoRec info;
xRectangle backrect;
int fgPixel;
cfbPrivGC *priv;
if ((pGC->ops->PolyFillRect == miPolyFillRect) ||
(pGC->ops->PolyGlyphBlt == miPolyGlyphBlt))
{
miImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
return;
}
QueryGlyphExtents(pGC->font, ppci, (unsigned long)nglyph, &info);
if (info.overallWidth >= 0)
{
backrect.x = x;
backrect.width = info.overallWidth;
}
else
{
backrect.x = x + info.overallWidth;
backrect.width = -info.overallWidth;
}
backrect.y = y - FONTASCENT(pGC->font);
backrect.height = FONTASCENT(pGC->font) + FONTDESCENT(pGC->font);
priv = cfbGetGCPrivate(pGC);
fgPixel = pGC->fgPixel;
pGC->fgPixel = pGC->bgPixel;
priv->xor = PFILL(pGC->bgPixel);
(*pGC->ops->PolyFillRect) (pDrawable, pGC, 1, &backrect);
pGC->fgPixel = fgPixel;
priv->xor = PFILL(pGC->fgPixel);
(*pGC->ops->PolyGlyphBlt) (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
}