[cairo] Font metrics under font transformations

Maarten Breddels dmon at xs4all.nl
Tue Jan 11 12:53:25 PST 2005


Keith Packard wrote:

>Around 21 o'clock on Jan 11, Maarten Breddels wrote:
>
>  
>
>>No matter how weird the transformation is, the 'add advance vector' and 
>>'substract height vector' should always work, i think.
>>    
>>
>
>I've just thought of an obvious reason we can't just run the height 
>through the font transformation and get a vector result.  Artificial 
>obliquing uses a shear transformation:
>
>	font space		user space
>	[x,y]		-> 	[x + y * shear_factor, y]
>
>Now run our simple [0,height] vector through this transformation to 
>compute the 'line spacing vector':
>
>	[0,height]	->	[height * shear_factor, height]
>
>I submit that the line spacing should remain constant under a shear 
>transformation.
>
>Yuck. Suggestions anyone?
>
>-keith
>
>  
>
But someone might also want a real shear, so also the [0,height] vector. 
But sometimes (or usually) not, but shouldn't the user fix this problem, 
using a matrix to 'unshear' this vector? This way, the font extends are 
at least easy to use in all other situations. It may also be usefull to 
not only include a height and advance vector, but also just a height, 
and an advance, which is not the length of the corresponding vector, 
since height and advance may be negative.




More information about the cairo mailing list