summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2009-09-23 21:52:36 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2009-09-23 21:52:36 +0000
commita80a4968bd9fb75964ec45cc1ec95c10d4dd5354 (patch)
treec536085847530d7ce5aed9efc64647dd1e511761
parent41a2a71c2a84ad76638adfdb403c1132dec76089 (diff)
downloadnetsurf-a80a4968bd9fb75964ec45cc1ec95c10d4dd5354.tar.gz
netsurf-a80a4968bd9fb75964ec45cc1ec95c10d4dd5354.tar.bz2
fix text cursor positioning some more
svn path=/trunk/netsurf/; revision=9597
-rw-r--r--amiga/font.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/amiga/font.c b/amiga/font.c
index 0c46350ac..a4ae8f0e9 100644
--- a/amiga/font.c
+++ b/amiga/font.c
@@ -94,7 +94,7 @@ bool nsfont_position_in_string(const plot_font_style_t *fstyle,
struct OutlineFont *ofont;
struct GlyphMap *glyph;
uint32 tx=0,i=0;
- size_t len,utf8len;
+ size_t len, utf8len = 0;
uint8 *utf8;
uint32 co = 0;
int utf16charlen;
@@ -114,9 +114,6 @@ bool nsfont_position_in_string(const plot_font_style_t *fstyle,
else
utf16charlen = 2;
- utf8len = utf8_char_byte_length(string);
- string += utf8len;
-
if(ESetInfo(&ofont->olf_EEngine,
OT_GlyphCode,*utf16,
TAG_END) == OTERR_Success)
@@ -142,10 +139,13 @@ bool nsfont_position_in_string(const plot_font_style_t *fstyle,
TAG_END);
}
}
+
+ utf8len = utf8_char_byte_length(string);
+ string += utf8len;
utf16 += utf16charlen;
}
- if(co == length)
+ if(co == (length - 1))
{
*actual_x = tx;
co = length;