summaryrefslogtreecommitdiffstats
path: root/src/libnrtype
diff options
context:
space:
mode:
Diffstat (limited to 'src/libnrtype')
-rw-r--r--src/libnrtype/FontFactory.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libnrtype/FontFactory.cpp b/src/libnrtype/FontFactory.cpp
index c2b3c64fe..dd2ecddeb 100644
--- a/src/libnrtype/FontFactory.cpp
+++ b/src/libnrtype/FontFactory.cpp
@@ -513,6 +513,12 @@ static bool StyleNameCompareInternal(const StyleNames &style1, const StyleNames
return( StyleNameValue( style1.CssName ) < StyleNameValue( style2.CssName ) );
}
+static gint StyleNameCompareInternalGlib(gconstpointer a, gconstpointer b)
+{
+ return( StyleNameValue( ((StyleNames *)a)->CssName ) <
+ StyleNameValue( ((StyleNames *)b)->CssName ) ? -1 : 1 );
+}
+
static bool ustringPairSort(std::pair<PangoFontFamily*, Glib::ustring> const& first, std::pair<PangoFontFamily*, Glib::ustring> const& second)
{
// well, this looks weird.
@@ -586,9 +592,12 @@ GList* font_factory::GetUIStyles(PangoFontFamily * in)
pango_font_description_free(faceDescr);
}
g_free(faces);
+
+ ret = g_list_sort( ret, StyleNameCompareInternalGlib );
return ret;
}
+// Used only by pdfinput/svg-builder.cpp (since rewrite to cache style)
void font_factory::GetUIFamiliesAndStyles(FamilyToStylesMap *map)
{
g_assert(map);