Re: ligature selections (was Re: undo and combining characters)

From: Paul Rohr (paul@abisource.com)
Date: Wed Apr 24 2002 - 03:26:41 EDT

  • Next message: Andrew Dunbar: "Re: undo and combining characters"

    At 03:54 AM 4/24/02 +0100, Andrew Dunbar wrote:
    > --- Paul Rohr <paul@abisource.com> wrote:
    >> Yep. That's what we'd need to implement. Doing the
    >> math for this may not
    >> be too hard, though. Two simple suggestions:
    >>
    >> 1. Take the width of the ligature and divide by the
    >> number of characters it
    >> represents. This might not be pretty, but the
    >> overall effect should be
    >> self-explanatory.
    >
    >Umm no because you're assuming ligatures always have
    >two halves being on the left and the right. This is
    >not so! lam+alef do work this way, others such as
    >anything involving mim, or lam+jim have the two halves
    >displayed vertically.

    Correct. This approach assumes that we're doing either cluster or stacked
    boundaries.

    To be clear, even divisions won't *ever* look pretty enough to reproduce in
    a Unicode manual (except by accident). This approach just gives clear
    visual feedback that you only selected "a third" of the glyph. No more, no
    less.

    >For Indian languages it gets
    >even more complicated. A vowel can actually have a
    >part drawn on the left of the consonant and a part
    >drawn on the right. I don't even know if the fonts
    >encode information that would make highlighting these
    >cases possible...

    Right. Without a ton of shaping and composition information from the fonts,
    you can't properly highlight just the right portions of such complex glyphs.

    However, you can still show the user that they got "one half" or "one third"
    of this mess. In this respect, it may actually be more useful than the
    slightly smarter guesstimate in the following approach.

    >> 2. Take the widths of the "standalone" glyphs, and
    >> use them to
    >> proportionally subdivide the width of the
    >> ligature. However, I'm not
    >> sure whether the results would be "good enough"
    >> in real life. You'd
    >> have to test.
    >
    >That wouldn't work at all. For example, alef is only
    >one pixel wide, lam and lam+alef are about the same
    >width.

    OK, so the math may take more than a morning to get right. For this
    particular screw case, say that:

      width(lam) == 13 pixels
      width(alef) == 1 pixel
      width(lam+alef) == 13 pixels

    If subdividing 13 into 12 + 1 doesn't look right, you tweak the math so it's
    11 + 2. (GUI hackers who've done enough pixel-twiddling are familiar with
    this kind of hackish math.)

    The goal isn't to be precise here -- for that, as we keep saying, you want
    lots of font information -- but to do a good enough job to give the user a
    decent sense of what's going on.

    Paul,
    trying to defend his math



    This archive was generated by hypermail 2.1.4 : Wed Apr 24 2002 - 03:27:01 EDT