summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2016-01-10 12:42:12 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2016-01-10 12:42:12 +0000
commit5fb63e19ab4496fd7a0d75dc2744f143c5b9a488 (patch)
tree830839778d6a47f4cc86d225123ab1628f5521c9
parent4fd1fbf68cb07f3cb845c7559ddcaf9e42317ca3 (diff)
downloadnetsurf-5fb63e19ab4496fd7a0d75dc2744f143c5b9a488.tar.gz
netsurf-5fb63e19ab4496fd7a0d75dc2744f143c5b9a488.tar.bz2
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.
-rw-r--r--amiga/font.c9
1 files changed, 7 insertions, 2 deletions
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)
{