Bug 70041

Summary: Bitmap export crops text at edges
Product: LibreOffice Reporter: Chris Wilson <chris-freedesktop.org>
Component: DrawAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: chris-freedesktop.org, momonasmon, p.weissenbacher
Priority: medium    
Version: 4.1.1.2 release   
Hardware: Other   
OS: Linux (All)   
Whiteboard:
Crash report or crash signature: Regression By:
Attachments: a drawing which demonstrates the bug
the exported PNG at 72 pixels wide, with the top of the "2" cropped off
Drawing with shaved off bottom
Drawing with shaved off bottom with workaround

Description Chris Wilson 2013-10-02 15:13:39 UTC
Created attachment 86974 [details]
a drawing which demonstrates the bug

If you open the attached .odg, select all, export to PNG, export selected only, and choose a width of 72 pixels, you get the attached PNG, which has the top of the 2 cropped off.

It looks like a slight miscalculation of the pixel area that would be taken up by the text, possibly because the symbol for 2 in Arial extends outside the normal font height?
Comment 1 Chris Wilson 2013-10-02 15:14:16 UTC
Created attachment 86975 [details]
the exported PNG at 72 pixels wide, with the top of the "2" cropped off
Comment 2 Maxim Monastirsky 2013-10-02 16:06:35 UTC
Hi,
I can reproduce the bug with LO 4.1.2.2 under Ubuntu 13.10 (64-bit) & Fedora 19 (64-bit), using Arial font from ttf-mscorefonts-installer package.

(In reply to comment #0)
> possibly because the symbol for 2 in Arial extends outside the normal font
> height?
What do you mean by "normal font height"? I opened the font in FontForge, and the Ascent line is far above the glyph.
Comment 3 Philipp Weissenbacher 2014-03-27 14:38:27 UTC
Created attachment 96461 [details]
Drawing with shaved off bottom

The bottom pixels are shaved off: you can't see the bottom lines of the text boxes.

A workaround is to create a line with the same color as the background, place it near the bottom of the selection and include it in the selection (see .
Comment 4 Philipp Weissenbacher 2014-03-27 14:41:55 UTC
Created attachment 96462 [details]
Drawing with shaved off bottom with workaround

Same as the above, but with a line of the same colour as the background added at the bottom.
This is clearly showing that there's something wrong with the rectangle calculation.

NB: 'Selection' box ticked in export dialogue (same as original bug report). 

This is with version 4.2.2.1 on Windows 8.
Comment 5 Philipp Weissenbacher 2014-08-26 11:00:57 UTC
Just tested this in 4.3.0.2 on Windows 8. Setting to RESOLVED.
Thanks a lot for fixing this!