From f70e58b4a140600b7a375ecdd0991d8eee64e033 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 24 Mar 2013 11:27:26 +0000 Subject: update posn_in_string loop to be similar to nsfont_split --- amiga/font.c | 56 ++++++++++++++++++-------------------------------------- 1 file changed, 18 insertions(+), 38 deletions(-) (limited to 'amiga') diff --git a/amiga/font.c b/amiga/font.c index bffce633a..ee5ab303c 100644 --- a/amiga/font.c +++ b/amiga/font.c @@ -206,76 +206,56 @@ bool nsfont_position_in_string(const plot_font_style_t *fstyle, uint32 tx=0,i=0; size_t len, utf8len = 0; uint8 *utf8; + int utf8_pos = 0; uint32 co = 0; int utf16charlen; ULONG emwidth = (ULONG)NSA_FONT_EMWIDTH(fstyle->size); int32 tempx; - len = utf8_bounded_length(string, length); if(utf8_to_enc(string,"UTF-16",length,(char **)&utf16) != UTF8_CONVERT_OK) return false; outf16 = utf16; - if(!(ofont = ami_open_outline_font(fstyle, 0))) return false; *char_offset = length; + *actual_x = 0; - for(i=0;i= (length)) - { - *actual_x = tx; - co = length; - } - - *char_offset = co; + *actual_x = tx; + *char_offset = length; free(outf16); - return true; } -- cgit v1.2.3