Commit dafddf16 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

require PangoFT2 >= 1.2.0.

2003-03-27  Sven Neumann  <sven@gimp.org>

	* configure.in: require PangoFT2 >= 1.2.0.

	* app/text/gimpfontlist.c: use the PangoFontMap API to list
	available fonts.
parent 4ee52d1d
2003-03-27 Sven Neumann <sven@gimp.org>
* configure.in: require PangoFT2 >= 1.2.0.
* app/text/gimpfontlist.c: use the PangoFontMap API to list
available fonts.
2003-03-27 Michael Natterer <mitch@gimp.org>
 
* app/gui/channels-commands.c
......@@ -12,7 +19,7 @@
* app/text/gimpfontlist.c (gimp_font_list_restore): sort the list
after all fonts have been added instead of keeping the list in
order while inserting
order while inserting fonts.
 
2003-03-27 Michael Natterer <mitch@gimp.org>
 
......@@ -89,7 +89,6 @@ gimp_font_list_new (gdouble xresolution,
gdouble yresolution)
{
GimpFontList *list;
PangoContext *pango_context;
g_return_val_if_fail (xresolution > 0.0, NULL);
g_return_val_if_fail (yresolution > 0.0, NULL);
......@@ -102,18 +101,14 @@ gimp_font_list_new (gdouble xresolution,
list->xresolution = xresolution;
list->yresolution = yresolution;
pango_context = pango_ft2_get_context (xresolution, yresolution);
g_object_set_data_full (G_OBJECT (list), "pango-context", pango_context,
(GDestroyNotify) g_object_unref);
return GIMP_CONTAINER (list);
}
void
gimp_font_list_restore (GimpFontList *list)
{
PangoContext *pango_context;
PangoFontMap *fontmap;
PangoContext *context;
PangoFontFamily **families;
PangoFontFace **faces;
gint n_families;
......@@ -122,11 +117,16 @@ gimp_font_list_restore (GimpFontList *list)
g_return_if_fail (GIMP_IS_FONT_LIST (list));
gimp_container_freeze (GIMP_CONTAINER (list));
fontmap = pango_ft2_font_map_new ();
pango_ft2_font_map_set_resolution (PANGO_FT2_FONT_MAP (fontmap),
list->xresolution, list->yresolution);
pango_context = g_object_get_data (G_OBJECT (list), "pango-context");
context = pango_ft2_font_map_create_context (PANGO_FT2_FONT_MAP (fontmap));
pango_context_list_families (pango_context, &families, &n_families);
pango_font_map_list_families (fontmap, &families, &n_families);
g_object_unref (fontmap);
gimp_container_freeze (GIMP_CONTAINER (list));
for (i = 0; i < n_families; i++)
{
......@@ -144,7 +144,7 @@ gimp_font_list_restore (GimpFontList *list)
font = g_object_new (GIMP_TYPE_FONT,
"name", name,
"pango-context", pango_context,
"pango-context", context,
NULL);
g_free (name);
......@@ -154,6 +154,7 @@ gimp_font_list_restore (GimpFontList *list)
}
g_free (families);
g_object_unref (context);
gimp_list_sort (GIMP_LIST (list), gimp_font_list_font_compare_func);
......
......@@ -16,7 +16,7 @@ AC_INIT(app/core/gimp.c)
GLIB_REQUIRED_VERSION=2.2.0
GTK_REQUIRED_VERSION=$GLIB_REQUIRED_VERSION
PANGOFT2_REQUIRED_VERSION=1.0.0
PANGOFT2_REQUIRED_VERSION=1.2.0
GTKDOC_REQUIRED_VERSION=1.0
GTKHTML2_REQUIRED_VERSION=1.99.5
GIMPPRINT_REQUIRED_VERSION=4.2.0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment