diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2009-01-18 12:15:48 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2009-01-18 12:15:48 +0000 |
commit | ddd59deaf22c7b8e834f695b40540c235d0725b9 (patch) | |
tree | 403a0f95022dcb92ab5ded05c4f85151d0fc3749 /amiga | |
parent | e5a5bbec3f8a7d6c31ccb5bf7f26338f80570a05 (diff) | |
download | netsurf-ddd59deaf22c7b8e834f695b40540c235d0725b9.tar.gz netsurf-ddd59deaf22c7b8e834f695b40540c235d0725b9.tar.bz2 |
position in string was off by one
svn path=/trunk/netsurf/; revision=6141
Diffstat (limited to 'amiga')
-rw-r--r-- | amiga/font.c | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/amiga/font.c b/amiga/font.c index 7d98177db..dec063558 100644 --- a/amiga/font.c +++ b/amiga/font.c @@ -36,7 +36,7 @@ #include <parserutils/charset/utf8.h> #include <parserutils/charset/utf16.h> -struct OutlineFont *of[CSS_FONT_FAMILY_NOT_SET]; +static struct OutlineFont *of[CSS_FONT_FAMILY_NOT_SET]; struct OutlineFont *ami_open_outline_font(struct css_style *style); @@ -139,12 +139,15 @@ bool nsfont_position_in_string(const struct css_style *style, *actual_x = tx; if(utf8_from_enc(utf16,"UTF-16",4,&utf8) != UTF8_CONVERT_OK) return; parserutils_charset_utf8_char_byte_length(utf8,&utf8len); - co += utf8len; if(x<tx+glyph->glm_X1) { i = len+1; } + else + { + co += utf8len; + } tx+= glyph->glm_X1; @@ -384,7 +387,7 @@ struct OutlineFont *ami_open_outline_font(struct css_style *style) /* see diskfont implementation for currently unimplemented bold/italic stuff */ - ysize = css_len2px(&style->font_size.value.length, style); + ysize = css_len2pt(&style->font_size.value.length, style); if(ysize < option_font_min_size) ysize = option_font_min_size; @@ -482,6 +485,9 @@ ULONG ami_unicode_text(struct RastPort *rp,char *string,ULONG length,struct css_ void ami_init_fonts(void) { + int i; + char *bname,*iname,*biname; + if(!option_quick_text) { of[CSS_FONT_FAMILY_SANS_SERIF] = OpenOutlineFont(option_font_sans,NULL,OFF_OPEN); @@ -491,6 +497,26 @@ void ami_init_fonts(void) of[CSS_FONT_FAMILY_FANTASY] = OpenOutlineFont(option_font_fantasy,NULL,OFF_OPEN); of[CSS_FONT_FAMILY_UNKNOWN] = OpenOutlineFont(option_font_sans,NULL,OFF_OPEN); of[CSS_FONT_FAMILY_NOT_SET] = OpenOutlineFont(option_font_sans,NULL,OFF_OPEN); + +#if 0 + for(i=CSS_FONT_FAMILY_SANS_SERIF;i<=CSS_FONT_FAMILY_NOT_SET;i++) + { + if(EObtainInfo(&of[i]->olf_EEngine, + OT_BName,&bname, + OT_IName,&iname, + OT_BIName,&biname, + TAG_END) == 0) + { + printf("%s\n",bname); + + EReleaseInfo(&of[i]->olf_EEngine, + OT_BName,bname, + OT_IName,iname, + OT_BIName,biname, + TAG_END); + } + } +#endif } } |