Author: chris_y
Date: Tue Jan 20 10:53:06 2009
New Revision: 6155
URL: http://source.netsurf-browser.org?rev=6155&view=rev
Log:
Implement bold and italic font rendering for Unicode display and make it the
default.
Modified:
trunk/netsurf/amiga/dist/NetSurf.guide
trunk/netsurf/amiga/dist/netsurf.readme
trunk/netsurf/amiga/font.c
trunk/netsurf/amiga/font.h
trunk/netsurf/amiga/options.h
Modified: trunk/netsurf/amiga/dist/NetSurf.guide
URL:
http://source.netsurf-browser.org/trunk/netsurf/amiga/dist/NetSurf.guide?rev=6155&r1=6154&r2=6155&view=diff
==============================================================================
--- trunk/netsurf/amiga/dist/NetSurf.guide (original)
+++ trunk/netsurf/amiga/dist/NetSurf.guide Tue Jan 20 10:53:06 2009
@@ -44,7 +44,7 @@
@{b}recent_f...@{ub} Path to file to store recent history list
@{b}arexx_...@{ub} Path to ARexx scripts dir
@{b}download_...@{ub} default download destination
-...@{b}quick_text@{ub} disable for experimental Unicode display
+...@{b}quick_text@{ub} enable for local charset text only (not recommended)
@{b}delay_red...@{ub} slows down redraw interval
@endnode
Modified: trunk/netsurf/amiga/dist/netsurf.readme
URL:
http://source.netsurf-browser.org/trunk/netsurf/amiga/dist/netsurf.readme?rev=6155&r1=6154&r2=6155&view=diff
==============================================================================
--- trunk/netsurf/amiga/dist/netsurf.readme (original)
+++ trunk/netsurf/amiga/dist/netsurf.readme Tue Jan 20 10:53:06 2009
@@ -2,9 +2,9 @@
Uploader: [email protected] (Chris Young)
Author: NetSurf contributors (OS4 port by Chris Young)
Type: comm/www
-Version: 2.0 development (SVN 5591)
+Version: 2.0 development (SVN 5911)
Architecture: ppc-amigaos >= 4.0.0
-Requires: AISS, dev/c/pthreads.lha
+Requires: AISS
This is a preview release of the OS4 native port of NetSurf.
It is beta software, which means it is unstable and missing
@@ -14,6 +14,9 @@
in order to fix bugs for the real release and to prioritise
features.
+IF YOU UPDATE AN OLDER VERSION YOU MAY NEED TO ADD
+screen_depth:32 TO YOUR RESOURCES/OPTIONS FILE
+
Please report bugs to [email protected],
on the Amigans.net forums or in the bug tracker at
http://www.unsatisfactorysoftware.co.uk/bugs (the bug tracker
Modified: trunk/netsurf/amiga/font.c
URL:
http://source.netsurf-browser.org/trunk/netsurf/amiga/font.c?rev=6155&r1=6154&r2=6155&view=diff
==============================================================================
--- trunk/netsurf/amiga/font.c (original)
+++ trunk/netsurf/amiga/font.c Tue Jan 20 10:53:06 2009
@@ -35,8 +35,12 @@
#include "amiga/options.h"
#include <parserutils/charset/utf8.h>
#include <parserutils/charset/utf16.h>
+#include <proto/utility.h>
static struct OutlineFont *of[CSS_FONT_FAMILY_NOT_SET];
+static struct OutlineFont *ofb[CSS_FONT_FAMILY_NOT_SET];
+static struct OutlineFont *ofi[CSS_FONT_FAMILY_NOT_SET];
+static struct OutlineFont *ofbi[CSS_FONT_FAMILY_NOT_SET];
struct OutlineFont *ami_open_outline_font(struct css_style *style);
@@ -382,10 +386,45 @@
struct OutlineFont *ofont;
char *fontname;
WORD ysize;
-
- ofont = of[style->font_family];
-
-/* see diskfont implementation for currently unimplemented bold/italic stuff */
+ int tstyle = 0;
+
+ switch(style->font_style)
+ {
+ case CSS_FONT_STYLE_ITALIC:
+ case CSS_FONT_STYLE_OBLIQUE:
+ tstyle += NSA_ITALIC;
+ break;
+ }
+
+ switch(style->font_weight)
+ {
+ case CSS_FONT_WEIGHT_BOLD:
+ case CSS_FONT_WEIGHT_BOLDER:
+ tstyle += NSA_BOLD;
+ break;
+ }
+
+ switch(tstyle)
+ {
+ case NSA_ITALIC:
+ if(ofi[style->font_family]) ofont =
ofi[style->font_family];
+ else ofont = of[style->font_family];
+ break;
+
+ case NSA_BOLD:
+ if(ofb[style->font_family]) ofont =
ofb[style->font_family];
+ else ofont = of[style->font_family];
+ break;
+
+ case NSA_BOLDITALIC:
+ if(ofbi[style->font_family]) ofont =
ofbi[style->font_family];
+ else ofont = of[style->font_family];
+ break;
+
+ default:
+ ofont = of[style->font_family];
+ break;
+ }
ysize = css_len2pt(&style->font_size.value.length, style);
@@ -498,25 +537,37 @@
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
+ if(!of[i]) warn_user("FontError",""); // temporary
error message
+
+ if(bname = GetTagData(OT_BName,0,of[i]->olf_OTagList))
+ {
+ ofb[i] = OpenOutlineFont(bname,NULL,OFF_OPEN);
+ }
+ else
+ {
+ ofb[i] = NULL;
+ }
+
+ if(iname = GetTagData(OT_IName,0,of[i]->olf_OTagList))
+ {
+ ofi[i] = OpenOutlineFont(iname,NULL,OFF_OPEN);
+ }
+ else
+ {
+ ofi[i] = NULL;
+ }
+
+ if(biname = GetTagData(OT_BIName,0,of[i]->olf_OTagList))
+ {
+ ofbi[i] = OpenOutlineFont(biname,NULL,OFF_OPEN);
+ }
+ else
+ {
+ ofbi[i] = NULL;
+ }
+ }
}
}
@@ -526,9 +577,12 @@
if(!option_quick_text)
{
- for(i=0;i<=CSS_FONT_FAMILY_NOT_SET;i++)
+ for(i=CSS_FONT_FAMILY_SANS_SERIF;i<=CSS_FONT_FAMILY_NOT_SET;i++)
{
if(of[i]) CloseOutlineFont(of[i],NULL);
- }
- }
-}
+ if(ofb[i]) CloseOutlineFont(ofb[i],NULL);
+ if(ofi[i]) CloseOutlineFont(ofi[i],NULL);
+ if(ofbi[i]) CloseOutlineFont(ofbi[i],NULL);
+ }
+ }
+}
Modified: trunk/netsurf/amiga/font.h
URL:
http://source.netsurf-browser.org/trunk/netsurf/amiga/font.h?rev=6155&r1=6154&r2=6155&view=diff
==============================================================================
--- trunk/netsurf/amiga/font.h (original)
+++ trunk/netsurf/amiga/font.h Tue Jan 20 10:53:06 2009
@@ -22,6 +22,11 @@
#include "css/css.h"
#include <graphics/text.h>
+#define NSA_NORMAL 0
+#define NSA_ITALIC 1
+#define NSA_BOLD 2
+#define NSA_BOLDITALIC 3
+
struct TextFont *ami_open_font(struct css_style *);
void ami_close_font(struct TextFont *tfont);
ULONG ami_unicode_text(struct RastPort *rp,char *string,ULONG length,struct
css_style *style,ULONG x,ULONG y,ULONG c);
Modified: trunk/netsurf/amiga/options.h
URL:
http://source.netsurf-browser.org/trunk/netsurf/amiga/options.h?rev=6155&r1=6154&r2=6155&view=diff
==============================================================================
--- trunk/netsurf/amiga/options.h (original)
+++ trunk/netsurf/amiga/options.h Tue Jan 20 10:53:06 2009
@@ -60,8 +60,8 @@
char *option_recent_file = 0; \
char *option_arexx_dir = 0; \
char *option_download_dir = 0; \
-bool option_quick_text = true; \
-bool option_redraw_on_intuiticks = true; \
+bool option_quick_text = false; \
+bool option_redraw_on_intuiticks = false; \
#define EXTRA_OPTION_TABLE \
{ "verbose_log", OPTION_BOOL, &option_verbose_log}, \
_______________________________________________
netsurf-commits mailing list
[email protected]
http://vlists.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org