Re: [css-text] feedback on hyphenation

On 2/12/14, 6:17 AM, "Håkan Save Hansson" <hakan.hansson@edison.se> wrote:

>Hi,
> 
>Please consider additional sub properties to “hyphens:auto” for more
>control over the hyphenation. As it is (tested in FF) the
>auto-hyphenation is too “strong”, meaning that any word that can be
>hyphenated will be, regardless
> the suitability and the will of the page editor.
> 
>Examples:
> 
>hyphens-[Don't hyphenate words shorter than]: 10
>hyphens-[Minimum count of characters before hyphen]: 3
>hyphens-[Minimum count of characters after hyphen]: 3

This is hyphenate-limit-chars in CSS Text Module Level 4 [1]. It takes 1-3
integer values, where the first is the number of characters a word must
have before hyphenation is considered, the second is the minimum number of
characters before the hyphen, and the third is the minimum number of
characters after the hyphen. So to express the above you’d say:

hyphenate-limit-chars: 10 3 3

Or

hyphenate-limit-chars: 10 3

(since the third value is defined to be equal to the second if omitted)


>hyphens-[Minimum count of characters after hyphen on the last paragraph
>line]: 6

This might be better done by specifying a minimum length for the last line
on a paragraph. There have been some suggestions on how to specify this
that Fantasai has been meaning to put into the level 4 draft.

> 
>..and a bit more advanced..
> 
>hyphens-[Maximum count of subsequent lines with hyphens]: 2

This is the hyphenate-limit-lines property in the level 4 draft.

> 
>..and so on (these were just from the top of my head).
> 
> 
>Second suggestion:
> 
>There are some language specific special cases with hyphenation. In
>Swedish for instance, if you write the two words “matta” (carpet)and
>“tjuv” (thief) as one you write it as “mattjuv”, with two t letters. This
>should hyphenate into “matt-tjuv”, with three t letters. This is not a
>hyphenation rule, but rather a type rule: when you write two words as
>one, there may
> never be more than two of the same letters where then two words
>concatenate.
> 
>If you want to use a manual soft hyphen (&shy;) for such a word you're in
>trouble. My suggestion is that when you write “matt&shy;tjuv” in text and
>it is displayed without hyphenation, it respects this rule and
>suppresses one of the three letters t. I don’t know if such a rule could
>have a negative effect on texts in other languages, but I don’t know of
>any language allowing three subsequent
> letters. If needed maybe it could be controlled in CSS something like
>this:
> 
>hyphens-[Maximum count of same letter before and after hyphen]: 2
> 
>One could argue that this is not a CSS thing, rather up to the browser to
>handle (maybe with different behavior for different languages). Well, in
>my opinion it is certainly related to the rules how the soft hyphen
>(&shy;)
> should be handled and without a standard no
>browser vendor would probably even think of implementing this behavior.
>Furthermore it must be handled, and handled in the same way, by all
>(modern) browsers before one can start using it on webpages. You dont
>want any “matttjuv” with
> three letters t out there (can't he even spell?). One should be able to
>check the support at for instance caniuse.com.
>This speaks in favor ofa CSS property like the one above.

Do you have any examples of other typesetting systems that implement
Swedish discretionary hyphens correctly? I’m assuming that regular
hyphenation is a solved problem - hyphenation dictionaries can note that
mattjuv becomes matt-tjuv if a regular hyphenation break is needed. But
does anyone deal with the &shy; (or however else a dischy is encoded)
insertion the way you describe?

Thanks,

Alan

[1] http://dev.w3.org/csswg/css-text-4/#hyphenation

Received on Tuesday, 18 February 2014 18:03:20 UTC