Stefan Ram wrote:
> When a non-italic symbol follows an italic symbol, the
> distance betweeen them somtimes is too small. For example:
>
> <i>ƒ</i>)
>
> . The italicized ƒ may "touch" the parenthesis in some
> browsers.
This also happens (quite often) with the simpler and more common case
<i>f</i>)
and even more often with
<i>f</i>(
(I'm biting my fingers to not comment the use of LATIN SMALL LETTER F
WITH HOOK U+0192 ƒ except by stating that the character is rarely used
and has no standardized use, and since it is essentially a calligraphic
(or script) “f” taken to different uses, it is very slanted in many
fonts, and if you italicize it, you probably get very, very slanted
italics or faux italics.)
> To avoid this, one could introduce a small space:
>
> <i>ƒ</i> )
Yes, but   is U+200A HAIR SPACE, which is very thin, intended to
correspond to the thinnest space available in traditional typography. It
may well be insufficient here. Generally, you would need to select among
the fixed-width spaces in Unicode, depending on the content.
Moreover, fixed-width spaces are spaces and have line breaking property
value of BA (break opportunity after), so a program may decide to break
the line after it. (Whether this happens depends on adjacent characters
and other factors.) Using format control characters or CSS you might
prevent that, but this make approach more complicated.
There is a limited repertoire of fixed-width characters, and their
widths aren’t really fixed but depend on font. For more flexible and
more predictable tuning, you could use CSS, e.g.
<i class=pad>f</i>)
with
.pad { padding-right: 0.15em; }
> It would be very cumbersome to manually (or even
> programmatically) adjust all those character distances.
It is. But you could handle just the most disturbing cases with CSS,
using a pre-made set of class definitions for various sizes of padding.
> Therefore, the best thing would be for the browser to
> do this. The browser has all the information needed.
> But it does not seem to care.
Browsers, or programs in general, don’t do such things. For some years,
browsers have supported kerning (either by default or upon request with
the CSS property font-kerning) for character pairs. For example, if an
HTML document has the letter pair VA and it is rendered using an
OpenType font that has a kerning table entry for it, the odds are
probably that it will be shown as kerned closer to each other. But this
is not based on analysis of the glyphs for the character and the
author’s or viewer’s opinion on how close the characters should be but a
font designers idea of that and specific information (entered into the
kerning table of the font) how certain character pairs should be rendered.
So browsers don’t “think” about such things even for glyphs taken from
the same font and rendered with in the same font style. It would much
more to ask to do something with, say, an italic “f” followed by a
non-italic “)”.
Yucca,
https://jkorpela.fi