#include "../log.h"
#include "../png.h"
#include "../devices/record.h"
+#include "../types.h"
#define UNKNOWN_BOUNDING_BOX 0,0,0,0
m.ty = ymin;
m.m00 = m.m11 = 1;
m.m10 = m.m01 = 0;
+ m.tx -= 0.5;
+ m.ty -= 0.5;
gfxline_t* line = gfxline_makerectangle(xmin, ymin, xmax, ymax);
dev->fillbitmap(dev, line, img, &m, 0);
unsigned long long int c=0;
assert(sizeof(unsigned long long int)==8);
{
- if(((int)polypixels&7) || ((int)textpixels&7)) {
+ if(((ptroff_t)polypixels&7) || ((ptroff_t)textpixels&7)) {
//msg("<warning> Non-optimal alignment");
}
int l2 = len;
msg("<debug> drawChar render=%d", state->getRender());
if(state->getRender()&RENDER_CLIP) {
+ //char is just a clipping boundary
rgbdev->drawChar(state, x, y, dx, dy, originX, originY, code, nBytes, u, uLen);
-
- /* FIXME: do we need these calls? */
boolpolydev->drawChar(state, x, y, dx, dy, originX, originY, code, nBytes, u, uLen);
booltextdev->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);
+ } else if(rgbbitmap != rgbdev->getBitmap()) {
+ // we're doing softmasking or transparency grouping
+ boolpolydev->drawChar(state, x, y, dx, dy, originX, originY, code, nBytes, u, uLen);
+ checkNewBitmap(UNKNOWN_BOUNDING_BOX);
+ rgbdev->drawChar(state, x, y, dx, dy, originX, originY, code, nBytes, u, uLen);
} else {
+ // 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;
SplashPath*path = clip0dev->getCurrentFont()->getGlyphPath(code);
+ if(!path) {
+ if(code)
+ msg("<error> couldn't create outline for char %d", code);
+ return;
+ }
int t;
for(t=0;t<path->getLength();t++) {
double xx,yy;