mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-02 19:06:57 +03:00
f459052ef8
Speed improvements in layout_line() (call Font_ScanString much less). svn path=/import/netsurf/; revision=43
47 lines
1.1 KiB
C
47 lines
1.1 KiB
C
/**
|
|
* $Id: font.h,v 1.4 2002/10/12 13:05:16 bursa Exp $
|
|
*/
|
|
|
|
#ifndef _NETSURF_RISCOS_FONT_H_
|
|
#define _NETSURF_RISCOS_FONT_H_
|
|
|
|
/**
|
|
* structures and typedefs
|
|
*/
|
|
|
|
#include "netsurf/render/css.h"
|
|
#include "oslib/font.h"
|
|
|
|
typedef unsigned int font_id;
|
|
|
|
#define FONT_FAMILIES 1
|
|
#define FONT_BOLD 2
|
|
#define FONT_SLANTED 1
|
|
|
|
/* 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];
|
|
};
|
|
|
|
struct font_data {
|
|
font_f handle;
|
|
unsigned int size;
|
|
struct font_data *next;
|
|
};
|
|
|
|
/**
|
|
* interface
|
|
*/
|
|
|
|
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,
|
|
int length, int x, int* char_offset, int* pixel_offset);
|
|
|
|
struct font_set *font_new_set(void);
|
|
struct font_data *font_open(struct font_set *set, struct css_style *style);
|
|
void font_free_set(struct font_set *set);
|
|
char * font_split(struct font_data *data, const char * text, unsigned int length,
|
|
unsigned int width, unsigned int *used_width);
|
|
|
|
#endif
|