+ // we're drawing a regular char
+ clearClips();
+ clip0dev->drawChar(state, x, y, dx, dy, originX, originY, code, nBytes, u, uLen);
+ clip1dev->drawChar(state, x, y, dx, dy, originX, originY, code, nBytes, u, uLen);
+
+ /* calculate the bbox of this character */
+ int x1 = (int)x, x2 = (int)x+1, y1 = (int)y, y2 = (int)y+1;
+ SplashFont*font = clip0dev->getCurrentFont();
+ SplashPath*path = font?font->getGlyphPath(code):NULL;
+
+ if(!path) {
+ if(code)
+ msg("<error> couldn't create outline for char %d", code);
+ return;
+ }
+ x-=originX;
+ y-=originY;
+ path->offset((SplashCoord)x, (SplashCoord)y);
+ int t;
+ for(t=0;t<path->getLength();t++) {
+ double xx,yy;
+ Guchar f;
+ path->getPoint(t,&xx,&yy,&f);
+ state->transform(xx,yy,&xx,&yy);
+ if(xx<x1) x1=(int)xx;
+ if(yy<y1) y1=(int)yy;
+ if(xx>=x2) x2=(int)xx+1;
+ if(yy>=y2) y2=(int)yy+1;
+ }
+
+ /* if this character is affected somehow by the various clippings (i.e., it looks
+ different on a device without clipping), then draw it on the bitmap, not as
+ text */
+ if(clip0and1differ(x1,y1,x2,y2)) {
+ msg("<verbose> Char %d is affected by clipping", code);
+ boolpolydev->drawChar(state, x, y, dx, dy, originX, originY, code, nBytes, u, uLen);
+ checkNewBitmap(x1,y1,x2,y2);
+ rgbdev->drawChar(state, x, y, dx, dy, originX, originY, code, nBytes, u, uLen);
+ if(config_extrafontdata) {
+ int oldrender = state->getRender();
+ state->setRender(3); //invisible
+ gfxdev->drawChar(state, x, y, dx, dy, originX, originY, code, nBytes, u, uLen);
+ state->setRender(oldrender);
+ }
+ } else {
+
+ /* this char is not at all affected by clipping.
+ Now just dump out the bitmap we're currently working on, if necessary. */
+ booltextdev->drawChar(state, x, y, dx, dy, originX, originY, code, nBytes, u, uLen);
+ checkNewText(x1,y1,x2,y2);
+ /* use polygonal output device to do the actual text handling */
+ gfxdev->drawChar(state, x, y, dx, dy, originX, originY, code, nBytes, u, uLen);
+ }