qissue-bot / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
http://qgis.org
GNU General Public License v2.0
0 stars 0 forks source link

Bug: Spacing is messed up in composer labels #3333

Closed qissue-bot closed 5 years ago

qissue-bot commented 5 years ago

Author Name: Alister Hood (Alister Hood) Original Redmine Issue: 3345, https://issues.qgis.org/issues/3345

Original Assignee: Marco Hugentobler


(Maybe this should be priority="critical" as you could say the printed output is "corrupted")

When printing from the composer (either to paper or to a virtual PDF printer) the letter spacing is messed up in some composer labels. See attached screenshot. Exporting to SVG is OK.

I haven't seen the same problem in legend text or map labels, but maybe I just haven't tested enough (I always export to SVG due to this problem and others).

I'm guessing this bug could be related to r7364 or even #2937


qissue-bot commented 5 years ago

Original Redmine Comment Author Name: Alister Hood (Alister Hood) Original Date: 2010-12-16T13:39:45.000Z


Sorry, #2937 is a duplicate of #2796

qissue-bot commented 5 years ago

Original Redmine Comment Author Name: Alister Hood (Alister Hood) Original Date: 2010-12-16T13:45:24.000Z


I guess this could be caused by a library, not by QGIS itself...

qissue-bot commented 5 years ago

Original Redmine Comment Author Name: Marco Hugentobler (Marco Hugentobler) Original Date: 2010-12-17T02:32:50.000Z


It is a bug in the Qt library. However, in the composer, we use a workaround for it (request larger fonts and downscale the painter). So maybe the workaround needs to be improved or fixed for the label.

qissue-bot commented 5 years ago

Original Redmine Comment Author Name: Marco Hugentobler (Marco Hugentobler) Original Date: 2010-12-17T07:38:54.000Z


Hm, difficult to reproduce. Maybe it only happens with some fonts / fontsizes? Could you attach an empty project that contains no layer, just one composer with one label where the problem occures? Also, do you use the composer pdf export or the pdf printer in the print dialog (and which one on which OS)?

qissue-bot commented 5 years ago

Original Redmine Comment Author Name: Alister Hood (Alister Hood) Original Date: 2010-12-19T01:26:08.000Z


Maybe it only happens with some fonts / fontsizes?

Ah, yes. It occurs with Calibri, but not with a couple of other fonts I've tested now. It does not seem to depend on font size.

It looks like there may actually be a couple of separate issues:

  1. Spaces being inserted (This can be demonstrated by printing to PDF, opening the output file and copying into a text editor).

  2. Some characters missing (The question mark ? on the first line of this example).

  3. Some characters being too close together.

Also, do you use the composer pdf export or the pdf printer

A separate pdf printer, from the print dialogue. This is in Windows XP, and the problem occurs with both the Adobe printer and the [[PdFill]] printer (which uses ghostscript). But it also occurs if I use a real printer to print to paper.

qissue-bot commented 5 years ago

Original Redmine Comment Author Name: Alister Hood (Alister Hood) Original Date: 2010-12-19T01:40:18.000Z


It isn't just Calibri - I've now found another couple of fonts that also exhibit the problem. These ones are called "Candara" and "Constantia".

qissue-bot commented 5 years ago

Original Redmine Comment Author Name: Marco Hugentobler (Marco Hugentobler) Original Date: 2010-12-28T01:35:01.000Z


I tested it with the Qt pdf export and the system pdf printer on ubuntu. Both produce output as expected. Don't know if it might be a problem in the gdi print engine of Qt.

The Qt pdf export should give the same results on all platforms. It does however rasterize the text (I guess that's why you use a gdi pdf printer instead).

qissue-bot commented 5 years ago

Original Redmine Comment Author Name: Alister Hood (Alister Hood) Original Date: 2011-01-23T21:13:04.000Z


Both produce output as expected. Interesting. Do you actually have the Calibri font installed?

The Qt pdf export should give the same results on all platforms. It does however rasterize the text (I guess that's why you use a gdi pdf printer instead). Yes. There were also a number of bugs with the built-in pdf export, but I can't remember if any are still open. Note that this is not a PDF problem - it also occurs when I print to a real printer.

qissue-bot commented 5 years ago

Original Redmine Comment Author Name: Alister Hood (Alister Hood) Original Date: 2011-03-02T19:53:29.000Z


Interesting.

I no longer get the same results with the test file. But there is still a problem. The f in the first line is stretched and joined to the i. I get the same result in Windows and Linux, whether using the button to export to PDF, or printing. I'll attach some new examples.

qissue-bot commented 5 years ago

Original Redmine Comment Author Name: Alister Hood (Alister Hood) Original Date: 2011-03-02T20:08:51.000Z


I think this is probably a different bug from what I originally reported, because I can actually see it in the composer (see calibri.PNG), not just in the printouts.

The top of the f is stretched if there is an l or a k to the right, and the middle is stretched if there is an i or a j to the right.

This occurs only with fonts that exhibited the original bug (e.g. "Calibri", "Candara" and "Constantia").

qissue-bot commented 5 years ago

Original Redmine Comment Author Name: Alister Hood (Alister Hood) Original Date: 2011-03-03T12:15:16.000Z


The same effect shows up using these fonts in Gnumeric in Linux, so I assume this is a freetype issue.

If the original problem shows up again I'll reopen.

qissue-bot commented 5 years ago

Original Redmine Comment Author Name: Alister Hood (Alister Hood) Original Date: 2011-03-03T12:57:41.000Z


Sorry, I meant abiword, not gnumeric :)

Testing with ftview and ftstring does not show the same problem, so I guess it is something about the way QT (and GTK for abiword) are using freetype.

qissue-bot commented 5 years ago

Original Redmine Comment Author Name: Alister Hood (Alister Hood) Original Date: 2011-03-03T13:29:20.000Z


Hmmm, I'm guessing this is something to do with opentype kerning: http://web.archiveorange.com/archive/v/QpqYzHxnWiKoob2ztzE9

FT_Get_Kerning only has access to the old "kern" [[TrueType]] table, which Calibri does not include. Kerning in Calibri is realized only using the modern "kern" feature implemented in the "GPOS" [[OpenType]] table. To access that table, you should use an [[OpenType]] Layout engine such as [[HarfBuzz]], Pango, ICU Layout, Uniscribe, Bitstream Panorama or Monotype [[WorldType]], before you use [[FreeType]] to perform the glyph imaging.

This is a good idea anyway. [[FreeType]] is useful to perform glyph imaging, but its text layout abilities are very limited.