#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <X11/X.h>
#include <X11/Xmd.h>
#include <X11/Xproto.h>
#include "misc.h"
#include "gcstruct.h"
#include <X11/fonts/fontstruct.h>
#include "dixfontstr.h"
#include "mi.h"
int
miPolyText(pDraw, pGC, x, y, count, chars, fontEncoding)
DrawablePtr pDraw;
GCPtr pGC;
int x, y;
int count;
char *chars;
FontEncoding fontEncoding;
{
unsigned long n, i;
int w;
CharInfoPtr charinfo[255];
GetGlyphs(pGC->font, (unsigned long)count, (unsigned char *)chars,
fontEncoding, &n, charinfo);
w = 0;
for (i=0; i < n; i++) w += charinfo[i]->metrics.characterWidth;
if (n != 0)
(*pGC->ops->PolyGlyphBlt)(
pDraw, pGC, x, y, n, charinfo, FONTGLYPHS(pGC->font));
return x+w;
}
_X_EXPORT int
miPolyText8(pDraw, pGC, x, y, count, chars)
DrawablePtr pDraw;
GCPtr pGC;
int x, y;
int count;
char *chars;
{
unsigned long n, i;
int w;
CharInfoPtr charinfo[255];
GetGlyphs(pGC->font, (unsigned long)count, (unsigned char *)chars,
Linear8Bit, &n, charinfo);
w = 0;
for (i=0; i < n; i++) w += charinfo[i]->metrics.characterWidth;
if (n != 0)
(*pGC->ops->PolyGlyphBlt)(
pDraw, pGC, x, y, n, charinfo, FONTGLYPHS(pGC->font));
return x+w;
}
_X_EXPORT int
miPolyText16(pDraw, pGC, x, y, count, chars)
DrawablePtr pDraw;
GCPtr pGC;
int x, y;
int count;
unsigned short *chars;
{
unsigned long n, i;
int w;
CharInfoPtr charinfo[255];
GetGlyphs(pGC->font, (unsigned long)count, (unsigned char *)chars,
(FONTLASTROW(pGC->font) == 0) ? Linear16Bit : TwoD16Bit,
&n, charinfo);
w = 0;
for (i=0; i < n; i++) w += charinfo[i]->metrics.characterWidth;
if (n != 0)
(*pGC->ops->PolyGlyphBlt)(
pDraw, pGC, x, y, n, charinfo, FONTGLYPHS(pGC->font));
return x+w;
}
int
miImageText(pDraw, pGC, x, y, count, chars, fontEncoding)
DrawablePtr pDraw;
GCPtr pGC;
int x, y;
int count;
char *chars;
FontEncoding fontEncoding;
{
unsigned long n, i;
FontPtr font = pGC->font;
int w;
CharInfoPtr charinfo[255];
GetGlyphs(font, (unsigned long)count, (unsigned char *)chars,
fontEncoding, &n, charinfo);
w = 0;
for (i=0; i < n; i++) w += charinfo[i]->metrics.characterWidth;
if (n !=0 )
(*pGC->ops->ImageGlyphBlt)(pDraw, pGC, x, y, n, charinfo, FONTGLYPHS(font));
return x+w;
}
_X_EXPORT void
miImageText8(pDraw, pGC, x, y, count, chars)
DrawablePtr pDraw;
GCPtr pGC;
int x, y;
int count;
char *chars;
{
unsigned long n;
FontPtr font = pGC->font;
CharInfoPtr charinfo[255];
GetGlyphs(font, (unsigned long)count, (unsigned char *)chars,
Linear8Bit, &n, charinfo);
if (n !=0 )
(*pGC->ops->ImageGlyphBlt)(pDraw, pGC, x, y, n, charinfo, FONTGLYPHS(font));
}
_X_EXPORT void
miImageText16(pDraw, pGC, x, y, count, chars)
DrawablePtr pDraw;
GCPtr pGC;
int x, y;
int count;
unsigned short *chars;
{
unsigned long n;
FontPtr font = pGC->font;
CharInfoPtr charinfo[255];
GetGlyphs(font, (unsigned long)count, (unsigned char *)chars,
(FONTLASTROW(pGC->font) == 0) ? Linear16Bit : TwoD16Bit,
&n, charinfo);
if (n !=0 )
(*pGC->ops->ImageGlyphBlt)(pDraw, pGC, x, y, n, charinfo, FONTGLYPHS(font));
}