Hello,

So to make it working I need to read 4 bytes for version as well as it is 
mentioned in the document it 16.16 format a 32 bit value irrespective of the 
bitness of the program.
So need to create the structure in my own program which has Version as 32 bit 
type. Is my assumption correct.?.

Thanks,
Ankit

From: Jain, Ankit
Sent: Monday, July 10, 2023 7:34 PM
To: freetype@nongnu.org
Subject: Freetype Linux problem with 64 bit program.

Hello,

I am running the attached program in linux as 64 bit program.
Using below command.
g++ -g -m64 -I/ freetype-2.10.0/include  -lfreetype -o freetypetest 
freetypeTest.cpp.

After running I am not getting the correct value for HoriHeader version value. 
It display as 5692055178828579072(should be 256 if it reads 4 bytes).
Version is of type FT_Fixed which is long so it is reading the 8 bytes. But if 
try to read 4 bytes it give me correct value and next 2 byte will give correct 
value of
for the member of structure and so on.

Due to this the data is not placed correctly in memory
A snapshot
p *m_pHoriHeader
$2 = {Version = 5692055178828579072, Ascender = 17152, Descender = 16, Line_Gap 
= -20486, advance_Width_Max = 31482, min_Left_Side_Bearing = 16,
  min_Right_Side_Bearing = 256, xMax_Extent = 0, caret_Slope_Rise = 0, 
caret_Slope_Run = 0, caret_Offset = 0, Reserved = {0, 0, 0, -27119},
  metric_Data_Format = 0, number_Of_HMetrics = 0, long_metrics = 0x4671, 
short_metrics = 0x10006}

ideally version should be 256,Ascender should be 15879 and so on.

Windows OS will not replicate this problem as both int and long types are 4 
bytes.

Appreciate any help to get these value correct for 64 bit. Let me know if you 
have any questions.

Thanks
Ankit
The information contained in this message is proprietary and/or confidential. 
If you are not the intended recipient, please: (i) delete the message and all 
copies; (ii) do not disclose, distribute or use the message in any manner; and 
(iii) notify the sender immediately. In addition, please be aware that any 
message addressed to our domain is subject to archiving and review by persons 
other than the intended recipient. Thank you.

Reply via email to