2 Copyright (C) 2001-2006, William Joseph.
5 This file is part of GtkRadiant.
7 GtkRadiant 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; either version 2 of the License, or
10 (at your option) any later version.
12 GtkRadiant is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GtkRadiant; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 //#include <gtk/gtkglwidget.h>
27 GLFont glfont_create(const char* font_string)
29 GLuint font_list_base = glGenLists (256);
32 PangoFontDescription* font_desc = pango_font_description_from_string (font_string);
34 PangoFont* font = gdk_gl_font_use_pango_font (font_desc, 0, 256, font_list_base);
38 PangoFontMetrics* font_metrics = pango_font_get_metrics (font, 0);
40 font_height = pango_font_metrics_get_ascent (font_metrics) +
41 pango_font_metrics_get_descent (font_metrics);
42 font_height = PANGO_PIXELS (font_height);
44 pango_font_metrics_unref (font_metrics);
47 pango_font_description_free (font_desc);
49 return GLFont(font_list_base, font_height);
52 void glfont_release(GLFont& font)
54 glDeleteLists(font.getDisplayList(), 256);