freetype-devel
[Top][All Lists]
Advanced

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

[Devel] Commit CFF changes or not?


From: Tom Kacvinsky
Subject: [Devel] Commit CFF changes or not?
Date: Thu, 1 Feb 2001 22:23:19 -0500 (EST)

Should I commit, or not?

On Wed, 24 Jan 2001, Tom Kacvinsky wrote:

> Hi all,
>
> I came up with a heuristic for determining the units_per_EM for a particular
> font based on the FontMatrix.  I have already checked in the changes for the
> Type 1 driver, and attached are patches for the CFF driver (for pure CFF fonts
> only -- OpenType/CFF and CEF fonts have a units per em field in one of the
> tables in the font that is correct for that font).  I had to make a minor 
> change
> to cfftypes.h in order to get the information passed along from matrix parsing
> function (cff_parse_font_matrix), and I also had to add a number parsing 
> routine
> (really, just grab a real number and multiply by 1000, in order to overcome 
> some
> problems with moving a real number into a FT_Fixed variable).
>
> My only problem is this: I currently use the fourth field of the FontMatrix to
> get the units_per_Em value.  This is not quite right, because the FontMatrix 
> for
> a font can be used for rotation, translation, skewing, etc..., all of which
> might make the fourth value not properly reflect the fonts units_per_EM.  Most
> foundries are shipping fonts with "standard" font matrices, but in light of
> Distiller produced PFAs (and "weird" font matrices that might ensue), I am
> concerned that my heuristic will fail in certain cases...
>
> We could decompose the font matrix into a scale, rotation, skew, etc... 
> matrices,
> but the decomposition might now be unique, and we would also have to use
> floating point numbers (think of arctan, etc...).  Given that FreeType uses
> mostly 16.16 fixed numbers for real numbers, I think the latter is a stumbling
> block.  Also, I am not sure if the scale matrix (which is what we need for
> units_per_EM) that would ensue from such a decomposition would accurately
> reflect the scaling used in the font.
>
> Let me know what you think.
>
> Tom
>
>




reply via email to

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