Forum How do I...?

prince-hyphenate-lines

Jellby
Is prince-hyphenate-lines working? I just tried setting to 2 (in an Italian document) and got stacks of up to 6 (at least) consecutive hyphenated lines.

In this test file:

<?xml version="1.0" encoding="UTF-8"?>
<html lang="it">
<head>
<style>
@page { size: 9cm 12cm; margin: 1mm; }
@font-face {
    font-family: serif;
    src: local("Georgia")
}
body {
  font-size: 9.9pt;
  font-family: serif;
  text-align: justify;
  hyphens: auto;
  prince-hyphenate-lines: 2;
}
p { text-indent: 1em; margin: 0; }
</style>
</head>
<body>

<p>Preceduto da un Bendicò eccitatissimo discese la breve scala che conduceva al giardino. Racchiuso com’era questo fra tre mura e un lato della villa, la reclusione gli conferiva un aspetto cimiteriale accentuato dai monticciuoli paralleli delimitanti i canaletti d’irrigazione e che sembravano tumuli di smilzi giganti. Sul terreno rossiccio le piante crescevano in fitto disordine, i fiori spuntavano dove Dio voleva e le siepi di mortella sembravano disposte per impedire più che per dirigere i passi. Nel fondo una flora chiazzata di lichene giallonero esibiva rassegnata i suoi vezzi più che secolari; ai lati due panche sostenevano cuscini ravvoltolati e trapunti, anch’essi di marmo grigio, e in un angolo l’oro di un albero di gaggia intrometteva la propria allegria intempestiva. Da ogni zolla emanava la sensazione di un desiderio di bellezza presto fiaccato dalla pigrizia.</p>

</body>
</html>


I get 2 rows of 4 consecutive hyphens.

Michael Day told me in an email that "prince-hyphenate-lines is disabled in the beta, as the new Knuth line-breaking algorithm should in theory not require it". I believe there is room for improvement, though. Can the linebreaking parameters (penalties, demerits) be tweaked?
mikeday
Thanks for the test document! It does seem to be a bit overhyphenated. There isn't any way to to adjust penalties and demerits yet, but we'll do some investigation and see what we can do. I'll add this issue to the development roadmap.
somnath
Hi,

I'm running into the same problem with prince-hyphenate-lines with Prince 7 beta 1. "prince-hyphenate-lines" does not seem to work.

Is there anything/workaround for this? Also can we have control over the consecutive lines when we have 3 like elements (whether they’re words or punctuation) appearing at the beginning or end of line?

Anyway, I would like "prince-hyphenate-lines" to be working... :-)


Thanks,
Somnath
mikeday
The prince-hyphenate-lines property will be returning in the 7.0 release. :)
mikeday
Prince 7.0 is out, and it supports the prince-hyphenate-lines property once more. It is only a hint to the justification algorithm though, and may not always be strictly followed in situations where the alternative would be worse. Hopefully this will produce good results. :)