Fix framebuffer build.

svn path=/trunk/netsurf/; revision=13222
This commit is contained in:
Michael Drake 2011-12-02 17:46:57 +00:00
parent e2a7600e9a
commit ebebdfda4b
2 changed files with 32 additions and 0 deletions

View File

@ -83,6 +83,22 @@ utf8_convert_ret utf8_to_local_encoding(const char *string,
return utf8_to_enc(string, "UTF-8", len, result); return utf8_to_enc(string, "UTF-8", len, result);
} }
utf8_convert_ret utf8_from_local_encoding(const char *string,
size_t len,
char **result)
{
*result = malloc(len + 1);
if (*result == NULL) {
return UTF8_CONVERT_NOMEM;
}
memcpy(*result, string, len);
(*result)[len] = '\0';
return UTF8_CONVERT_OK;
}
/* map cache manager handle to face id */ /* map cache manager handle to face id */
static FT_Error ft_face_requester(FTC_FaceID face_id, FT_Library library, FT_Pointer request_data, FT_Face *face ) static FT_Error ft_face_requester(FTC_FaceID face_id, FT_Library library, FT_Pointer request_data, FT_Face *face )
{ {

View File

@ -70,6 +70,22 @@ utf8_convert_ret utf8_to_local_encoding(const char *string,
} }
utf8_convert_ret utf8_from_local_encoding(const char *string,
size_t len,
char **result)
{
*result = malloc(len + 1);
if (*result == NULL) {
return UTF8_CONVERT_NOMEM;
}
memcpy(*result, string, len);
(*result)[len] = '\0';
return UTF8_CONVERT_OK;
}
static bool nsfont_width(const plot_font_style_t *fstyle, static bool nsfont_width(const plot_font_style_t *fstyle,
const char *string, size_t length, const char *string, size_t length,
int *width) int *width)