Add a GUI prefs option on OS3 only, to toggle between bitmap and outline fonts

"Allow bitmap fonts" causes NetSurf to use diskfont and graphics library routines for opening and displaying fonts.  This allows bitmap fonts to be used which are much faster on 68k hardware than outline fonts, but loses the ability to render pages in UTF-8.
Conversely, toggling this option off makes NetSurf use bullet.library directly and render glyphs itself, which precludes the usage of bitmap fonts but allows the full range of UTF-8 characters to be displayed.
This option is ON by default on OS3 for speed reasons, and OFF by default on OS4.  Additionally, this option is not shown on the prefs GUI on OS4 as the speed difference between bitmap and outline fonts is negligible on that hardware and I don't want to encourage the use of an option which provides inferior rendering.
This commit is contained in:
Chris Young 2016-01-27 23:53:27 +00:00
parent 5afd42aa5a
commit ee640b80bc
2 changed files with 27 additions and 1 deletions

View File

@ -122,6 +122,7 @@ enum
GID_OPTS_FONT_SIZE,
GID_OPTS_FONT_MINSIZE,
GID_OPTS_FONT_ANTIALIASING,
GID_OPTS_FONT_BITMAP,
GID_OPTS_CACHE_MEM,
GID_OPTS_CACHE_DISC,
GID_OPTS_OVERWRITE,
@ -375,6 +376,7 @@ static void ami_gui_opts_setup(struct ami_gui_opts_window *gow)
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"));
gadlab[GID_OPTS_FONT_ANTIALIASING] = (char *)ami_utf8_easy((char *)messages_get("FontAntialiasing"));
gadlab[GID_OPTS_FONT_BITMAP] = (char *)ami_utf8_easy((char *)messages_get("FontBitmap"));
gadlab[GID_OPTS_CACHE_MEM] = (char *)ami_utf8_easy((char *)messages_get("Size"));
gadlab[GID_OPTS_CACHE_DISC] = (char *)ami_utf8_easy((char *)messages_get("Size"));
gadlab[GID_OPTS_OVERWRITE] = (char *)ami_utf8_easy((char *)messages_get("ConfirmOverwrite"));
@ -1235,6 +1237,14 @@ void ami_gui_opts_open(void)
GA_Disabled, TRUE,
#endif
CheckBoxEnd,
#ifndef __amigaos4__
LAYOUT_AddChild, gow->objects[GID_OPTS_FONT_BITMAP] = CheckBoxObj,
GA_ID, GID_OPTS_FONT_BITMAP,
GA_RelVerify, TRUE,
GA_Text, gadlab[GID_OPTS_FONT_BITMAP],
GA_Selected, nsoption_bool(bitmap_fonts),
CheckBoxEnd,
#endif
LayoutEnd,
LayoutEnd,
CHILD_WeightedHeight, 0,
@ -1863,7 +1873,18 @@ static void ami_gui_opts_use(bool save)
} else {
nsoption_set_bool(font_antialiasing, false);
}
#ifndef __amigaos4__
GetAttr(GA_Selected, gow->objects[GID_OPTS_FONT_BITMAP], (ULONG *)&data);
ami_font_fini();
if(data) {
nsoption_set_bool(bitmap_fonts, true);
} else {
nsoption_set_bool(bitmap_fonts, false);
}
ami_font_init();
#endif
GetAttr(INTEGER_Number,gow->objects[GID_OPTS_CACHE_MEM],(ULONG *)&nsoption_int(memory_cache_size));
nsoption_set_int(memory_cache_size, nsoption_int(memory_cache_size) * 1048576);

View File

@ -6147,6 +6147,11 @@ de.ami.FontAntialiasing:Use anti-aliasing (when possible)
fr.ami.FontAntialiasing:Utiliser l'anticrénelage (si possible)
it.ami.FontAntialiasing:Usa anti-aliasing (quando possibile)
nl.ami.FontAntialiasing:Anti-aliasing (indien mogelijk) gebruiken
en.ami.FontBitmap:Allow bitmap fonts
de.ami.FontBitmap:Allow bitmap fonts
fr.ami.FontBitmap:Allow bitmap fonts
it.ami.FontBitmap:Allow bitmap fonts
nl.ami.FontBitmap:Allow bitmap fonts
# Font scanning
en.ami.FontScanning:Scanning fonts...