Use Pango-cairo to list the valid fonts in the system from Gtk-app-devel-list
Fonts list using Pango
#include <glib.h> #include <pango/pangocairo.h>Staticvoid List_fonts () {int i; pangofontfamily * * FAMILIES;int n_families; Pangofontmap * FONTMAP; Fontmap = Pango_cairo_font_map_get_default (); Pango_font_map_list_families (Fontmap, & Families, & N_families); printf ("There is%d families\n", n_families); For (i = 0; i < n_families; i++) {pangofontfamily * family = families[i]; Const char * family_name; family_name = pango_font_family_get_name (family); printf ("Family%d:%s\n", I, Family_name);} g_free (families);} int main (int argc, char * * argv) {list_fonts (); return 0;}
Makefile
Pango-list-typefaces: pango-list-typefaces.c cc-o [email protected]-wall-g pango-list-typefaces.c ' Pkg-config--cflags--libs Pango ' pkg-config--cflags--libs Cairo ' pkg-config--cflags--libs Pangocairo '
Use Pango-cairo to list valid fonts in your system