NetSurf
font.h
Go to the documentation of this file.
1/*
2 * Copyright 2008 Vincent Sanders <vince@simtec.co.uk>
3 * Copyright 2009 Mark Benjamin <netsurf-browser.org.MarkBenjamin@dfgh.net>
4 *
5 * This file is part of NetSurf, http://www.netsurf-browser.org/
6 *
7 * NetSurf is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * NetSurf is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20/**
21 * \file
22 * The interface to the win32 font and utf8 handling.
23 */
24
25#ifndef NETSURF_WINDOWS_FONT_H
26#define NETSURF_WINDOWS_FONT_H
27
28struct plot_font_style;
29
30extern HWND font_hwnd;
31
32struct font_desc {
33 const char *name;
34 int width, height;
35 const char *encoding;
36};
37
39extern struct gui_utf8_table *win32_utf8_table;
40
41/**
42 * convert from utf-8 to win32 font encoding.
43 *
44 * \param[in] font font descriptor
45 * \param[in] string source utf-8 string
46 * \param[in] len The length of the utf-8 data
47 * \param[out] result The reencoded string.
48 */
49extern nserror utf8_to_font_encoding(const struct font_desc* font, const char *string, size_t len, char **result);
50
51/**
52 * generate a win32 font handle from a generic font style
53 *
54 * \param style The font style.
55 * \return The win32 font handle
56 */
57HFONT get_font(const struct plot_font_style *style);
58
59#endif /* NETSURF_WINDOWS_FONT_H */
60
STATIC char result[100]
Definition: arexx.c:77
nserror
Enumeration of error codes.
Definition: errors.h:29
HWND font_hwnd
Definition: font.c:39
struct gui_utf8_table * win32_utf8_table
Definition: font.c:360
nserror utf8_to_font_encoding(const struct font_desc *font, const char *string, size_t len, char **result)
convert from utf-8 to win32 font encoding.
Definition: font.c:43
HFONT get_font(const struct plot_font_style *style)
generate a win32 font handle from a generic font style
struct gui_layout_table * win32_layout_table
Definition: font.c:352
const char * name
Definition: font_freetype.h:43
const char * encoding
Definition: font_freetype.h:45
User interface utf8 characterset conversion routines.
Definition: utf8.h:31
Font style for plotting.
Definition: plot_style.h:111