[poppler] Clipping text in Splash before rendering it

Albert Astals Cid aacid at kde.org
Sat Oct 13 16:17:05 PDT 2007


Hi, this patch has two parts.

First, it removes all exit(1) calls in favor or the best i could find, that 
is, return NULL (and hope the caller can understand NULL as error) in the 
gmem routines and the correct ignore in DCTStream.

Second, in Splash code it moves the resposability for checking if a glyph is 
inside the clip rect from Splash::fillGlyph2 to its callers, 
Splash::fillGlyph and Splash::fillChar, that way i can check inside 
SplashFTFont::makeGlyph if the font is inside the clip rect before rendering.

This fixes crash due to memory exhaustion on KDE bug 150693 [1] because that 
pdf specifies a HUGE font outside the clip rect :-/

CairoOutputDev does not need to do that because cairo already does it.

If noone objects to the patch (that is a bit intrusive but clean enough imho) 
i will commit it to HEAD and 0.6 branch next friday.

Albert

[1] http://bugs.kde.org/show_bug.cgi?id=150693
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CLIP_BEFORE_RENDER
Type: text/x-diff
Size: 11548 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/poppler/attachments/20071014/940a0b85/attachment.diff 


More information about the poppler mailing list