You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by bu...@apache.org on 2002/06/17 21:18:51 UTC
DO NOT REPLY [Bug 9930] New: -
Error in hyphenation algorithm
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9930>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9930
Error in hyphenation algorithm
Summary: Error in hyphenation algorithm
Product: Fop
Version: all
Platform: All
OS/Version: All
Status: NEW
Severity: Normal
Priority: Other
Component: page-master/layout
AssignedTo: fop-dev@xml.apache.org
ReportedBy: jaccoud@petrobras.com.br
In class HyphenationTree, method
public Hyphenation hyphenate(char[] w, int offset, int
len,
int remainCharCount, int pushCharCount)
the value for pushCharCount, i.e., the
minimum number of characters after the last hyphen, is not used properly. The test for the
hyphenation points is
if (((il[i + 1] & 1) == 1) && i >= remainCharCount
&& i < (len -
pushCharCount)) {...}
but it should be
if (((il[i + 1] & 1) == 1) && i >= remainCharCount
&& i
<= (len - pushCharCount)) {...}
^^^^
This bug makes the program assume the right limit is 1 unit
higher than specified, preventing hyphens to appear where they can. I developed a Portuguese
hyphenation table and this bug did not allow it to work correctly. I had to write <hyphen-min
before="2" after="1"/> instead of <hyphen-min before="2" after="2"/> to get around the bug. I
will gladly submit the table but it will only work properly if this bug is fixed. (Well, the other
tables are not working properly too.)
To observe the error, simply try to hyphenate "banana".
In English you get "ba-nana" instead of the correct (?) "ba-nan-a" (jeez, hyphenation in English is a
complete madness...) even with after="1". In Spanish (and in the original Portuguese, from a
obscure origin) you get the same "ba-nana" instead of the correct (!) "ba-na-na", unless you
deviously use after="1".
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org