summaryrefslogtreecommitdiff
path: root/windows/font.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2012-03-22 09:34:34 +0000
committerVincent Sanders <vince@netsurf-browser.org>2012-03-22 09:34:34 +0000
commit1490b52a6b96b6a69a0c4fe9e0515dc717425128 (patch)
tree8caba44a9da98e6cebf4f188e3232534b1596a4d /windows/font.c
parent0797bf5a5731b2c8d55105b453530584ea4e1f5b (diff)
downloadnetsurf-1490b52a6b96b6a69a0c4fe9e0515dc717425128.tar.gz
netsurf-1490b52a6b96b6a69a0c4fe9e0515dc717425128.tar.bz2
NetSurf options rework (a=vince r=daniels,jmb)
svn path=/trunk/netsurf/; revision=13548
Diffstat (limited to 'windows/font.c')
-rw-r--r--windows/font.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/windows/font.c b/windows/font.c
index ada54eef0..f97e366f6 100644
--- a/windows/font.c
+++ b/windows/font.c
@@ -46,30 +46,45 @@ utf8_convert_ret utf8_to_local_encoding(const char *string,
return utf8_to_enc(string, "UCS-2", len, result);
}
+utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
+ char **result)
+{
+ assert(string && result);
+
+ if (len == 0)
+ len = strlen(string);
+
+ *result = strndup(string, len);
+ if (!(*result))
+ return UTF8_CONVERT_NOMEM;
+
+ return UTF8_CONVERT_OK;
+}
+
HFONT get_font(const plot_font_style_t *style)
{
char *face = NULL;
DWORD family;
switch(style->family) {
case PLOT_FONT_FAMILY_SERIF:
- face = strdup(option_font_serif);
+ face = strdup(nsoption_charp(font_serif));
family = FF_ROMAN | DEFAULT_PITCH;
break;
case PLOT_FONT_FAMILY_MONOSPACE:
- face = strdup(option_font_mono);
+ face = strdup(nsoption_charp(font_mono));
family = FF_MODERN | DEFAULT_PITCH;
break;
case PLOT_FONT_FAMILY_CURSIVE:
- face = strdup(option_font_cursive);
+ face = strdup(nsoption_charp(font_cursive));
family = FF_SCRIPT | DEFAULT_PITCH;
break;
case PLOT_FONT_FAMILY_FANTASY:
- face = strdup(option_font_fantasy);
+ face = strdup(nsoption_charp(font_fantasy));
family = FF_DECORATIVE | DEFAULT_PITCH;
break;
case PLOT_FONT_FAMILY_SANS_SERIF:
default:
- face = strdup(option_font_sans);
+ face = strdup(nsoption_charp(font_sans));
family = FF_SWISS | DEFAULT_PITCH;
break;
}