From 5fb63e19ab4496fd7a0d75dc2744f143c5b9a488 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 10 Jan 2016 12:42:12 +0000 Subject: If the specified font won't open, use the fallback font for character 'A'. This helps stop pages showing up blank when the default fonts are wrong. --- amiga/font.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'amiga/font.c') diff --git a/amiga/font.c b/amiga/font.c index 8848021b3..5197b32c7 100644 --- a/amiga/font.c +++ b/amiga/font.c @@ -800,7 +800,9 @@ ULONG ami_font_unicode_text(struct RastPort *rp, const char *string, ULONG lengt if(utf8_to_enc(string,"UTF-16",length,(char **)&utf16) != NSERROR_OK) return 0; outf16 = utf16; - if(!(ofont = ami_open_outline_font(fstyle, 0))) return 0; + if(!(ofont = ami_open_outline_font(fstyle, 0))) { + if(!(ofont = ami_open_outline_font(fstyle, 'A'))) return 0; + } while(*utf16 != 0) { @@ -861,7 +863,10 @@ static inline ULONG ami_font_unicode_width(const char *string, ULONG length, if(utf8_to_enc(string,"UTF-16",length,(char **)&utf16) != NSERROR_OK) return 0; outf16 = utf16; - if(!(ofont = ami_open_outline_font(fstyle, 0))) return 0; + if(!(ofont = ami_open_outline_font(fstyle, 0))) { + if(!(ofont = ami_open_outline_font(fstyle, 'A'))) return 0; + + } while(*utf16 != 0) { -- cgit v1.2.3