mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-12 16:50:19 +00:00
osx: Set Menlo as default font
This moves the find_font function to the front ends since it depends on pango and cairo
This commit is contained in:
@@ -27,6 +27,9 @@
|
||||
#include "fe-gtk.h"
|
||||
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
#if defined (WIN32) || defined (__APPLE__)
|
||||
#include <pango/pangocairo.h>
|
||||
#endif
|
||||
|
||||
#include "../common/hexchat.h"
|
||||
#include "../common/fe.h"
|
||||
@@ -722,3 +725,33 @@ gtkutil_treeview_get_selected (GtkTreeView *view, GtkTreeIter *iter_ret, ...)
|
||||
return has_selected;
|
||||
}
|
||||
|
||||
#if defined (WIN32) || defined (__APPLE__)
|
||||
gboolean
|
||||
gtkutil_find_font (const char *fontname)
|
||||
{
|
||||
int i;
|
||||
int n_families;
|
||||
const char *family_name;
|
||||
PangoFontMap *fontmap;
|
||||
PangoFontFamily *family;
|
||||
PangoFontFamily **families;
|
||||
|
||||
fontmap = pango_cairo_font_map_get_default ();
|
||||
pango_font_map_list_families (fontmap, &families, &n_families);
|
||||
|
||||
for (i = 0; i < n_families; i++)
|
||||
{
|
||||
family = families[i];
|
||||
family_name = pango_font_family_get_name (family);
|
||||
|
||||
if (!g_ascii_strcasecmp (family_name, fontname))
|
||||
{
|
||||
g_free (families);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
g_free (families);
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user