lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 12/6/2012 9:10 PM, Coda Highland wrote:
On Thu, Dec 6, 2012 at 12:00 PM, Hans Hagen <pragma@wxs.nl> wrote:
On 12/6/2012 8:22 PM, Jay Carlson wrote:

I'll call it likely non-conformant and a bad example to draw lessons
from. As a rule of thumb, display of NFC (generally, precomposed when >
possible) and NFD (decomposed) should be indistinguishable, especially
in the case of single combining marks; the fact that it is not makes > me
suspect there are other bugs lurking around. The display itself is
a bug if you consider crappy typography to be a bug (and I suspect
you do, based on your complaint about the aesthetics of the
decomposed case).

It has to do with resolution: in a precomposed glyph the glyph is one and
snapping on the grid which can have a relation to screen pixels and/or
anti-aliasing involves the whole shape (possibly driven by hinting). When
composing, the shapes are independent and snapping is less related as there
are 'moves' involved. So, at low resolutions things can easily look bad. If
you have 1920 pixels / 100 glyphs you have less than 20 pixels per glyph.
Add some margins and spacing and you have way less. In that respect it's
already a miracle that things on the average look quite ok (partly thanks to
subpixels juggling).

(When bitmap fonts were still the fashion one had to explicitly generate
them for the output device and also make sure to compensate for a built-up
of inaccuracy as well as snapping on the device grid. With outline fonts and
cross platform portable floating point this is less an issue today.)

Hans

That may affect the aesthetics of composed characters but it's
actually beside the point. Often the component glyphs going into a
composed character DON'T look like the precomposed glyph -- especially
accents over capital letters.

Quite a claim. It's rather natural to make a font in a font editor and add the right anchors in there and then export the composed glyphs based on that info.

If a font offers a precomposed glyph for a given composed character,
failing to use it is a shortcoming of the renderer. As I said before,
composed characters should be treated as ligatures by a good font
renderer, with precomposed glyphs being preferred to assembling
component glyphs if they're available. It will ALWAYS be a superior
visual result.

(1) turning 0x0041 0x0300 into 0x00C0 is either part of input normalization

(2) or can be part of the contextual analysis of a feature in a font, but fonts seldom carry that information for latin scripts

(3) combining in the renderer is often a gpos feature esp 'mark'; ligatures are another matter (gsub) and is driven by the font, not the renderer

For those wondering what this has to do with Lua: in luatex all this juggling with unicode as well as font feature processing is done with stock Lua. But anyway, we're getting off-topic.

Hans


-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
    tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------