summaryrefslogtreecommitdiff
path: root/amiga
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2009-07-02 23:07:04 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2009-07-02 23:07:04 +0000
commitb8f6dfd58d6466a3f36bb23378112405c79060f0 (patch)
tree1f6f6d853b2a510b261753e37142988835f1c708 /amiga
parent2dbf92761feb90ea1293be787135cffea7cab4cd (diff)
downloadnetsurf-b8f6dfd58d6466a3f36bb23378112405c79060f0.tar.gz
netsurf-b8f6dfd58d6466a3f36bb23378112405c79060f0.tar.bz2
Minor positional changes. This code probably needs a rethink as it doesn't correctly
advance for two-byte UTF8 chars. svn path=/trunk/netsurf/; revision=8276
Diffstat (limited to 'amiga')
-rw-r--r--amiga/font.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/amiga/font.c b/amiga/font.c
index f77d66d6b..405065dd7 100644
--- a/amiga/font.c
+++ b/amiga/font.c
@@ -117,7 +117,7 @@ bool nsfont_position_in_string(const struct css_style *style,
OT_GlyphMap8Bit,&glyph,
TAG_END) == 0)
{
- if(utf8_from_enc((char *)utf16,"UTF-16",4,(char **)&utf8) != UTF8_CONVERT_OK) return false;
+ if(utf8_from_enc((char *)utf16,"UTF-16",2,(char **)&utf8) != UTF8_CONVERT_OK) return false;
utf8len = utf8_char_byte_length(utf8);
free(utf8);
@@ -130,7 +130,7 @@ bool nsfont_position_in_string(const struct css_style *style,
co += utf8len;
}
- *actual_x = tx;
+ *actual_x = tx + (glyph->glm_X1 / 2);
tx+= glyph->glm_X1;
EReleaseInfo(&ofont->olf_EEngine,
@@ -309,6 +309,7 @@ ULONG ami_unicode_text(struct RastPort *rp,const char *string,ULONG length,const
uint32 width,height;
uint32 x=0,y=0;
size_t len;
+ uint8 co = 0;
if(!string || string[0]=='\0') return 0;
if(!length) return 0;