From 8e67ad805186d6495c98696658dbe06b015941e4 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Wed, 7 Sep 2011 23:01:53 +0000 Subject: Select fonts, sizes and colours for splash screen text rather than relying on system default svn path=/trunk/netsurf/; revision=12776 --- amiga/font.c | 13 +++++++++++++ amiga/font.h | 5 +++++ amiga/gui.c | 28 +++++++++++++++++++++++++--- 3 files changed, 43 insertions(+), 3 deletions(-) (limited to 'amiga') 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 +#include 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); -- cgit v1.2.3