[base] Remove a check for resource ID in the resource fork driver.

LastResort.dfont has a marginal resource ID 0xFFFF for sfnt
resource.  Inside Macintosh: More Macintosh Toolbox, `Resource IDs'
(1-46), tells that some IDs are reserved and should not be used.
FreeType2 just uses resource ID to sort the fragmented resource.
To accept the marginal fonts, the checking is removed.

* src/base/ftrfork.c (FT_Raccess_Get_DataOffsets): Remove res_id
validity check, fix a trace message format.
This commit is contained in:
suzuki toshiya 2017-09-09 01:28:24 +09:00
parent 71f661804e
commit 3ef59e59e0
2 changed files with 21 additions and 2 deletions

View File

@ -1,3 +1,16 @@
2017-09-08 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
[base] Remove a check for resource ID in the resource fork driver.
LastResort.dfont has a marginal resource ID 0xFFFF for sfnt
resource. Inside Macintosh: More Macintosh Toolbox, `Resource IDs'
(1-46), tells that some IDs are reserved and should not be used.
FreeType2 just uses resource ID to sort the fragmented resource.
To accept the marginal fonts, the checking is removed.
* src/base/ftrfork.c (FT_Raccess_Get_DataOffsets): Remove res_id
validity check, fix a trace message format.
2017-09-08 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
[sfnt, truetype] Register the tags for marginal fonts.

View File

@ -271,7 +271,13 @@
if ( FT_STREAM_SKIP( 4 ) ) /* mbz */
goto Exit;
if ( ref[j].res_id < 0 || temp < 0 )
/*
* According to Inside Macintosh: More Macintosh Toolbox,
* "Resource IDs" (1-46), there are some reserved IDs.
* However, FreeType2 is not a font synthesizer, no need
* to check the acceptable resource ID.
*/
if ( temp < 0 )
{
error = FT_THROW( Invalid_Table );
goto Exit;
@ -281,7 +287,7 @@
FT_TRACE3(( " [%d]:"
" resource_id=0x%04x, offset=0x%08x\n",
j, ref[j].res_id, ref[j].offset ));
j, (FT_UShort)ref[j].res_id, ref[j].offset ));
}
if ( sort_by_res_id )