[cairo] Locking font / pen space
spitzak at gmail.com
Mon Aug 30 10:55:37 PDT 2010
Behdad Esfahbod wrote:
> On 08/27/10 16:37, Bill Spitzak wrote:
>> If this is a "mode" it means a lot of other api can switch behavior and
>> this would avoid a lot of incompatibility problems or tricky emulation.
>> In this mode dash patterns are in "pen space", and font metrics returned
>> in "font space". Glyph positions would also be given in "font space",
>> relative to either 0,0 or the current point in the CTM.
> What do you mean? How is the font metrics and glyph positions currently
> different from what you are suggesting?
The most obvious reason is that now the CTM can be a degenerate one, but
you will still be able to draw text and non-zero line thicknesses. This
makes it impossible to measure or position glyphs unless they are in
some space other than the CTM. I recommend that they be in the font
space and pen space.
It is my opinion that the dash-pattern api for stroking lines will be
immensely more useful and easier to implement if the dashes are defined
in pen space. The topology for a given dash selection (ie whether the
ends of the dashes intersect) will be the same in all cases. It also
forces a definition for the square ends and line join types, which are
otherwise quite vague in a space with a non-circular pen. It also avoids
the need to add another api to read and set the dash pattern, because if
the dash pattern is in another space then it will have to contain this
matrix. Also it allows the dash pattern to be specified when the CTM is
More information about the cairo