Created
April 13, 2018 19:35
-
-
Save raimue/634213828f7ff86b9a6f4698ed488d85 to your computer and use it in GitHub Desktop.
pango-list-typefaces
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pango-list-typefaces: pango-list-typefaces.c | |
cc -o $@ -Wall -g pango-list-typefaces.c \ | |
`pkg-config --cflags --libs pango` \ | |
`pkg-config --cflags --libs cairo` \ | |
`pkg-config --cflags --libs pangocairo` \ | |
`pkg-config --cflags --libs glib-2.0` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <glib.h> | |
#include <pango/pangocairo.h> | |
static void | |
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 are %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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Taken from https://www.lemoda.net/pango/list-fonts/index.html