From 5612e6f15a85b8725fa2510ef068872be7a73ba3 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Tue, 6 Jul 2021 15:27:13 +0100 Subject: Amiga: remove compatibility functions that are in diskfont v47 May need to add these back in, force bitmap fonts, or drop compatiblity with OS3.5/9 --- frontends/amiga/os3support.c | 132 ------------------------------------------- frontends/amiga/os3support.h | 18 ------ 2 files changed, 150 deletions(-) diff --git a/frontends/amiga/os3support.c b/frontends/amiga/os3support.c index 63037daf0..23e922a41 100644 --- a/frontends/amiga/os3support.c +++ b/frontends/amiga/os3support.c @@ -200,138 +200,6 @@ long long int strtoll(const char *nptr, char **endptr, int base) return (long long int)strtol(nptr, endptr, base); } -/* Diskfont */ -struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG flags) -{ - BPTR fh = 0; - int64 size = 0; - struct TagItem *ti; - UBYTE *buffer; - STRPTR fname, otagpath, fontpath; - struct BulletBase *BulletBase; - struct OutlineFont *of = NULL; - struct GlyphEngine *gengine; - char *p = 0; - struct FontContentsHeader fch; - - if((p = strrchr(fileName, '.'))) - *p = '\0'; - - fontpath = (STRPTR)ASPrintf("FONTS:%s.font", fileName); - fh = Open(fontpath, MODE_OLDFILE); - - if(fh == 0) { - NSLOG(netsurf, INFO, "Unable to open FONT %s", fontpath); - FreeVec(fontpath); - return NULL; - } - - if(Read(fh, &fch, sizeof(struct FontContentsHeader)) != sizeof(struct FontContentsHeader)) { - NSLOG(netsurf, INFO, "Unable to read FONT %s", fontpath); - FreeVec(fontpath); - Close(fh); - return NULL; - } - - Close(fh); - - if(fch.fch_FileID != OFCH_ID) { - NSLOG(netsurf, INFO, "%s is not an outline font!", fontpath); - FreeVec(fontpath); - return NULL; - } - - otagpath = (STRPTR)ASPrintf("FONTS:%s.otag", fileName); - fh = Open(otagpath, MODE_OLDFILE); - - if(p) *p = '.'; - - if(fh == 0) { - NSLOG(netsurf, INFO, "Unable to open OTAG %s", otagpath); - FreeVec(otagpath); - return NULL; - } - - size = GetFileSize(fh); - buffer = (UBYTE *)malloc(size); - if(buffer == NULL) { - NSLOG(netsurf, INFO, "Unable to allocate memory"); - Close(fh); - FreeVec(otagpath); - return NULL; - } - - Read(fh, buffer, size); - Close(fh); - - /* The first tag is supposed to be OT_FileIdent and should equal 'size' */ - struct TagItem *tag = (struct TagItem *)buffer; - if((tag->ti_Tag != OT_FileIdent) || (tag->ti_Data != (ULONG)size)) { - NSLOG(netsurf, INFO, "Invalid OTAG file"); - free(buffer); - FreeVec(otagpath); - return NULL; - } - - /* Relocate all the OT_Indirect tags */ - while((ti = NextTagItem(&tag))) { - if(ti->ti_Tag & OT_Indirect) { - ti->ti_Data += (ULONG)buffer; - } - } - - /* Find OT_Engine and open the font engine */ - if(ti = FindTagItem(OT_Engine, buffer)) { - NSLOG(netsurf, INFO, "Using font engine %s", ti->ti_Data); - fname = ASPrintf("%s.library", ti->ti_Data); - } else { - NSLOG(netsurf, INFO, "Cannot find OT_Engine tag"); - free(buffer); - FreeVec(otagpath); - return NULL; - } - - BulletBase = (struct BulletBase *)OpenLibrary(fname, 0L); - - if(BulletBase == NULL) { - NSLOG(netsurf, INFO, "Unable to open font engine %s", fname); - free(buffer); - FreeVec(fname); - FreeVec(otagpath); - } - - FreeVec(fname); - - gengine = OpenEngine(); - - SetInfo(gengine, - OT_OTagPath, (ULONG)otagpath, - OT_OTagList, (ULONG)buffer, - TAG_DONE); - - of = calloc(1, sizeof(struct OutlineFont)); - if(of == NULL) return NULL; - - of->BulletBase = BulletBase; - of->GEngine = gengine; - of->OTagPath = otagpath; - of->olf_OTagList = buffer; - - return of; -} - -void CloseOutlineFont(struct OutlineFont *of, struct List *list) -{ - struct BulletBase *BulletBase = of->BulletBase; - - CloseEngine(of->GEngine); - CloseLibrary((struct Library *)BulletBase); - - FreeVec(of->OTagPath); - free(of->olf_OTagList); - free(of); -} - /* DOS */ int64 GetFileSize(BPTR fh) diff --git a/frontends/amiga/os3support.h b/frontends/amiga/os3support.h index f511012a8..0deda9a0d 100644 --- a/frontends/amiga/os3support.h +++ b/frontends/amiga/os3support.h @@ -123,8 +123,6 @@ #define BVS_DISPLAY BVS_NONE #define DN_FULLPATH 0 #define BGBACKFILL JAM1 -#define OFF_OPEN 0 -#define AFF_OTAG 0 #define ML_SEPARATOR NM_BARLABEL #define LBS_ROWS 0 @@ -144,10 +142,6 @@ #define Notify(...) (void)0 /* diskfont */ -#define EReleaseInfo ReleaseInfo -#define EObtainInfo ObtainInfo -#define ESetInfo SetInfo - /* Only used in one place we haven't ifdeffed, where it returns the charset name */ #define ObtainCharsetInfo(A,B,C) (const char *)nsoption_charp(local_charset) @@ -181,14 +175,6 @@ typedef uint32_t uint32; typedef int64_t int64; typedef uint64_t uint64; -/* OutlineFont */ -struct OutlineFont { - struct BulletBase *BulletBase; - struct GlyphEngine *GEngine; - STRPTR OTagPath; - struct TagItem *olf_OTagList; -}; - /* BackFillMessage */ struct BackFillMessage { struct Layer *Layer; @@ -218,10 +204,6 @@ enum { }; /* Functions */ -/* Diskfont */ -void CloseOutlineFont(struct OutlineFont *of, struct List *list); -struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG flags); - /* DOS */ int64 GetFileSize(BPTR fh); void FreeSysObject(ULONG type, APTR obj); -- cgit v1.2.3