summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--amiga/font.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/amiga/font.c b/amiga/font.c
index 3bc72e1eb..7c45049b0 100644
--- a/amiga/font.c
+++ b/amiga/font.c
@@ -334,14 +334,8 @@ struct ami_font_node *ami_font_open(const char *font)
LOG(("Font cache miss: %s", font));
nodedata = AllocVec(sizeof(struct ami_font_node), MEMF_PRIVATE | MEMF_CLEAR);
-
- node = AddObject(ami_font_list, AMINS_FONT);
- if(!node) return NULL;
-
- node->objstruct = nodedata;
- node->dtz_Node.ln_Name = strdup(font);
-
nodedata->font = OpenOutlineFont(font, &ami_diskfontlib_list, OFF_OPEN);
+
if(!nodedata->font)
{
LOG(("Requested font not found: %s", font));
@@ -369,6 +363,13 @@ struct ami_font_node *ami_font_open(const char *font)
GetSysTime(&nodedata->lastused);
+ node = AddObject(ami_font_list, AMINS_FONT);
+ if(node)
+ {
+ node->objstruct = nodedata;
+ node->dtz_Node.ln_Name = strdup(font);
+ }
+
return nodedata;
}