diff options
Diffstat (limited to 'amiga')
-rw-r--r-- | amiga/font.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/amiga/font.c b/amiga/font.c index 95c8a47af..67d65cdde 100644 --- a/amiga/font.c +++ b/amiga/font.c @@ -111,7 +111,7 @@ bool nsfont_position_in_string(const plot_font_style_t *fstyle, *char_offset = length; - for(i=0;i<len;i++) + for(i=0;i<=len;i++) { if (*utf16 < 0xD800 || 0xDFFF < *utf16) utf16charlen = 1; @@ -120,10 +120,7 @@ bool nsfont_position_in_string(const plot_font_style_t *fstyle, utf8len = utf8_char_byte_length(string); - if((i + 1) < len) - utf16next = utf16[utf16charlen]; - else - utf16next = 0; + utf16next = utf16[utf16charlen]; if(ESetInfo(&ofont->olf_EEngine, OT_GlyphCode, *utf16, @@ -221,7 +218,7 @@ bool nsfont_split(const plot_font_style_t *fstyle, *char_offset = 0; *actual_x = 0; - for(i=0;i<len;i++) + for(i=0;i<=len;i++) { utf8len = utf8_char_byte_length(string+utf8clen); @@ -230,10 +227,7 @@ bool nsfont_split(const plot_font_style_t *fstyle, else utf16charlen = 2; - if((i + 1) < len) - utf16next = utf16[utf16charlen]; - else - utf16next = 0; + utf16next = utf16[utf16charlen]; if(ESetInfo(&ofont->olf_EEngine, OT_GlyphCode, *utf16, @@ -354,17 +348,14 @@ ULONG ami_unicode_text(struct RastPort *rp,const char *string,ULONG length,const dy++; - for(i=0;i<len;i++) + for(i=0;i<=len;i++) { if (*utf16 < 0xD800 || 0xDFFF < *utf16) utf16charlen = 1; else utf16charlen = 2; - if((i + 1) < len) - utf16next = utf16[utf16charlen]; - else - utf16next = 0; + utf16next = utf16[utf16charlen]; if(ESetInfo(&ofont->olf_EEngine, OT_GlyphCode, *utf16, |