Bug 1180 - Problem with monospaced font
Summary: Problem with monospaced font
Status: CLOSED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: awt renderer (show other bugs)
Version: 0.17
Hardware: PC Linux
: P1 major
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
: 3964 10571 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-04-02 05:21 UTC by gabor.melis
Modified: 2012-04-01 06:56 UTC (History)
3 users (show)



Attachments
fix monospaced wide spaceing in AWT (1.31 KB, patch)
2003-08-12 14:52 UTC, Danno Ferrin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description gabor.melis 2001-04-02 05:21:44 UTC
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, ...).
Comment 1 gabor.melis 2001-04-02 05:44:35 UTC
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.

Comment 2 Oleg Tkachenko 2002-11-14 21:51:31 UTC
*** Bug 10571 has been marked as a duplicate of this bug. ***
Comment 3 Oleg Tkachenko 2002-11-14 21:52:03 UTC
*** Bug 3964 has been marked as a duplicate of this bug. ***
Comment 4 Danno Ferrin 2003-08-12 14:51:25 UTC
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).
Comment 5 Danno Ferrin 2003-08-12 14:52:00 UTC
Created attachment 7771 [details]
fix monospaced wide spaceing in AWT
Comment 6 Roland Gulyas 2003-11-19 13:09:52 UTC
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.)
Comment 7 Roland Gulyas 2003-11-19 13:17:35 UTC
...with AWTRenderer, of course.
Comment 8 Martin Schulz 2005-04-09 18:56:48 UTC
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.
Comment 9 Vincent Hennebert 2007-04-04 01:14:34 UTC
Fixed in Trunk.
Comment 10 Glenn Adams 2012-04-01 06:56:02 UTC
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed