freetype-devel
[Top][All Lists]
Advanced

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

[ft-devel] FontMatrix contradiction


From: Alexei Podtelezhnikov
Subject: [ft-devel] FontMatrix contradiction
Date: Tue, 11 Aug 2015 11:03:21 -0400

Hi All,

Type 1 fonts use FontMatrix to define scaling from character space to
user space. FreeType actually deduces units_per_EM from the yy
component of the matrix. This is the primary purpose of FontMatrix. Of
course, it can also be used to specify narrowing, expending, slanting,
rotation, or any other affine transformation. These two purposes
contradict each other because it is tricky to define units_per_EM and
modify advances for arbitrary transformations. Indeed, rotation be 90
degrees would have the yy component equal to 0. This is probably why
Type 1 specifications ask to limit the use to narrowing, expanding,
and slanting along one axis, i.e., FontMatrix must have

( xx > 0 && yy > 0 && ( xy == 0 || yx == 0 ) )   .

This condition also guarantees that the transformation is not degenerate.

FreeType now is much more permissive, it rejects yy == 0 only to avoid
division by zero in figuring out units_per_EM. FreeType permits
rotations except by 90 degrees, which is cool but problematic for
advances see above. FreeType permits degenerate transformations, which
is not cool. That being said, I have not found any rotation or
degenerate transformations examples in the wild. The real use does
seem to be limited to simple scaling and slanting.

So, should FreeType limit FontMatrix to simple scaling and slanting to
make life easy for units_per_EM, advances, and avoid degenerate
transformations?

Should it fail or should it fallback on default?

Alexei



reply via email to

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