forked from minhngoc25a/freetype2
* Improve resource fork handler for POSIX
This commit is contained in:
parent
ec5b4508cc
commit
7a7d403d7a
|
@ -1,3 +1,11 @@
|
||||||
|
2006-12-15 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
|
||||||
|
|
||||||
|
* src/base/ftobjs.c: Improvement of resource fork handler for POSIX,
|
||||||
|
http://lists.gnu.org/archive/html/freetype-devel/2006-10/msg00025.html
|
||||||
|
(Mac_Read_sfnt_Resource): Count only `sfnt' resource of suitcase font
|
||||||
|
format or .dfont, to simulate the face index number counted by ftmac.c.
|
||||||
|
(IsMacResource): Return the number of scalable faces correctly.
|
||||||
|
|
||||||
2006-12-10 Werner Lemberg <wl@gnu.org>
|
2006-12-10 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
* builds/toplevel.mk (version): Protect against `distclean' target.
|
* builds/toplevel.mk (version): Protect against `distclean' target.
|
||||||
|
|
|
@ -1371,6 +1371,7 @@
|
||||||
FT_Long flag_offset;
|
FT_Long flag_offset;
|
||||||
FT_Long rlen;
|
FT_Long rlen;
|
||||||
int is_cff;
|
int is_cff;
|
||||||
|
FT_Long face_index_in_resource = 0;
|
||||||
|
|
||||||
|
|
||||||
if ( face_index == -1 )
|
if ( face_index == -1 )
|
||||||
|
@ -1402,7 +1403,7 @@
|
||||||
error = open_face_from_buffer( library,
|
error = open_face_from_buffer( library,
|
||||||
sfnt_data,
|
sfnt_data,
|
||||||
rlen,
|
rlen,
|
||||||
face_index,
|
face_index_in_resource,
|
||||||
is_cff ? "cff" : "truetype",
|
is_cff ? "cff" : "truetype",
|
||||||
aface );
|
aface );
|
||||||
|
|
||||||
|
@ -1444,6 +1445,8 @@
|
||||||
error = Mac_Read_POST_Resource( library, stream, data_offsets, count,
|
error = Mac_Read_POST_Resource( library, stream, data_offsets, count,
|
||||||
face_index, aface );
|
face_index, aface );
|
||||||
FT_FREE( data_offsets );
|
FT_FREE( data_offsets );
|
||||||
|
/* POST exists in a LWFN providing single face */
|
||||||
|
(*aface)->num_faces = 1;
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1453,9 +1456,13 @@
|
||||||
&data_offsets, &count );
|
&data_offsets, &count );
|
||||||
if ( !error )
|
if ( !error )
|
||||||
{
|
{
|
||||||
|
FT_Long face_index_internal = face_index % count;
|
||||||
|
|
||||||
|
|
||||||
error = Mac_Read_sfnt_Resource( library, stream, data_offsets, count,
|
error = Mac_Read_sfnt_Resource( library, stream, data_offsets, count,
|
||||||
face_index, aface );
|
face_index_internal, aface );
|
||||||
FT_FREE( data_offsets );
|
FT_FREE( data_offsets );
|
||||||
|
(*aface)->num_faces = count;
|
||||||
}
|
}
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
|
|
Loading…
Reference in New Issue