[Poppler-bugs] [Bug 46622] [patch] support for swftools - updateFont()

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Mar 1 13:53:10 PST 2012


https://bugs.freedesktop.org/show_bug.cgi?id=46622

--- Comment #4 from gawain at camlann.de 2012-03-01 13:53:10 PST ---
swftools implements an own class InfoOutputDev. That one is not derived from
SplashOutputDev, but creates instances of it to render pdf to flash swf. It
needs to retrieve the current splash font without actually drawing some text
(with is currently required to get the font info updated). So it patches the
(embedded) xpdf code to make doUpdateFont() public. Its an hack...
For porting swftools to poppler there must be a method to get the same
functionality without hacking...

Some snipped of code from swftools:

void InfoOutputDev::updateFont(GfxState *state) 
{
    GfxFont*font = state->getFont();
    if(!font) {
        current_splash_font = 0;
        return;
    }
    if(font->getType() == fontType3) {
        current_splash_font = 0;
        return;
    }
    GfxState* state2 = state->copy();
    state2->setPath(0);
    state2->setCTM(1.0,0,0,1.0,0,0);
    splash->updateCTM(state2, 0,0,0,0,0,0);
    state2->setTextMat(1.0,0,0,1.0,0,0);
    state2->setFont(font, 1024.0);
    splash->doUpdateFont(state2);

    current_splash_font = splash->getCurrentFont();
    delete state2;
}

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Poppler-bugs mailing list