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.
This commit is contained in:
Chris Young 2016-01-10 12:42:12 +00:00
parent 4fd1fbf68c
commit 5fb63e19ab

View File

@ -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)
{