Commit e2af7133 authored by Kristian Høgsberg's avatar Kristian Høgsberg

2005-03-10 Kristian Høgsberg <krh@redhat.com>

        From Jeff Muizelaar <jrmuizel@nit.ca>:

        * poppler/CairoFontEngine.cc (CairoFontEngine::getFont):
        Don't print "Type 3 font!" message.

        * poppler/CairoOutputDev.cc (CairoOutputDev::drawImageMask):
        Enable image mask drawing and do it properly, albeit slowly.

        * poppler/CairoOutputDev.h
        (CairoOutputDev::interpretType3Chars): Return true so that
        Gfx.cc turns type3 characters into calls to drawImageMask
parent 3dc52373
2005-03-10 Kristian Høgsberg <krh@redhat.com>
From Jeff Muizelaar <jrmuizel@nit.ca>:
* poppler/CairoFontEngine.cc (CairoFontEngine::getFont):
Don't print "Type 3 font!" message.
* poppler/CairoOutputDev.cc (CairoOutputDev::drawImageMask):
Enable image mask drawing and do it properly, albeit slowly.
* poppler/CairoOutputDev.h
(CairoOutputDev::interpretType3Chars): Return true so that
Gfx.cc turns type3 characters into calls to drawImageMask
2005-03-09 Kristian Høgsberg <krh@redhat.com>
* NEWS: Describe 0.1.2 (and 0.1.1) release.
......
......@@ -332,7 +332,6 @@ CairoFontEngine::getFont(GfxFont *gfxFont, XRef *xref) {
fontType = gfxFont->getType();
if (fontType == fontType3) {
printf ("Type 3 font!\n");
/* Need to figure this out later */
// return NULL;
}
......
......@@ -467,12 +467,7 @@ void CairoOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
double *ctm;
cairo_matrix_t *mat;
/* TODO: I'm not sure how to implement this, and its currently crashing.
Disabling for now */
return;
buffer = (char *)malloc (width * height);
buffer = (char *)malloc (width * height * 4);
if (buffer == NULL) {
error(-1, "Unable to allocate memory for image.");
......@@ -485,16 +480,21 @@ void CairoOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
imgStr->reset();
for (y = 0; y < height; y++) {
dest = buffer + y * width;
dest = buffer + y * width * 4;
for (x = 0; x < width; x++) {
imgStr->getPixel(&pix);
*dest++ = soutRound(255 * fill_color.b);
*dest++ = soutRound(255 * fill_color.g);
*dest++ = soutRound(255 * fill_color.r);
if (invert)
pix ^= 1;
if (pix)
*dest++ = 255;
else
*dest++ = 0;
else
*dest++ = 255;
}
}
......@@ -514,14 +514,9 @@ void CairoOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
cairo_concat_matrix (cairo, mat);
cairo_matrix_destroy (mat);
/* TODO: Should we use A1 here? I assume that is bit-packed */
image = cairo_surface_create_for_image (
buffer, CAIRO_FORMAT_A8, width, height, width);
buffer, CAIRO_FORMAT_ARGB32, width, height, width * 4);
cairo_surface_set_filter (image, CAIRO_FILTER_BEST);
/* TODO: Is this the right way to do image masks? */
cairo_set_rgb_color (cairo,
fill_color.r, fill_color.g, fill_color.b);
cairo_show_surface (cairo, image, width, height);
cairo_restore (cairo);
......
......@@ -52,7 +52,7 @@ public:
// Does this device use beginType3Char/endType3Char? Otherwise,
// text in Type 3 fonts will be drawn with drawChar/drawString.
virtual GBool interpretType3Chars() { return gFalse; }
virtual GBool interpretType3Chars() { return gTrue; }
//----- initialization and control
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment