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>
|
2002-09-11 18:24:02 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _NETSURF_RISCOS_FONT_H_
|
|
|
|
#define _NETSURF_RISCOS_FONT_H_
|
|
|
|
|
|
|
|
/**
|
|
|
|
* structures and typedefs
|
|
|
|
*/
|
|
|
|
|
2003-04-04 19:19:32 +04:00
|
|
|
#include "netsurf/css/css.h"
|
2002-09-11 18:24:02 +04:00
|
|
|
#include "oslib/font.h"
|
|
|
|
|
|
|
|
typedef unsigned int font_id;
|
2002-09-27 01:38:33 +04:00
|
|
|
|
|
|
|
#define FONT_FAMILIES 1
|
|
|
|
#define FONT_BOLD 2
|
|
|
|
#define FONT_SLANTED 1
|
|
|
|
|
2002-10-08 15:15:29 +04:00
|
|
|
/* a font_set is just a linked list of font_data for each face for now */
|
|
|
|
struct font_set {
|
|
|
|
struct font_data *font[FONT_FAMILIES * 4];
|
|
|
|
};
|
|
|
|
|
2002-09-27 01:38:33 +04:00
|
|
|
struct font_data {
|
2002-10-08 15:15:29 +04:00
|
|
|
font_f handle;
|
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
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* interface
|
|
|
|
*/
|
|
|
|
|
2002-09-27 01:38:33 +04:00
|
|
|
unsigned long font_width(struct font_data *font, const char * text, unsigned int length);
|
|
|
|
void font_position_in_string(const char* text, struct font_data *font,
|
2003-03-04 01:40:39 +03:00
|
|
|
unsigned int length, unsigned long x, int* char_offset, int* pixel_offset);
|
2002-09-11 18:24:02 +04:00
|
|
|
|
2002-10-08 15:15:29 +04:00
|
|
|
struct font_set *font_new_set(void);
|
2002-09-27 01:38:33 +04:00
|
|
|
struct font_data *font_open(struct font_set *set, struct css_style *style);
|
|
|
|
void font_free_set(struct font_set *set);
|
2002-10-12 17:05:16 +04:00
|
|
|
char * font_split(struct font_data *data, const char * text, unsigned int length,
|
|
|
|
unsigned int width, unsigned int *used_width);
|
2002-09-11 18:24:02 +04:00
|
|
|
|
|
|
|
#endif
|