summaryrefslogtreecommitdiff
path: root/frontends/amiga/os3support.c
diff options
context:
space:
mode:
Diffstat (limited to 'frontends/amiga/os3support.c')
-rw-r--r--frontends/amiga/os3support.c132
1 files changed, 0 insertions, 132 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)