[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Freetype] A question so stupid . . .
From: |
Ian Pilcher |
Subject: |
[Freetype] A question so stupid . . . |
Date: |
Tue, 17 Apr 2001 08:13:48 +0600 |
. . . that no one seems to have ever asked it before!
I'm trying to interpret some of the information in the PostScript table,
specifically the italicAngle member. I'm trying to convert the 16.16
"fixed float" to a C double, and I can't get my results to match those
produced by any of the TrueType->PostScript conversion utilities out
there. Of course, I don't really know that these utilities are doing
it right, so could someone take a look at the following and tell me if
I'm doing anything wrong?
inline double Double_From_TT_Fixed(TT_Fixed fixed)
{
short mantissa;
unsigned short fraction;
double result;
mantissa = (short) ((fixed & 0xffff0000) / 65536);
fraction = (short) (fixed & 0x0000ffff);
result = ((double) mantissa) + ((double) fraction) / 65536.0;
return result;
}
When passed 0xffefaac1, for example, this function computes a
mantissa = -17, fraction = 43713, and result = -16.332993. Is this
correct?
Thanks!
--
========================================================================
Ian Pilcher address@hidden
========================================================================
- [Freetype] A question so stupid . . .,
Ian Pilcher <=