W3C home > Mailing lists > Public > www-style@w3.org > February 2009

Re: [CSS Text/G.C. for P.M.] Hyphenation & ligatures

From: thomas <thomas.bsd@gmail.com>
Date: Mon, 23 Feb 2009 20:37:41 +0100
Message-ID: <2753bafa0902231137m7204ae46ic45c069cd212ac94@mail.gmail.com>
To: Jonathan Kew <jonathan@jfkew.plus.com>
Cc: WWW Style <www-style@w3.org>
2009/2/23 Jonathan Kew <jonathan@jfkew.plus.com>:
> On 23 Feb 2009, at 15:35, thomas wrote:
>> OK, but the font rendering mechanism needs hints. How could it know if
>> I want to use fake or real small caps,
> IMO, "font-variant: small-caps" should always use "real" small caps if they
> exist in the font, and only create fake ones as a fallback when using fonts
> that don't have real ones.

In most case, yes.  But suppose the font contains only ASCII real
small caps, and that you need also accented small caps.  You may want
not to use real small caps at all to avoid mixing them with the fake

> (If you really want to ensure you'll get "fake" small caps, then you should
> explicitly uppercase and resize the text, not request small-caps at all.)
>> normal or old-style digits, a
>> simple bullet or an ornament? CSS provides no way to give it a hint.
> This is true, and it's an area where CSS needs enhancement. There have been
> some previous discussions (look in the archives for threads on "advanced
> font features"), but further work is needed.

OK.  Though, I doubt that hyphenating and advanced font features are
two completely separate questions.  Let me take a tricky example.
Imagine there is a property to switch ligatures on and off.  According
to the rules of german typography, you want want no ff-ligature in
"Kauffahrt"(because it is composed of "Kauf" and "Fahrt"), but you
want a ff-ligature in Schiff.  How do you handle the word
"Kauffahrteischiff"?  You could use a span inside the word to disable
the ligature on the first place.  But then the hyphenator would
consider two words, breaking the parameters "hyphenate-before" and
"hyphenate-after".  So you put a zero-width word-joiner between 'Kauf'
and 'fahrt' to prevent the ligature.  The problem is, there should be
a break point between 'Kauf' and 'fahrt', and the word joiner prevents
this.  So you add also a soft hyphen, writing
'Kauf&nobreak;&shy;fahrteischiff'.  But then, what happen? Since the
manual hyphenation overrides the auto-hyphenation, the word will never
break between 'Kauffahrtei' and 'schiff' -- and it should be possible.

Although such complications do not come often, I do think that
hyphenation and ligatures shall not be considered as completely
independent questions.

By the way, note that in the absence of CSS markup to handle
ligatures, Firefox puts a standard ligature (ff, fi, etc.) whenever
possible, thus displaying wrongly 'Kauffahrt' or 'Kaufinteresse'.  It
is then necessary to add manually the required word joiner and this is

Received on Monday, 23 February 2009 19:38:29 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:24 UTC