NetSurf
font.h
Go to the documentation of this file.
1/*
2 * Copyright 2008, 2009, 2012, 2016 Chris Young <chris@unsatisfactorysoftware.co.uk>
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 AMIGA_FONT_H
20#define AMIGA_FONT_H
21
22#include "netsurf/plotters.h"
23#include "utils/errors.h"
24#include <graphics/rastport.h>
25#include <graphics/text.h>
26
27void ami_font_init(void);
28void ami_font_fini(void);
29
30/* DPI stuff */
31void ami_font_setdevicedpi(int id);
33ULONG ami_font_dpi_get_xdpi(void);
34
35/* Simple diskfont functions for graphics.library use (not page rendering) */
36struct TextFont *ami_font_open_disk_font(struct TextAttr *tattr);
37void ami_font_close_disk_font(struct TextFont *tfont);
38
39/* Font engine tables */
42 const char *string, size_t length,
43 int *width);
44
45 nserror (*posn)(const plot_font_style_t *fstyle,
46 const char *string, size_t length,
47 int x, size_t *char_offset, int *actual_x);
48
50 const char *string, size_t length,
51 int x, size_t *char_offset, int *actual_x);
52
53 ULONG (*text)(struct RastPort *rp, const char *string,
54 ULONG length, const plot_font_style_t *fstyle,
55 ULONG x, ULONG y, bool aa);
56};
57
59
61
62#endif
63
Error codes.
nserror
Enumeration of error codes.
Definition: errors.h:29
ULONG ami_font_dpi_get_devicedpi(void)
Definition: font.c:38
const struct ami_font_functions * ami_nsfont
Definition: font.h:58
ULONG ami_font_dpi_get_xdpi(void)
Definition: font.c:43
struct TextFont * ami_font_open_disk_font(struct TextAttr *tattr)
Definition: font.c:101
void ami_font_close_disk_font(struct TextFont *tfont)
Definition: font.c:107
void ami_font_init(void)
Definition: font.c:113
struct gui_layout_table * ami_layout_table
Definition: font.c:162
void ami_font_setdevicedpi(int id)
Definition: font.c:48
void ami_font_fini(void)
Definition: font.c:122
Target independent plotting interface.
nserror(* posn)(const plot_font_style_t *fstyle, const char *string, size_t length, int x, size_t *char_offset, int *actual_x)
Definition: font.h:45
nserror(* width)(const plot_font_style_t *fstyle, const char *string, size_t length, int *width)
Definition: font.h:41
nserror(* split)(const plot_font_style_t *fstyle, const char *string, size_t length, int x, size_t *char_offset, int *actual_x)
Definition: font.h:49
ULONG(* text)(struct RastPort *rp, const char *string, ULONG length, const plot_font_style_t *fstyle, ULONG x, ULONG y, bool aa)
Definition: font.h:53
Font style for plotting.
Definition: plot_style.h:111