diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2009-06-20 13:44:39 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2009-06-20 13:44:39 +0000 |
commit | 2afe4157cd7839f0225e1842bc8f6859f668e39a (patch) | |
tree | fd0ffc4083e779737b065470f6b1f3506e731f13 /amiga | |
parent | 856fde9a4e5a2c6514c7abaef1cdefc9315eb045 (diff) | |
download | netsurf-2afe4157cd7839f0225e1842bc8f6859f668e39a.tar.gz netsurf-2afe4157cd7839f0225e1842bc8f6859f668e39a.tar.bz2 |
Support option_font_default
svn path=/trunk/netsurf/; revision=7896
Diffstat (limited to 'amiga')
-rw-r--r-- | amiga/font.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/amiga/font.c b/amiga/font.c index 1a02fe41a..841c67d2c 100644 --- a/amiga/font.c +++ b/amiga/font.c @@ -372,14 +372,37 @@ void ami_init_fonts(void) { int i; char *bname,*iname,*biname; + char *deffont; + + switch(option_font_default) + { + case CSS_FONT_FAMILY_SANS_SERIF: + deffont = strdup(option_font_sans); + break; + case CSS_FONT_FAMILY_SERIF: + deffont = strdup(option_font_serif); + break; + case CSS_FONT_FAMILY_MONOSPACE: + deffont = strdup(option_font_mono); + break; + case CSS_FONT_FAMILY_CURSIVE: + deffont = strdup(option_font_cursive); + break; + case CSS_FONT_FAMILY_FANTASY: + deffont = strdup(option_font_fantasy); + break; + default: + deffont = strdup(option_font_sans); + break; + } of[CSS_FONT_FAMILY_SANS_SERIF] = OpenOutlineFont(option_font_sans,NULL,OFF_OPEN); of[CSS_FONT_FAMILY_SERIF] = OpenOutlineFont(option_font_serif,NULL,OFF_OPEN); of[CSS_FONT_FAMILY_MONOSPACE] = OpenOutlineFont(option_font_mono,NULL,OFF_OPEN); of[CSS_FONT_FAMILY_CURSIVE] = OpenOutlineFont(option_font_cursive,NULL,OFF_OPEN); 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); + of[CSS_FONT_FAMILY_UNKNOWN] = OpenOutlineFont(deffont,NULL,OFF_OPEN); + of[CSS_FONT_FAMILY_NOT_SET] = OpenOutlineFont(deffont,NULL,OFF_OPEN); for(i=CSS_FONT_FAMILY_SANS_SERIF;i<=CSS_FONT_FAMILY_NOT_SET;i++) { @@ -412,6 +435,7 @@ void ami_init_fonts(void) ofbi[i] = NULL; } } + if(deffont) free(deffont); } void ami_close_fonts(void) |