summaryrefslogtreecommitdiff
path: root/amiga/gui_options.c
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2010-05-06 10:02:58 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2010-05-06 10:02:58 +0000
commitf55c11dbd6cb3242570eeb022b772ec236fe8603 (patch)
treeb9ba462d15bb7f68c65d8727c214e4c0ee8e6787 /amiga/gui_options.c
parent0807b405139259e719115b99755cc4a6153542f6 (diff)
downloadnetsurf-f55c11dbd6cb3242570eeb022b772ec236fe8603.tar.gz
netsurf-f55c11dbd6cb3242570eeb022b772ec236fe8603.tar.bz2
Amiga font code revamped and fixed. Will now fall back to a different font if the
character isn't present in the current one, this needs a complete or near-complete Unicode font in order to be useful - Code2000 and Bitstream Cyberbit are auto-detected by NetSurf on startup if none is configured. Japanese websites now display correctly, along with Japanese characters within Google UK search results etc. svn path=/trunk/netsurf/; revision=10551
Diffstat (limited to 'amiga/gui_options.c')
-rwxr-xr-xamiga/gui_options.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/amiga/gui_options.c b/amiga/gui_options.c
index 128496caa..59f5803f7 100755
--- a/amiga/gui_options.c
+++ b/amiga/gui_options.c
@@ -97,6 +97,7 @@ enum
GID_OPTS_FONT_MONO,
GID_OPTS_FONT_CURSIVE,
GID_OPTS_FONT_FANTASY,
+ GID_OPTS_FONT_UNICODE,
GID_OPTS_FONT_DEFAULT,
GID_OPTS_FONT_SIZE,
GID_OPTS_FONT_MINSIZE,
@@ -259,6 +260,7 @@ void ami_gui_opts_setup(void)
gadlab[GID_OPTS_FONT_MONO] = (char *)ami_utf8_easy((char *)messages_get("FontMono"));
gadlab[GID_OPTS_FONT_CURSIVE] = (char *)ami_utf8_easy((char *)messages_get("FontCursive"));
gadlab[GID_OPTS_FONT_FANTASY] = (char *)ami_utf8_easy((char *)messages_get("FontFantasy"));
+ gadlab[GID_OPTS_FONT_UNICODE] = (char *)ami_utf8_easy((char *)messages_get("FontFallback"));
gadlab[GID_OPTS_FONT_DEFAULT] = (char *)ami_utf8_easy((char *)messages_get("Default"));
gadlab[GID_OPTS_FONT_SIZE] = (char *)ami_utf8_easy((char *)messages_get("Default"));
gadlab[GID_OPTS_FONT_MINSIZE] = (char *)ami_utf8_easy((char *)messages_get("Minimum"));
@@ -367,7 +369,7 @@ void ami_gui_opts_open(void)
BOOL scaleselected = option_scale_quality, scaledisabled = FALSE;
BOOL download_notify_disabled = FALSE;
char animspeed[10];
- struct TextAttr fontsans, fontserif, fontmono, fontcursive, fontfantasy;
+ struct TextAttr fontsans, fontserif, fontmono, fontcursive, fontfantasy, fontunicode;
if(option_use_pubscreen && option_use_pubscreen[0] != '\0')
{
@@ -438,24 +440,28 @@ void ami_gui_opts_open(void)
fontmono.ta_Name = ASPrintf("%s.font",option_font_mono);
fontcursive.ta_Name = ASPrintf("%s.font",option_font_cursive);
fontfantasy.ta_Name = ASPrintf("%s.font",option_font_fantasy);
+ fontunicode.ta_Name = ASPrintf("%s.font",option_font_unicode);
fontsans.ta_Style = 0;
fontserif.ta_Style = 0;
fontmono.ta_Style = 0;
fontcursive.ta_Style = 0;
fontfantasy.ta_Style = 0;
+ fontunicode.ta_Style = 0;
fontsans.ta_YSize = 0;
fontserif.ta_YSize = 0;
fontmono.ta_YSize = 0;
fontcursive.ta_YSize = 0;
fontfantasy.ta_YSize = 0;
+ fontunicode.ta_YSize = 0;
fontsans.ta_Flags = 0;
fontserif.ta_Flags = 0;
fontmono.ta_Flags = 0;
fontcursive.ta_Flags = 0;
fontfantasy.ta_Flags = 0;
+ fontunicode.ta_Flags = 0;
if(!gow)
{
@@ -894,6 +900,15 @@ void ami_gui_opts_open(void)
CHILD_Label, LabelObject,
LABEL_Text, gadlab[GID_OPTS_FONT_FANTASY],
LabelEnd,
+ LAYOUT_AddChild, gow->objects[GID_OPTS_FONT_UNICODE] = GetFontObject,
+ GA_ID, GID_OPTS_FONT_UNICODE,
+ GA_RelVerify, TRUE,
+ GETFONT_TextAttr, &fontunicode,
+ GETFONT_OTagOnly, TRUE,
+ GetFontEnd,
+ CHILD_Label, LabelObject,
+ LABEL_Text, gadlab[GID_OPTS_FONT_UNICODE],
+ LabelEnd,
LAYOUT_AddChild, gow->objects[GID_OPTS_FONT_DEFAULT] = ChooserObject,
GA_ID, GID_OPTS_FONT_DEFAULT,
GA_RelVerify, TRUE,
@@ -1473,6 +1488,12 @@ void ami_gui_opts_use(void)
if(dot = strrchr(tattr->ta_Name,'.')) *dot = '\0';
option_font_fantasy = (char *)strdup((char *)tattr->ta_Name);
+ GetAttr(GETFONT_TextAttr,gow->objects[GID_OPTS_FONT_UNICODE],(ULONG *)&data);
+ tattr = (struct TextAttr *)data;
+ if(option_font_unicode) free(option_font_unicode);
+ if(dot = strrchr(tattr->ta_Name,'.')) *dot = '\0';
+ option_font_unicode = (char *)strdup((char *)tattr->ta_Name);
+
GetAttr(CHOOSER_Selected,gow->objects[GID_OPTS_FONT_DEFAULT],(ULONG *)&option_font_default);
option_font_default += PLOT_FONT_FAMILY_SANS_SERIF;
@@ -1741,6 +1762,11 @@ BOOL ami_gui_opts_event(void)
GFONT_REQUEST,gow->win);
break;
+ case GID_OPTS_FONT_UNICODE:
+ IDoMethod(gow->objects[GID_OPTS_FONT_UNICODE],
+ GFONT_REQUEST,gow->win);
+ break;
+
case GID_OPTS_DLDIR:
IDoMethod(gow->objects[GID_OPTS_DLDIR],
GFILE_REQUEST,gow->win);