If we set it to low, however, the char positions will be inaccurate */
#define GLYPH_SCALE 1
-static void chararray_writetodev(gfxdevice_t*dev, chararray_t*array, MATRIX*matrix)
+static void chararray_writetodev(gfxdevice_t*dev, chararray_t*array, MATRIX*matrix, char invisible)
{
swfoutput_internal*i = (swfoutput_internal*)dev->internal;
swf_SetU8(i->tag, 0);//reserved
}
i->tag = swf_InsertTag(i->tag,ST_PLACEOBJECT2);
- swf_ObjectPlace(i->tag,textid,getNewDepth(dev),&i->page_matrix,NULL,NULL);
+ if(invisible && i->config_flashversion>=8) {
+ swf_ObjectPlaceBlend(i->tag,textid,getNewDepth(dev),&i->page_matrix,NULL,NULL,BLENDMODE_MULTIPLY);
+ } else {
+ swf_ObjectPlace(i->tag,textid,getNewDepth(dev),&i->page_matrix,NULL,NULL);
+ }
}
-static void charbuffer_writetodevandfree(gfxdevice_t*dev, charbuffer_t*buf)
+static void charbuffer_writetodevandfree(gfxdevice_t*dev, charbuffer_t*buf, char invisible)
{
while(buf) {
charbuffer_t*next = buf->next;buf->next = 0;
- chararray_writetodev(dev, buf->array, &buf->matrix);
+ chararray_writetodev(dev, buf->array, &buf->matrix, invisible);
chararray_destroy(buf->array);
free(buf);
buf = next;
swfoutput_internal*i = (swfoutput_internal*)dev->internal;
if(!i->textmode)
return;
- charbuffer_writetodevandfree(dev, i->chardata);i->chardata = 0;
+ charbuffer_writetodevandfree(dev, i->chardata, 0);i->chardata = 0;
i->textmode = 0;
}
if(i->textmode)
endtext(dev);
if(i->topchardata) {
- charbuffer_writetodevandfree(dev, i->topchardata);
+ charbuffer_writetodevandfree(dev, i->topchardata, 1);
i->topchardata=0;
}
glyph, i->swffont->id, x, y, color->r, color->g, color->b, color->a);
if(color->a == 0 && i->config_invisibletexttofront) {
+ if(i->config_flashversion>=8) {
+ // use "multiply" blend mode
+ color->a = color->r = color->g = color->b = 255;
+ }
i->topchardata = charbuffer_append(i->topchardata, i->swffont, glyph, x, y, i->current_font_size, *(RGBA*)color, &i->fontmatrix);
} else {
i->chardata = charbuffer_append(i->chardata, i->swffont, glyph, x, y, i->current_font_size, *(RGBA*)color, &i->fontmatrix);
#define PF2_ASBITMAP 0x04
//...
+#define BLENDMODE_NORMAL 0
+#define BLENDMODE_NORMAL2 1
+#define BLENDMODE_LAYER 2
+#define BLENDMODE_MULTIPLY 3
+#define BLENDMODE_SCREEN 4
+#define BLENDMODE_LIGHTEN 5
+#define BLENDMODE_DARKEN 6
+#define BLENDMODE_ADD 7
+#define BLENDMODE_SUBSTRACT 8
+#define BLENDMODE_DIFFERENCE 9
+#define BLENDMODE_INVERT 10
+#define BLENDMODE_ALPHA 11
+#define BLENDMODE_ERASE 12
+#define BLENDMODE_OVERLAY 13
+#define BLENDMODE_HARDLIGHT 14
+
typedef struct _SWFPLACEOBJECT {
U16 depth;
U16 id; // may be 0