Re: more XFt stuff

From: Tomas Frydrych (tomas@frydrych.uklinux.net)
Date: Mon Jun 24 2002 - 06:40:57 EDT

  • Next message: Tomas Frydrych: "note on vertical scripts support in AW"

    Hi Joaquin,

    > We have to position glyphs at exact positions (not extracted from
    > default scapements).

    Sure, but I am pretty sure Pango does that.

    > PangoGlyphString has associated to each glyph a
    > PangoGlyphGeometry with:
    >
    > PangoGlyphUnit width; // the logical width to use for the the
    > character.
    > PangoGlyphUnit x_offset; // horizontal offset from nominal character
    > position.
    > PangoGlyphUnit y_offset; // vertical offset from nominal character
    > position.
    >
    > I don't understand the comments. What's the nominal character
    > position? And what's the logical width?
    >

    I far as I know the logical width is the width by which you move the
    insertion point; it is determined by the shaping engine. I suspect that
    the two offsets are related to the way 0-witdth and negative-width
    characters are handled. If I understand correctly, when you have a
    string Abcd, where b,c,d, are 0-width, the total width is divided
    between the four glyphs, so that while the overall logical_width(Abcd)
    == width(A), the logical width for each of the four glyphs ==
    width(A)/4. This makes it possible to give some indication of where
    the insertion point is, instead of having it stuck at the end of A for 3
    key presses.

    Now, in order to draw the glyphs at the correct place, you need the
    extra x offset, which would be -width(A)/4 for b, -2*width(A)/4 for c
    and -3*width(A)/4 for d; but as I say I am not 100% certain about
    this, you would need to ask Owen.

    However, when we use Pango, we need not to worry about the
    internal data stuctures too much, since it is Pango that calculates
    these and then uses them to postion the glyphs when doing the
    rendering with pango_*_render(). The only thing we do outwith
    Pango is moving the insertion point, and we only need to worry
    about the logical widths for this.

    Tomas



    This archive was generated by hypermail 2.1.4 : Tue Jun 25 2002 - 04:13:10 EDT