2003-06-30 16:44:03 +04:00
|
|
|
/*
|
|
|
|
* This file is part of NetSurf, http://netsurf.sourceforge.net/
|
|
|
|
* Licensed under the GNU General Public License,
|
|
|
|
* http://www.opensource.org/licenses/gpl-license
|
|
|
|
* Copyright 2003 Phil Mellor <monkeyson@users.sourceforge.net>
|
|
|
|
* Copyright 2003 James Bursa <bursa@users.sourceforge.net>
|
2004-07-06 00:19:52 +04:00
|
|
|
* Copyright 2004 John Tytgat <John.Tytgat@aaug.net>
|
2002-09-11 18:24:02 +04:00
|
|
|
*/
|
|
|
|
|
2004-06-03 01:09:14 +04:00
|
|
|
#ifndef _NETSURF_RENDER_FONT_H_
|
|
|
|
#define _NETSURF_RENDER_FONT_H_
|
2002-09-11 18:24:02 +04:00
|
|
|
|
2004-08-14 16:57:02 +04:00
|
|
|
#include <stddef.h>
|
2003-04-04 19:19:32 +04:00
|
|
|
#include "netsurf/css/css.h"
|
2002-10-08 15:15:29 +04:00
|
|
|
|
2004-07-06 00:19:52 +04:00
|
|
|
typedef enum {
|
|
|
|
FONTTYPE_UFONT,
|
|
|
|
FONTTYPE_STANDARD_UTF8ENC,
|
|
|
|
FONTTYPE_STANDARD_LATIN1
|
|
|
|
} fonttype_e;
|
|
|
|
|
2002-09-27 01:38:33 +04:00
|
|
|
struct font_data {
|
2004-07-06 00:19:52 +04:00
|
|
|
int id;
|
2003-07-18 03:01:02 +04:00
|
|
|
int handle;
|
2004-07-06 00:19:52 +04:00
|
|
|
fonttype_e ftype;
|
2002-09-27 01:38:33 +04:00
|
|
|
unsigned int size;
|
2002-12-27 20:28:19 +03:00
|
|
|
unsigned int space_width;
|
2002-09-27 01:38:33 +04:00
|
|
|
struct font_data *next;
|
2002-09-11 18:24:02 +04:00
|
|
|
};
|
|
|
|
|
2004-07-06 00:19:52 +04:00
|
|
|
struct font_set *nsfont_new_set(void);
|
|
|
|
struct font_data *nsfont_open(struct font_set *set, struct css_style *style);
|
|
|
|
void nsfont_free_set(struct font_set *set);
|
|
|
|
unsigned long nsfont_width(struct font_data *font, const char *text,
|
2004-08-14 16:57:02 +04:00
|
|
|
size_t length);
|
2004-07-06 00:19:52 +04:00
|
|
|
void nsfont_position_in_string(struct font_data *font, const char *text,
|
2004-08-14 16:57:02 +04:00
|
|
|
size_t length, unsigned long x, int *char_offset,
|
2004-07-06 00:19:52 +04:00
|
|
|
int *pixel_offset);
|
|
|
|
char *nsfont_split(struct font_data *font, const char *text,
|
2004-08-14 16:57:02 +04:00
|
|
|
size_t length,
|
2002-10-12 17:05:16 +04:00
|
|
|
unsigned int width, unsigned int *used_width);
|
2004-07-06 00:19:52 +04:00
|
|
|
void nsfont_paint(struct font_data *font, const char *str,
|
2004-08-14 16:57:02 +04:00
|
|
|
size_t length, int xpos, int ypos, void *trfm);
|
2004-07-06 00:19:52 +04:00
|
|
|
void nsfont_txtenum(struct font_data *font, const char *text,
|
2004-08-14 16:57:02 +04:00
|
|
|
size_t length,
|
2004-07-06 00:19:52 +04:00
|
|
|
unsigned int *width,
|
|
|
|
const char **rofontname,
|
|
|
|
const char **rotext,
|
2004-08-14 16:57:02 +04:00
|
|
|
size_t *rolength,
|
|
|
|
size_t *consumed);
|
2004-09-30 00:13:42 +04:00
|
|
|
void nsfont_fill_nametable(bool force_rescan);
|
2002-09-11 18:24:02 +04:00
|
|
|
|
|
|
|
#endif
|