Re: ligature handling (was Re: undo and combining characters

From: Andrew Dunbar (hippietrail@yahoo.com)
Date: Wed Apr 24 2002 - 12:09:43 EDT

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

     --- Tomas Frydrych <tomas@frydrych.uklinux.net>
    wrote: >
    > > > 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.

    This is important. The next version needs to be able
    to query the fonts about what codepoints they have.
    We need this anyway to get rid of the ugly
    RemapGlyph hack. We also need it to fix Bug 2421.

    Bug 2421 should be made part of the target for the
    rendering redesign I think.

    Andrew Dunbar.

    > Tomas

    =====
    http://linguaphile.sourceforge.net http://www.abisource.com

    __________________________________________________
    Do You Yahoo!?
    Everything you'll ever need on one web page
    from News and Sport to Email and Music Charts
    http://uk.my.yahoo.com



    This archive was generated by hypermail 2.1.4 : Wed Apr 24 2002 - 12:11:05 EDT