mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-17 01:33:16 +03:00
Fix OT_Indirect handling
This commit is contained in:
parent
4865b1603b
commit
9a6e339ab2
@ -47,7 +47,8 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl
|
|||||||
{
|
{
|
||||||
BPTR fh = 0;
|
BPTR fh = 0;
|
||||||
int64 size = 0;
|
int64 size = 0;
|
||||||
struct TagItem *buffer, *ti;
|
struct TagItem *ti;
|
||||||
|
UBYTE *buffer;
|
||||||
STRPTR fname, otagpath;
|
STRPTR fname, otagpath;
|
||||||
struct BulletBase *BulletBase;
|
struct BulletBase *BulletBase;
|
||||||
struct OutlineFont *of = NULL;
|
struct OutlineFont *of = NULL;
|
||||||
@ -78,7 +79,7 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl
|
|||||||
Close(fh);
|
Close(fh);
|
||||||
|
|
||||||
/* The first tag is supposed to be OT_FileIdent and should equal 'size' */
|
/* The first tag is supposed to be OT_FileIdent and should equal 'size' */
|
||||||
struct TagItem *tag = buffer;
|
struct TagItem *tag = (struct TagItem *)buffer;
|
||||||
if((tag->ti_Tag != OT_FileIdent) || (tag->ti_Data != (ULONG)size)) {
|
if((tag->ti_Tag != OT_FileIdent) || (tag->ti_Data != (ULONG)size)) {
|
||||||
LOG(("Invalid OTAG file"));
|
LOG(("Invalid OTAG file"));
|
||||||
FreeVec(buffer);
|
FreeVec(buffer);
|
||||||
@ -87,9 +88,7 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Relocate all the OT_Indirect tags */
|
/* Relocate all the OT_Indirect tags */
|
||||||
struct TagItem *tstate = buffer;
|
while (ti = NextTagItem(&tag)) {
|
||||||
|
|
||||||
while (ti = NextTagItem(&tstate)) {
|
|
||||||
if(ti->ti_Tag & OT_Indirect) {
|
if(ti->ti_Tag & OT_Indirect) {
|
||||||
ti->ti_Data += buffer;
|
ti->ti_Data += buffer;
|
||||||
}
|
}
|
||||||
@ -131,6 +130,8 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl
|
|||||||
of->olf_EEngine = eengine;
|
of->olf_EEngine = eengine;
|
||||||
of->OTagPath = otagpath;
|
of->OTagPath = otagpath;
|
||||||
of->olf_OTagList = buffer;
|
of->olf_OTagList = buffer;
|
||||||
|
|
||||||
|
return of;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CloseOutlineFont(struct OutlineFont *of, struct List *list)
|
void CloseOutlineFont(struct OutlineFont *of, struct List *list)
|
||||||
|
Loading…
Reference in New Issue
Block a user