summaryrefslogtreecommitdiff
path: root/amiga
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2011-09-07 23:01:53 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2011-09-07 23:01:53 +0000
commit8e67ad805186d6495c98696658dbe06b015941e4 (patch)
treefcf38d195b0b7e820c151fbc194886b1235a4ad6 /amiga
parentef56ab5d80be1ebfbeb3f8e9571238ca913e731a (diff)
downloadnetsurf-8e67ad805186d6495c98696658dbe06b015941e4.tar.gz
netsurf-8e67ad805186d6495c98696658dbe06b015941e4.tar.bz2
Select fonts, sizes and colours for splash screen text rather than relying on system
default svn path=/trunk/netsurf/; revision=12776
Diffstat (limited to 'amiga')
-rw-r--r--amiga/font.c13
-rwxr-xr-xamiga/font.h5
-rwxr-xr-xamiga/gui.c28
3 files changed, 43 insertions, 3 deletions
diff --git a/amiga/font.c b/amiga/font.c
index c4ea0e514..1876eedb8 100644
--- a/amiga/font.c
+++ b/amiga/font.c
@@ -691,3 +691,16 @@ void ami_font_setdevicedpi(int id)
ami_xdpi = xdpi;
ami_devicedpi = (xdpi << 16) | ydpi;
}
+
+/* The below are simple font routines which should not be used for page rendering */
+
+struct TextFont *ami_font_open_disk_font(struct TextAttr *tattr)
+{
+ struct TextFont *tfont = OpenDiskFont(tattr);
+ return tfont;
+}
+
+void ami_font_close_disk_font(struct TextFont *tfont)
+{
+ CloseFont(tfont);
+}
diff --git a/amiga/font.h b/amiga/font.h
index 0d534bafa..da1e68044 100755
--- a/amiga/font.h
+++ b/amiga/font.h
@@ -21,6 +21,7 @@
#include "desktop/plotters.h"
#include <graphics/rastport.h>
+#include <graphics/text.h>
struct ami_font_node;
@@ -30,4 +31,8 @@ void ami_font_setdevicedpi(int id);
void ami_init_fonts(void);
void ami_close_fonts(void);
void ami_font_close(struct ami_font_node *node);
+
+/* Simple diskfont functions for graphics.library use (not page rendering) */
+struct TextFont *ami_font_open_disk_font(struct TextAttr *tattr);
+void ami_font_close_disk_font(struct TextFont *tfont);
#endif
diff --git a/amiga/gui.c b/amiga/gui.c
index 2aaa5b94a..e544692b0 100755
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -3935,6 +3935,8 @@ Object *ami_gui_splash_open(void)
struct Screen *wbscreen = LockPubScreen("Workbench");
uint32 top = 0, left = 0;
STRPTR ver_string;
+ struct TextAttr tattr;
+ struct TextFont *tfont;
win_obj = WindowObject,
WA_Borderless, TRUE,
@@ -3957,11 +3959,30 @@ Object *ami_gui_splash_open(void)
IA_Left, &left,
TAG_DONE);
- SetDrMd(win->RPort, LEVELS);
+ SetRPAttrs(win->RPort, RPTAG_APenColor, 0x003F6DFE, TAG_DONE);
+ SetDrMd(win->RPort, JAM1);
- Move(win->RPort, left + 5, top + 20);
+ tattr.ta_Name = "DejaVu Serif Oblique.font";
+ tattr.ta_YSize = 24;
+ tattr.ta_Style = 0;
+ tattr.ta_Flags = 0;
+
+ if(tfont = ami_font_open_disk_font(&tattr))
+ SetFont(win->RPort, tfont);
+
+ Move(win->RPort, left + 5, top + 25);
Text(win->RPort, "Initialising...", strlen("Initialising..."));
+ if(tfont) ami_font_close_disk_font(tfont);
+
+ tattr.ta_Name = "DejaVu Sans.font";
+ tattr.ta_YSize = 16;
+ tattr.ta_Style = 0;
+ tattr.ta_Flags = 0;
+
+ if(tfont = ami_font_open_disk_font(&tattr))
+ SetFont(win->RPort, tfont);
+
#ifdef NDEBUG
ver_string = ASPrintf("NetSurf %s", netsurf_version);
#else
@@ -3971,7 +3992,8 @@ Object *ami_gui_splash_open(void)
Move(win->RPort, left + 185, top + 220);
Text(win->RPort, ver_string, strlen(ver_string));
- FreeVec(ver_string);
+ if(ver_string) FreeVec(ver_string);
+ if(tfont) ami_font_close_disk_font(tfont);
UnlockPubScreen(NULL, wbscreen);