From a4ff885365f95afb672efea589ed30b0a2ae47b0 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Wed, 2 May 2012 18:29:59 +0000 Subject: Ensure we are using the faster(?) character size functions in all applicable places. svn path=/trunk/netsurf/; revision=13901 --- amiga/font.c | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) (limited to 'amiga/font.c') diff --git a/amiga/font.c b/amiga/font.c index 2f3817e7d..ef35cb23b 100644 --- a/amiga/font.c +++ b/amiga/font.c @@ -724,12 +724,21 @@ ULONG ami_unicode_text(struct RastPort *rp,const char *string,ULONG length,const utf16charsc = ami_font_translate_smallcaps(*utf16); utf16nextsc = ami_font_translate_smallcaps(utf16next); - tempx = ami_font_plot_glyph(ofont, rp, utf16charsc, utf16nextsc, dx + x, dy, emwidth); + if(rp) { + tempx = ami_font_plot_glyph(ofont, rp, utf16charsc, utf16nextsc, dx + x, dy, emwidth); + } else { + tempx = ami_font_width_glyph(ofont, utf16charsc, utf16nextsc, emwidth); + } } else tempx = 0; - if(tempx == 0) - tempx = ami_font_plot_glyph(ofont, rp, *utf16, utf16next, dx + x, dy, emwidth); + if(tempx == 0) { + if(rp) { + tempx = ami_font_plot_glyph(ofont, rp, *utf16, utf16next, dx + x, dy, emwidth); + } else { + tempx = ami_font_width_glyph(ofont, *utf16, utf16next, emwidth); + } + } if(tempx == 0) { @@ -740,14 +749,22 @@ ULONG ami_unicode_text(struct RastPort *rp,const char *string,ULONG length,const if(ufont) { - tempx = ami_font_plot_glyph(ufont, rp, *utf16, utf16next, - dx + x, dy, emwidth); + if(rp) { + tempx = ami_font_plot_glyph(ufont, rp, *utf16, utf16next, + dx + x, dy, emwidth); + } else { + tempx = ami_font_width_glyph(ufont, *utf16, utf16next, emwidth); + } } /* if(tempx == 0) { - tempx = ami_font_plot_glyph(ofont, rp, 0xfffd, utf16next, - dx + x, dy, emwidth); + if(rp) { + tempx = ami_font_plot_glyph(ofont, rp, 0xfffd, utf16next, + dx + x, dy, emwidth); + } else { + tempx = ami_font_width_glyph(ofont, 0xfffd, utf16next, emwidth); + } } */ } -- cgit v1.2.3