ligature handling (was Re: undo and combining characters

From: Tomas Frydrych (tomas@frydrych.uklinux.net)
Date: Wed Apr 24 2002 - 11:43:08 EDT

  • Next message: Andrew Dunbar: "Re: Pango?"

    > > One possibility is to not do these ligatures at the
    > > editing stage, and to do
    > > them in printing, but then we lose WYSISYG...

    Just to make sure we all understand how the ligature stuff works.
    We have a string in the piece table that the user typed in, it
    contains the sequence f i. In our fp_TextRun we have a cache for
    the text of the run, except that this cache contains a version of the
    string already processed by the shaping engine. In this case the
    shaping engine decides that the f i sequence should be collapsed
    to a single fi ligature, so that the cached string does not contain f i,
    but the fi glyph. The cached string is used for only two things: (1)
    as input for the OS text drawing rutines, (2) for width calculations.
    All editing operations, etc, are done on the text in the piece table,
    which still contains two separate characters f i. If the user deletes,
    say the f, we refresh the cached string in fp_TextRun, so that it will
    no longer contain the fi glyph, but only i.

    > If we are going to do auto-ligating, we really should
    > provide an option for it. Note also that it will be
    > font-dependent. It's always going to be possible to
    > use the 'fi' ligature codepoint but we might have some
    > fonts with the ligature and some without it.

    That's true. Our present problem is that the shaping engine does
    not interact with the font system, so the shaping engine does not
    know if the ligature glyph fi is available in the font or not. If we move
    to use FreeType, then we will have the font system in the xp code
    and it would be easier to implement some feedback mechanism so
    that we do not use glyphs that are not in the font.

    Tomas



    This archive was generated by hypermail 2.1.4 : Wed Apr 24 2002 - 11:48:09 EDT