diff options
Diffstat (limited to 'frontends/amiga/font_bullet.c')
-rw-r--r-- | frontends/amiga/font_bullet.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/frontends/amiga/font_bullet.c b/frontends/amiga/font_bullet.c index c8ad34c04..43f7b9488 100644 --- a/frontends/amiga/font_bullet.c +++ b/frontends/amiga/font_bullet.c @@ -1,5 +1,5 @@ /* - * Copyright 2008 - 2016 Chris Young <chris@unsatisfactorysoftware.co.uk> + * Copyright 2008 - 2019 Chris Young <chris@unsatisfactorysoftware.co.uk> * * This file is part of NetSurf, http://www.netsurf-browser.org/ * @@ -63,7 +63,7 @@ #define NSA_VALUE_SHEARSIN (1 << 14) #define NSA_VALUE_SHEARCOS (1 << 16) -#define NSA_FONT_EMWIDTH(s) (s / FONT_SIZE_SCALE) * (ami_font_dpi_get_xdpi() / 72.0) +#define NSA_FONT_EMWIDTH(s) (s / PLOT_STYLE_SCALE) * (ami_font_dpi_get_xdpi() / 72.0) const uint16 sc_table[] = { 0x0061, 0x1D00, /* a */ @@ -82,7 +82,7 @@ const uint16 sc_table[] = { 0x006E, 0x0274, /* n */ 0x006F, 0x1D0F, /* o */ 0x0070, 0x1D18, /* p */ - 0x0071, 0xA7EE, /* q (proposed) (Adobe codepoint 0xF771) */ + 0x0071, 0xA7AF, /* q */ 0x0072, 0x0280, /* r */ 0x0073, 0xA731, /* s */ 0x0074, 0x1D1B, /* t */ @@ -169,7 +169,9 @@ static nserror amiga_nsfont_width(const plot_font_style_t *fstyle, { *width = ami_font_unicode_width(string, length, fstyle, 0, 0, false); - if(*width <= 0) *width == length; // fudge + if(*width <= 0) { + *width = length; /* fudge */ + } return NSERROR_OK; } @@ -347,6 +349,11 @@ static nserror amiga_nsfont_split(const plot_font_style_t *fstyle, */ static struct ami_font_cache_node *ami_font_open(const char *font, bool critical) { + if(font == NULL) { + NSLOG(netsurf, INFO, "Requested NULL font"); + return NULL; + } + struct ami_font_cache_node *nodedata = ami_font_cache_locate(font); if(nodedata) return nodedata; @@ -512,7 +519,7 @@ static struct OutlineFont *ami_open_outline_font(const plot_font_style_t *fstyle } /* Scale to 16.16 fixed point */ - ysize = fstyle->size * ((1 << 16) / FONT_SIZE_SCALE); + ysize = fstyle->size * ((1 << 16) / PLOT_STYLE_SCALE); if(designed_node == NULL) { ofont = node->font; @@ -547,6 +554,7 @@ static inline int32 ami_font_plot_glyph(struct OutlineFont *ofont, struct RastPo FIXED kern = 0; ULONG glyphmaptag; ULONG template_type; + bool skip_c2 = false; uint32 long_char_1 = 0, long_char_2 = 0; #ifndef __amigaos4__ struct BulletBase *BulletBase = ofont->BulletBase; @@ -564,6 +572,8 @@ static inline int32 ami_font_plot_glyph(struct OutlineFont *ofont, struct RastPo } #endif + if (*char2 < 0x0020) skip_c2 = true; + #ifdef __amigaos4__ if(__builtin_expect(aa == true, 1)) { glyphmaptag = OT_GlyphMap8Bit; @@ -626,7 +636,7 @@ static inline int32 ami_font_plot_glyph(struct OutlineFont *ofont, struct RastPo kern = 0; - if(*char2) EObtainInfo(AMI_OFONT_ENGINE, + if((*char2) && (!skip_c2)) EObtainInfo(AMI_OFONT_ENGINE, OT_TextKernPair, &kern, TAG_END); @@ -636,7 +646,7 @@ static inline int32 ami_font_plot_glyph(struct OutlineFont *ofont, struct RastPo glyphmaptag, glyph, TAG_END); - if(*char2) EReleaseInfo(AMI_OFONT_ENGINE, + if((*char2) && (!skip_c2)) EReleaseInfo(AMI_OFONT_ENGINE, OT_TextKernPair, kern, TAG_END); } |