2 * Declarations of utilities to use for font manipulation
6 * Ethereal - Network traffic analyzer
7 * By Gerald Combs <gerald@ethereal.com>
8 * Copyright 1998 Gerald Combs
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 * Utilities for font manipulation.
29 * There are two different fonts used:
30 * - the application font for menu's, dialog's and such
31 * - the user font for the packet panes
33 * The user font is also available in regular (m_r_font) and bold (m_b_font) versions,
37 #ifndef __FONT_UTILS_H__
38 #define __FONT_UTILS_H__
40 /** Init the application and user fonts at program start. */
41 extern void font_init(void);
43 /** Return value from font_apply() */
45 FA_SUCCESS, /**< function succeeded */
46 FA_FONT_NOT_RESIZEABLE, /**< the choosen font isn't resizable */
47 FA_FONT_NOT_AVAILABLE /**< the choosen font isn't available */
50 /** Applies a new user font, corresponding to the preferences font name and recent zoom level.
51 * Will also redraw the screen.
53 * @return if the new font could be set or not
55 extern fa_ret_t user_font_apply(void);
58 #if GTK_MAJOR_VERSION < 2
59 /** Init the application font (GTK1 only).
61 * @param top_level_w the top level window
63 extern void app_font_gtk1_init(GtkWidget *top_level_w);
67 /** Test, if the given font name is available.
69 * @param font_name the font to test
70 * @return TRUE, if this font is available
72 extern gboolean user_font_test(gchar *font_name);
74 /** Get the regular user font.
76 * @return the regular user font
78 extern FONT_TYPE *user_font_get_regular(void);
80 /** Get the bold user font.
82 * @return the bold user font
84 extern FONT_TYPE *user_font_get_bold(void);
86 #if GTK_MAJOR_VERSION < 2
87 /** Get the regular user font height.
89 * @return the regular user font height
91 extern guint user_font_get_regular_height(void);
93 /** Get the regular user font width.
95 * @return the regular user font width
97 extern guint user_font_get_regular_width(void);