diff options
Diffstat (limited to 'frontends/amiga/font_diskfont.c')
-rw-r--r-- | frontends/amiga/font_diskfont.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/frontends/amiga/font_diskfont.c b/frontends/amiga/font_diskfont.c index 658829237..be1b89194 100644 --- a/frontends/amiga/font_diskfont.c +++ b/frontends/amiga/font_diskfont.c @@ -55,7 +55,6 @@ static struct TextFont *ami_font_bm_open(struct RastPort *rp, const plot_font_st (fstyle->size == prev_fstyle->size) && (fstyle->flags == prev_fstyle->flags) && (fstyle->weight == prev_fstyle->weight)) { - NSLOG(netsurf, INFO, "(using current font)"); return prev_font; } @@ -98,10 +97,13 @@ static struct TextFont *ami_font_bm_open(struct RastPort *rp, const plot_font_st snprintf(font, MAX_FONT_NAME_SIZE, "%s.font", fontname); tattr.ta_Name = font; - tattr.ta_YSize = fstyle->size / FONT_SIZE_SCALE; + tattr.ta_YSize = fstyle->size / PLOT_STYLE_SCALE; NSLOG(netsurf, INFO, "font: %s/%d", tattr.ta_Name, tattr.ta_YSize); - if(prev_font != NULL) CloseFont(prev_font); + if(prev_font != NULL) { + CloseFont(prev_font); + prev_font = NULL; + } if((bmfont = OpenDiskFont(&tattr))) { SetRPAttrs(rp, RPTAG_Font, bmfont, TAG_DONE); @@ -301,7 +303,14 @@ void ami_font_diskfont_init(void) void ami_font_diskfont_fini(void) { - if(prev_font != NULL) CloseFont(prev_font); - if(prev_fstyle != NULL) free(prev_fstyle); + if(prev_font != NULL) { + CloseFont(prev_font); + prev_font = NULL; + } + + if(prev_fstyle != NULL) { + free(prev_fstyle); + prev_fstyle = NULL; + } } |