Re: Extensions for hyphenation

"Sebastian Geerken" <[email protected]>
Newsgroups gmane.comp.web.dillo.devel
Message-ID <[email protected]>
On Fri, Dec 07, Jorge Arellano Cid wrote:
> On Thu, Dec 06, 2012 at 09:38:28PM +0100, Sebastian Geerken wrote:
> > 2. How to deal with tables?
> > 
> > a) I've pushed my changes regarding extremes calculation to
> > <http://flpsed.org/hgweb/dillo_hyphen>, but I'd like to push it into
> > the main repository as soon as possible. The current state has some
> > bugs, but I hope it should be stable soon.
> > 
> > This is, BTW, generally some cleanup and so useful independent of this
> > special purpose. (Might be even somewhat faster than the old
> > implementation.)
> 
>   Probably this is the way to go. Just push it into the main repo
> as soon as you find it stable enough.

Just pushed to http://hg.dillo.org/dillo. I've found no problems so
far, but please take another look.

Something which came to my mind: should this new rule, to exclude
hyphenation breaks from minimal width calculation, also be applied to
soft hyphens? Currently it is applied to both, but letting minimal
width calculation consider soft hyphens as possible breaks may be
feasable, since soft hyphens are set by the author himself (who, OTOH,
is surprised by the fact that there is a browser also hyphenating
automatically ;-) ).

This would be rather simple:

diff -r 6a525e279c5d dw/textblock.cc
--- a/dw/textblock.cc   Fri Dec 07 19:32:40 2012 +0100
+++ b/dw/textblock.cc   Fri Dec 07 19:45:52 2012 +0100
@@ -41,7 +41,7 @@
 
 Textblock::DivChar Textblock::divChars[NUM_DIV_CHARS] = {
    // soft hyphen (U+00AD)
-   { "\xc2\xad", true, false, true, PENALTY_HYPHEN, -1 },
+   { "\xc2\xad", true, false, false, PENALTY_HYPHEN, -1 },
    // simple hyphen-minus: same penalties like automatic or soft
    // hyphens
    { "-", false, true, true, -1, PENALTY_HYPHEN },
    // (unconditional) hyphen (U+2010): handled exactly like
    // minus-hyphen.

See test/table-h1.html for the effect.

Sebastian
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.