summaryrefslogtreecommitdiff
path: root/debug
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2005-01-02 03:58:21 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2005-01-02 03:58:21 +0000
commit83346830688525a287489cc791299cbc945d4fc4 (patch)
tree2d8fd94d497449f2ffe0b8f1a1ad507b03bca753 /debug
parent143d756fcf681c15b82f117f95a1c527389b0177 (diff)
downloadnetsurf-83346830688525a287489cc791299cbc945d4fc4.tar.gz
netsurf-83346830688525a287489cc791299cbc945d4fc4.tar.bz2
[project @ 2005-01-02 03:58:20 by jmb]
xcalloc/xrealloc/xstrdup-purge - Lose remaining calls (and purge the relevant functions from utils.c) svn path=/import/netsurf/; revision=1419
Diffstat (limited to 'debug')
-rw-r--r--debug/fontd.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/debug/fontd.c b/debug/fontd.c
index 2fc3ec93b..a8974e540 100644
--- a/debug/fontd.c
+++ b/debug/fontd.c
@@ -41,23 +41,27 @@ unsigned long nsfont_width(struct font_data *font, const char * text,
return length * 10;
}
-void nsfont_position_in_string(struct font_data* font, const char* text,
+bool nsfont_position_in_string(struct font_data* font, const char* text,
size_t length, unsigned long x, int* char_offset, int* pixel_offset)
{
- assert(font != 0 && text != 0);
+ assert(font != 0 && text != 0);
- *char_offset = x / 10;
- *pixel_offset = x;
+ *char_offset = x / 10;
+ *pixel_offset = x;
- return;
+ return true;
}
struct font_set *nsfont_new_set()
{
- struct font_set *set = xcalloc(1, sizeof(*set));
+ struct font_set *set;
unsigned int i;
+ set = calloc(1, sizeof(*set));
+ if (!set)
+ return NULL;
+
for (i = 0; i < FONT_FAMILIES * 4; i++)
set->font[i] = 0;
@@ -101,7 +105,9 @@ struct font_data *nsfont_open(struct font_set *set, struct css_style *style)
if (data->size == size)
return data;
- data = xcalloc(1, sizeof(*data));
+ data = calloc(1, sizeof(*data));
+ if (!data)
+ return NULL;
data->size = size;
data->space_width = nsfont_width(data, " ", sizeof(" ")-1);
@@ -155,9 +161,11 @@ char *nsfont_split(struct font_data *data, const char * text,
}
-void nsfont_paint(struct font_data *data, const char *text,
+bool nsfont_paint(struct font_data *data, const char *text,
size_t length, int xpos, int ypos, void *trfm)
{
assert(data != NULL);
assert(text != NULL);
+
+ return true;
}