NetSurf
fontplot.h
Go to the documentation of this file.
1/*
2 * Copyright 2010 Ole Loots <ole@monochrom.net>
3 *
4 * This file is part of NetSurf, http://www.netsurf-browser.org/
5 *
6 * NetSurf is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * NetSurf is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef FONT_PLOT_H
20#define FONT_PLOT_H
21
23
25{
26 const char * name;
27 int (*ctor)( FONT_PLOTTER self );
28 int flags;
29};
30
31/* declaration of font plotter member functions: (_fpmf_ prefix) */
32typedef int (*_fpmf_str_width)( FONT_PLOTTER self, const plot_font_style_t *fstyle,
33 const char * str, size_t length, int * width);
34typedef int (*_fpmf_str_split)( FONT_PLOTTER self, const plot_font_style_t *fstyle,
35 const char *string, size_t length,
36 int x, size_t *char_offset, int *actual_x);
37typedef int (*_fpmf_pixel_pos)( FONT_PLOTTER self, const plot_font_style_t *fstyle,
38 const char *string, size_t length,
39 int x, size_t *char_offset, int *actual_x);
40typedef int (*_fpmf_text)( FONT_PLOTTER self, int x, int y, const char *text,
41 size_t length, const plot_font_style_t *fstyle);
42
43typedef void (*_fpmf_draw_glyph)(FONT_PLOTTER self, GRECT * clip, GRECT * loc,
44 uint8_t * pixdata, int pitch, uint32_t colour);
45typedef int (*_fpmf_dtor)( FONT_PLOTTER self );
46
47
48/* prototype of the font plotter "object" */
50{
51 char * name;
52 int flags;
54 void * priv_data;
55
62};
63
64
66/* Set the font plotting engine.
67*/
68void plot_set_text_plotter(FONT_PLOTTER font_plotter);
69void dump_font_drivers(void);
70FONT_PLOTTER new_font_plotter( int vdihandle, char * name, unsigned long flags,
71 int * error);
73
74#ifdef WITH_VDI_FONT_DRIVER
75 #include "atari/plot/font_vdi.h"
76#endif
77#ifdef WITH_INTERNAL_FONT_DRIVER
79#endif
80#ifdef WITH_FREETYPE_FONT_DRIVER
82#endif
83
84
85
86#endif
VdiHdl vdihandle
Definition: about.c:46
FONT_PLOTTER plot_get_text_plotter(void)
Definition: plot.c:1953
void dump_font_drivers(void)
Definition: fontplot.c:44
void plot_set_text_plotter(FONT_PLOTTER font_plotter)
Definition: plot.c:1959
FONT_PLOTTER new_font_plotter(int vdihandle, char *name, unsigned long flags, int *error)
Create an new text plotter object.
Definition: fontplot.c:67
int(* _fpmf_str_split)(FONT_PLOTTER self, const plot_font_style_t *fstyle, const char *string, size_t length, int x, size_t *char_offset, int *actual_x)
Definition: fontplot.h:34
int(* _fpmf_text)(FONT_PLOTTER self, int x, int y, const char *text, size_t length, const plot_font_style_t *fstyle)
Definition: fontplot.h:40
int(* _fpmf_pixel_pos)(FONT_PLOTTER self, const plot_font_style_t *fstyle, const char *string, size_t length, int x, size_t *char_offset, int *actual_x)
Definition: fontplot.h:37
int delete_font_plotter(FONT_PLOTTER p)
Definition: fontplot.c:121
void(* _fpmf_draw_glyph)(FONT_PLOTTER self, GRECT *clip, GRECT *loc, uint8_t *pixdata, int pitch, uint32_t colour)
Definition: fontplot.h:43
struct s_font_plotter * FONT_PLOTTER
Definition: fontplot.h:22
int(* _fpmf_str_width)(FONT_PLOTTER self, const plot_font_style_t *fstyle, const char *str, size_t length, int *width)
Definition: fontplot.h:32
int(* _fpmf_dtor)(FONT_PLOTTER self)
Definition: fontplot.h:45
int width
Definition: gui.c:160
Font style for plotting.
Definition: plot_style.h:111
Definition: fontplot.h:25
int(* ctor)(FONT_PLOTTER self)
Definition: fontplot.h:27
int flags
Definition: fontplot.h:28
const char * name
Definition: fontplot.h:26
_fpmf_str_width str_width
Definition: fontplot.h:56
void * priv_data
Definition: fontplot.h:54
_fpmf_dtor dtor
Definition: fontplot.h:61
_fpmf_text text
Definition: fontplot.h:59
char * name
Definition: fontplot.h:51
int vdi_handle
Definition: fontplot.h:53
_fpmf_str_split str_split
Definition: fontplot.h:57
_fpmf_draw_glyph draw_glyph
Definition: fontplot.h:60
_fpmf_pixel_pos pixel_pos
Definition: fontplot.h:58
uint32_t colour
Colour type: XBGR.
Definition: types.h:35
static nserror text(const struct redraw_context *ctx, const struct plot_font_style *fstyle, int x, int y, const char *text, size_t length)
Text plotting.
Definition: plot.c:978
static nserror clip(const struct redraw_context *ctx, const struct rect *clip)
Sets a clip rectangle for subsequent plot operations.
Definition: plot.c:357