Monospaced font isn't really monospaced in AWT renderer. I created a pdf from list.fo (in the example dir), the texts "provisional-item"and "provisional-label" are displayed at the same column, as they should be. In awt renderer, though, it doesn't display properly, they're not aligned. It is quite a problem for monospaced text based tables (from email, legacy software, ...).
I managed to fix it by commenting out lines 203-205 in AWTFontMetrics.java. It overrode the value provided by FontMetrics and returned 1.4 * correct_value.
*** Bug 10571 has been marked as a duplicate of this bug. ***
*** Bug 3964 has been marked as a duplicate of this bug. ***
Why has this bug been languishing for so long? It's got an easy fix. If the fix is rejected becuase it messes up non monospaced fonts then perhaps we should trigger the fix only for fixed width fonts. I've attached a patch against 20.5 release that removes the space widening in the AWTFontMetrics, but only for monospaced fonts. And I define monospaced fonts as fonts where the advance of 'm' and 'l' are identical. (the widest and narrowest letters in the latin alphabet respectivly).
Created attachment 7771 [details] fix monospaced wide spaceing in AWT
From bad to worse in 0.20.5. After applying the previously mentioned fix, the preformatted (with spaces) lines are still totally misaligned, looks like a zigzag field. Moreover, when I modify the scaling of the page the length of the lines change "helter-skelter": first a line is longer than the next, second it is shorter. (This phenomena appears without the patch, too.)
...with AWTRenderer, of course.
Let's celebrate the 4th anniversary of this bug in style. To cite a famous physicist (C.Pauli, I believe): "This is not right, it is not even wrong". Well, I just removed (locally) the fudge factor for 'whitespace' and it works fine. What the original thinking behind the original kludge was beats me. Do you want to have half a chance of seeing the same output on different output devices? Remove the kludge! Do you want to be able to predict the size of some text based on font metrics without going through FOP to find out? Remove the kludge! You don't _like_ _some_ spacing of a given Font? Where exactly does that bother you? Only in AWT? In Word? In PDF? Well, I've got news for you: Find yourself a font you like better! Whoever commited that code should be relieved of his privileges.
Fixed in Trunk.
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed