freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Devel] pixel size, hinting and scaling


From: Graham Asher
Subject: RE: [Devel] pixel size, hinting and scaling
Date: Sat, 25 Jan 2003 16:22:51 -0000

<<<<<<
Decomposing affine transform to scaling and the rest is ambiguous.
Notice that you can docompose each rotation (except when a=0||b=0) to
shearing and scaling:
|a b|    |a 0|   | 1  b/a|
|   | =  |   | * |       |
|c d|    |0 d|   |c/d  1 |

so you cannot get scaling only part and rotation-and-shear only part.
>>>>>>

An interesting point. But the fact remains that it's necessary to do this
decomposition, because we need to determine pixels per em in both x and y
dimensions so that hinting can be performed correctly before other
transformations are applied. The method I am using gives good results for
the normal case, which is that there is no shearing, just scaling and
rotation. From the point of view of typography we can think of the process
as involving three transformations:

1. Scale: y scale gives the design size; x scale is normally the same as y
scale but if different produces condensed or expanded text.

2. Shear: horizontal shear gives slanting, used as a 'poor man's italic'.
Vertical shear is in practice never used.

3. Rotation. The purpose of rotation is to display the text on a rotated
baseline.

So ideally what we need is a triple decomposition into scale, shear and
rotation, applied in that order. But the important thing is to extract the
most likely scale; and we can generally assume that scale precedes shear,
which precedes rotation, which, I think, gives a unique decomposition,
provided we treat rotation as being about the origin.

<<<<<<
If you use e.g. [0,1] vector in you, you'll get different scales.
>>>>>>

That isn't truel. Whatever vector is used, it will be rotated by the same
angle around the origin of the rotation. I am extracting rotation about
(0,0). For example, a 90 degrees clockwise rotation will rotate (1,0) to
(0,-1), and (0,1) to (1,0). Both of these are 90 degrees.

Graham Asher




reply via email to

[Prev in Thread] Current Thread [Next in Thread]