GNOME Bugzilla – Bug 105292
pango_[ft2|win32|x]_layout_render() ignores spacing
Last modified: 2004-12-22 21:47:04 UTC
It seems that all rendering backends (Xft as well??) ignore the spacing attribute of the PangoLayout. The layout itself calculates its extents with line spacing but the rendering routines fail to add spacing when they calculcate the y_offset for rendering. I'll attach a patch against pango-1-2.
Created attachment 14120 [details] [review] Patch that fixes the problem -- tested for PangoFT2
The right fix is really to switch all the rendering routines to use PangoLayoutIter, like gdk_draw_pango_layout() does, so this information is encapsulated.
I agree. Do you want me to come up with a patch that fixes it that way?
Created attachment 14142 [details] [review] proposed patch for pangoft2
I've attached a new patch that seems to work fine. I have tested it using the GIMP's text tool. If you give your OK, I'll try to do similar patches for the other backends. BTW, is there a corresponding PangoXft function as well?
Owen, do you want me to prepare patches for the other backends? It would be nice to get this fixed soon (at least for PangoFT2) since GIMP-1.3 depends on it and people start to complain...
Setting the milestone to the next release in order to assure that this patch is not forgotten.
Created attachment 15392 [details] [review] Updated patch that fixes the X and Win32 backends as well (both untested)
As far as this patch goes, it looks good to me. You can go ahead and apply it to pango-1-2 and HEAD. draw_layout_line() is still a bit of a problem ... if you compare the GDK function the the functions in Pango, you'll see that the Pango functions don't handle rise, strikethrough, or imposed shape. And there is a lot of duplicated code. We should leave a bug open to try and do something about that. That is probably closely related to bug 107668.
Applied to both branches: 2003-04-02 Sven Neumann <sven@gimp.org> * pango/pangoft2.c (pango_ft2_render_layout) * pango/pangowin32.c (pango_win32_render_layout) * pango/pangox.c (pango_x_render_layout): use a PangoLayoutIter to iterate over the lines and let render_layout_line() do the actual rendering. Fixes bug #105292. Do you want me to open a new report for the remaining issues?