[cairo] Follow up: Font matrix difference between 1.0.4 & 1.2.0

Behdad Esfahbod behdad at behdad.org
Sun Jul 16 08:10:39 PDT 2006


(I lost the original thread, so writing a new message)

The problem with translation in fontmatrix in the 1.2 series is now
fixed in git head with this change:

commit 84840e6bba6e72aa88fad7a0ee929e8955ba9051
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Fri Jul 14 21:42:41 2006 -0400

    Use font matrix offset to reposition glyph origin instead of adjusting advance
    
    As the font matrix includes translation, which is otherwise unused for glyph
    transformation, the interpretation of translation is fairly arbitrary. For
    1.2.0, we choose to have this translation affect the glyph advance with the
    thought that it could be used to do letter spacing/kerning. That is fairly
    useless in practice, and a far more useful interpretation is to relocate
    the origin of each glyph.
    
    This patch uses the translation in the font matrix as an offset for the
    glyph origin in user space. It turns out glyph extents were already correctly
    shifted.
    
    The end result with this patch is to have cairo match the 1.0 behaviour for
    font matrix translations, but now we know why :-)
    
    Explanation above courtesy of Keith Packard.


cworth added the test font-matrix-translate to the test suite.
Currently it's failing for PS and SVG for me.  I'm not testing PDF.

-- 
behdad
http://behdad.org/

"Commandment Three says Do Not Kill, Amendment Two says Blood Will Spill"
        -- Dan Bern, "New American Language"



More information about the cairo mailing list