The FreeType Project - Bugs: bug #39407, TT_OS2 alignment problem
You are not allowed to post comments on this tracker with your current authentication level.
bug #39407: TT_OS2 alignment problem
Submitter: | Ted Dunlop <teddunlop> | ||
Submitted: | Wed 03 Jul 2013 02:46:50 PM UTC | ||
Severity: | 3 - Normal | Item Group: | Hack required |
Status: | Invalid | Privacy: | Public |
Assigned to: | wl | Open/Closed: | Closed |
Planned Release: | None |
Tue 06 Aug 2013 07:05:18 PM UTC, comment #4: |
Werner LEMBERG <wl> |
Mon 05 Aug 2013 03:00:07 PM UTC, comment #3: As I said before: You can't apply the offsets of the `TT_OS2' structure to the data which you directly extract from an SFNT table.
|
Werner LEMBERG <wl> |
Wed 31 Jul 2013 08:12:44 PM UTC, comment #2: I must be missing something:
|
Ted Dunlop <teddunlop> |
Wed 03 Jul 2013 08:21:30 PM UTC, comment #1: What do you mean with `not aligned correctly'? Your pragma hack is definitely wrong. The TT_OS2 structure does not have the same physical layout as the data in the font's `OS/2' table, and the structure elements are read one after another from the font into the structure.
|
Werner LEMBERG <wl> |
Wed 03 Jul 2013 02:46:50 PM UTC, original submission:
fields after panose not aligned correctly in TT_OS2
|
Ted Dunlop <teddunlop> |
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 6 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2013-08-06 | teddunlop | Attached File | - | Added adfreetype.cpp, #28772 | |
Attached File | - | Added adfreetype.h, #28773 | |||
2013-08-05 | wl | Status | Need Info | Invalid | |
Open/Closed | Open | Closed | |||
2013-07-03 | wl | Status | None | Need Info | |
Assigned to | None | wl |
Powered by Savane 3.13-758e.
Corresponding source code
Yes,in your code you assume that
sizeof (TT_OS2) == fontTable_.Size()
which is not correct. For example, in OS2Table::Panose(),
you can't use `offsetof' applied to the `TT_OS2' structure to get the offset into the Panose table within the `OS/2' SFNT table. Instead, you should manually set the offset, something like
const int versionOfset = 0;
const int xAvgCharWidthOffset = 2;
const int usWeightClassOffset = 4;
...
const int panoseOffset = 32;
...
and use those constants.