summaryrefslogtreecommitdiff
path: root/debug
diff options
context:
space:
mode:
authorJohn Tytgat <joty@netsurf-browser.org>2004-07-05 20:19:52 +0000
committerJohn Tytgat <joty@netsurf-browser.org>2004-07-05 20:19:52 +0000
commita0d511734ae464d6e7b4d2f5e019611c0cdafea9 (patch)
tree3427f02b2f829492f6bf89d16c7af91726878e9c /debug
parentab11d2c94d0ed5c4ed9ab4f32417e3c1c4cf8fb9 (diff)
downloadnetsurf-a0d511734ae464d6e7b4d2f5e019611c0cdafea9.tar.gz
netsurf-a0d511734ae464d6e7b4d2f5e019611c0cdafea9.tar.bz2
[project @ 2004-07-05 20:19:51 by joty]
Using UTF-8 instead of Latin1 encoding. svn path=/import/netsurf/; revision=1049
Diffstat (limited to 'debug')
-rw-r--r--debug/fontd.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/debug/fontd.c b/debug/fontd.c
index 0305387ba..1b9ba871c 100644
--- a/debug/fontd.c
+++ b/debug/fontd.c
@@ -28,7 +28,7 @@ static void font_close(struct font_data *data);
* functions
*/
-unsigned long font_width(struct font_data *font, const char * text, unsigned int length)
+unsigned long nsfont_width(struct font_data *font, const char * text, unsigned int length)
{
int width;
@@ -40,7 +40,7 @@ unsigned long font_width(struct font_data *font, const char * text, unsigned int
return length * 10;
}
-void font_position_in_string(const char* text, struct font_data* font,
+void nsfont_position_in_string(struct font_data* font, const char* text,
unsigned int length, unsigned long x, int* char_offset, int* pixel_offset)
{
assert(font != 0 && text != 0);
@@ -52,7 +52,7 @@ void font_position_in_string(const char* text, struct font_data* font,
}
-struct font_set *font_new_set()
+struct font_set *nsfont_new_set()
{
struct font_set *set = xcalloc(1, sizeof(*set));
unsigned int i;
@@ -64,7 +64,7 @@ struct font_set *font_new_set()
}
-struct font_data *font_open(struct font_set *set, struct css_style *style)
+struct font_data *nsfont_open(struct font_set *set, struct css_style *style)
{
struct font_data *data;
unsigned int size = 16 * 11;
@@ -98,12 +98,12 @@ struct font_data *font_open(struct font_set *set, struct css_style *style)
for (data = set->font[f]; data != 0; data = data->next)
if (data->size == size)
- return data;
+ return data;
data = xcalloc(1, sizeof(*data));
data->size = size;
- data->space_width = font_width(data, " ", 1);
+ data->space_width = nsfont_width(data, " ", sizeof(" ")-1);
data->next = set->font[f];
set->font[f] = data;
@@ -112,7 +112,7 @@ struct font_data *font_open(struct font_set *set, struct css_style *style)
}
-void font_free_set(struct font_set *set)
+void nsfont_free_set(struct font_set *set)
{
unsigned int i;
struct font_data *data, *next;
@@ -137,7 +137,7 @@ void font_close(struct font_data *data)
}
-char * font_split(struct font_data *data, const char * text, unsigned int length,
+char *nsfont_split(struct font_data *data, const char * text, unsigned int length,
unsigned int width, unsigned int *used_width)
{
int i = width / 10;
@@ -154,15 +154,9 @@ char * font_split(struct font_data *data, const char * text, unsigned int length
}
-const char *enumerate_fonts(struct font_set *set, int *handle)
+void nsfont_paint(struct font_data *data, const char *text,
+ int xpos, int ypos, void *trfm, int length)
{
- assert(handle);
-
- if (*handle == 0) {
- *handle = 1;
- return "Homerton.Medium";
- }
-
- *handle = -1;
- return 0;
+ assert(data != NULL);
+ assert(text != NULL);
}