GNOME Bugzilla – Bug 172845
one pixel cropped off at left when rendering subtitles
Last modified: 2005-04-29 09:40:23 UTC
I just compiled the latest gst-plugins & co + totem, and the subtitle selection is working nicely, except that the bottom part of the images is cropped off... I guess the box where the subtitles are rendered is to small or something like that... I will attach a screenshot what will make it clear.
Created attachment 39765 [details] screenshot
Created attachment 39795 [details] [review] possible fix This may fix it (subtitle show fine here with the patch). Does it fix it for you?
This fixes the height, great! But when looking clearly, i noticed that the sub-box should also be a bit wider, i will post a screenshot to make it clear. You can see that the first char of the sub it a bit chopped of (the W of Wie).
Created attachment 39796 [details] screenshot (notice the W of "Wie")
Created attachment 39801 [details] [review] more This better?
Created attachment 39802 [details] screenshot that doesn't look good... You can also see some gray pixels between the chars...
Awesome! Er...
A closer look tells me it's not the counting that is wrong. I can reproduce this very reliably with the capital 'J' in bitstream vera sans.
Created attachment 39842 [details] [review] new patch This is the first patch, which removes a one-pixel border in the bitmap (which cuts off one pixel off the text), and adds another when rendering (because pango screws up internally). I think this fixes the bug. Dave, can you explain the goal of the bitmap_x0 code?
Created attachment 39844 [details] screenshot Hmm, this is better then the 2nd patch (the one that caused the garble), but there are still some lost pixels (as you said, it is visible with a J at the beginning, and i noticed it is be visible with a ? at the end).
Created attachment 39845 [details] screenshot hmm, sorry, the J at the beginning is good, Sans' J is just tin... But the ? is clearly missing a row of pixels... Perhaps some hardcoded +1 somewhere? (discovered the totem's screenshot function :) )
Yours is indeed missing a pixel, but I cannot reproduce it. My question mark looks fine. What font did you select?
Sans Bold, 16pixels
Created attachment 39862 [details] that's here This is how it looks for me, perfect if you ask me... Weird.
Hmm, and that is Sans Bold, 16 pixels? Strange... since the J in your screenshot is much wider...
Created attachment 39865 [details] more Yes. Sans is a meta-font, so the actual chosen font probably differs. Your J looks a lot like the bitstream vera J, while mine looks more like helvetica or so. Here's a screenshot of Bitstream Vera Sans, Bold, 16px. Still good. Can you try to figure out which font it uses for you?
Created attachment 39866 [details] shot Hmmm, even your bitstream vera sans bold is a different font as my bitstream vera sans bold... I've tried the same text, and it is clearly that your font is more bold as mine... Maybe it's usefull to know that i've installed the msttcorefonts?
Ow, forgot to add that the chopped of pixels happens with almost all my fonts...
We found that the 1 as x-offset in the pango_render_layout causes this. However, for me, removing that causes the 1-pixel-off problem on the left side (with both pango 1.8.0 and 1.8.1 on Fedora; Michael uses 1.8.1/Ubuntu). Don't know how to fix it...
I have the same problem as in comment 11 (one pixel cropped on the right). Test pipeline: gst-launch-0.8 videotestsrc ! video/x-raw-yuv,width=640,height=480,framerate=25.0 ! textoverlay text="CIAO" ! ffmpegcolorspace ! ximagesink If i remove the 1px as x-offset as in comment 19 all is fine. I'm using debian sarge, pango 1.8.1
Created attachment 45817 [details] [review] fix Thanks to the pango developers (Sven Neumann on IRC) for helping me. ;).